Closed mariobehling closed 7 years ago
@mariobehling @niranjan94 I was going through this issue and the parent one. here's my thought: Right now the registration form is pretty basic one its totally in template I was planning to extend it via WTForms so that it will be easier to make custom fields afterwards and extend these fields to the template as well. To handle input about registration form from event creator which fields to take I thought we can make another form there with bool options to add these fields. We will make a function in guest userend's registration form to remove fields not selected. Should I proceed with this to solve the issue with this.
from flask_wtf import Form
from wtforms import StringField, SelectField,
from wtforms.validators import *
from wtforms.fields.html5 import TelField
class RegistrationForm(Form):
first_name = StringField('First_Name', validators=[DataRequired()])
last_name = StringField('Last_Name', validators=[DataRequired()])
email = StringField('Email', validators=[DataRequired(), Email()])
email_confirm = StringField('Email_Confirm', validators=[DataRequired(), Email()])
job_title = StringField('Job_Title', [validators.Length(min=3, max=30)])
phone_no = TelField('Phone_no')
work_phone = TelField('Work_Phone')
mobile_phone = TelField('Mob_no')
tax_business_info = StringField('Tax_Business_Info', validators=[DataRequired()])
billing_address = StringField('Billing_Address', validators=[Length(max=100)])
home_address = StringField('Home_Address', validators=[Length(max=100)])
work_address = StringField('Work_Address', validators=[Length(max=100)])
shipping_address = StringField('Shipping_Address', validators=[Length(max=100)])
organisation = StringField('Organisation', validators=[Length(max=50)])
website = StringField('Website', validators=[Url()])
blog = StringField('Blog', validators=[Url()])
twitter = StringField('Twitter', validators=[Url()])
facebook = StringField('Facebook', validators=[Url()])
git_repo = StringField('Git_Repo', validators=[Url()])
gender = SelectField('Gender', choices=[('M','Male'),('F','Female'),('U','Prefer Not to Declare')])
#define auto updation function of fields if the user is logged in
something like this
@HitenSethiya please go ahead
But before that read through this issue and the attached parent clearly to ensure you understand what the requirements are.
Definitely Thanks
@niranjan94 @mariobehling How should I store the fields in the database? Since right now there's nothing in the registration form to store, the initiate_invoice_payment function only stores the invoice/billing info in the database through the InvoiceManager.initiate_invoice_payment function, I don't have much clue how to store the new fields also I am guessing existing user model/guest user entries right now doesn't have these extra fields.
@HitenSethiya the fields can be added to app/models/ticket_holder.py
@niranjan94 Sir, I have done a lot of changes :sweat_smile: and its like butterfly effect every change arises a new problem ... Mainly because the ticket_holder model is extended there are some views which are not fixed accordingly, so right now I am struggling to debug it out. Shall I take some more time and figure them out on my own or just create a PR and debug the code here. :smile:
@HitenSethiya sure ... You can take your time :)
frontend
tag added. Issue will be re-created on the frontend repo.
Subissue to: https://github.com/fossasia/open-event-orga-server/issues/2897
In the first step of creating a form we need a detailed form, that does not need to have the option for customized form elements. Please implement this below the ticket information on wizard step 1.
Please implement:
For the detailed registration form implement the following additional fields and give the option "required"
For the design:
It should be filled in by attendees in the attendee form.