1

I am trying to add extra fields to django-registration-redux but cannot seem to get it working, I have seen this question has been asked before but it has only been asked for django-registration not django-registration-redux which is different. If someone could please direct me as to what to do that would be great. So far I am defined a model and form as you can see below. Any help appreciated, thanks!

P.S. My model is being registered in the admin page however it will not show up on the register page.

Model -

from django.db import models
from django.contrib.auth.models import User

class EmployerProfile(models.Model):

user = models.OneToOneField(User, unique=True)
home_number = models.IntegerField(max_length=12)
mobile_number = models.IntegerField(max_length=12)
business_name = models.CharField(max_length=50)
business_address_number = models.IntegerField()
business_address_street = models.CharField(max_length=50)
business_address_region = models.CharField(max_length=50)
business_address_suburb = models.CharField(max_length=50)
business_address_postcode = models.IntegerField()
business_industry = models.CharField(max_length=50)

def __unicode__(self):
    return self.business_name

Form -

from django import forms
from registration.forms import RegistrationForm

class EmployerForm(RegistrationForm):

region_choice = (
    ('1', 'Auckland'),
    ('2', 'Wellington'),
    ('3', 'Christchurch')
)
suburb_choice = (
    ('1', 'Glendowie'),
    ('2', 'Kohimarama'),
    ('3', 'Mission Bay')
)
industry_choice = (
    ('1', 'Restaurant'),
    ('2', 'IT'),
    ('3', 'Construction')
)

home_number = forms.IntegerField()
mobile_number = forms.IntegerField()
business_name = forms.CharField()
business_address_number = forms.IntegerField()
business_address_street = forms.CharField()
business_address_region = forms.ChoiceField(choices=region_choice)
business_address_suburb = forms.ChoiceField(choices=suburb_choice)
business_address_postcode = forms.IntegerField()
business_industry = forms.ChoiceField(choices=industry_choice)
eZ_Harry
  • 816
  • 9
  • 25

1 Answers1

1

Answer:

Add this to the urls.py -

url(r'accounts/register/$', RegistrationView.as_view(form_class=EmployerForm), name='registration_register'),
doru
  • 9,022
  • 2
  • 33
  • 43
eZ_Harry
  • 816
  • 9
  • 25