About Registration Supplement¶
Registration Supplement is a django model class which inherit
registration.supplements.RegistrationSupplementBase.
It is used to add supplemental information to each registration.
Filling the supplemental information is required in registration step
and the filled supplemental information will be displayed in Django Admin
page.
To disable this supplement feature, set REGISTRATION_SUPPLEMENT_CLASS to
None in your settings.py.
Quick tutorial to create your own Registration Supplement¶
Create new app named
supplementtutwith the command below:$ ./manage.py startapp supplementtut
Create new registration supplement model in your
models.pyas:from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from registration.supplements.base import RegistrationSupplementBase class MyRegistrationSupplement(RegistrationSupplementBase): realname = models.CharField("Real name", max_length=100, help_text="Please fill your real name") age = models.IntegerField("Age") remarks = models.TextField("Remarks", blank=True) def __str__(self): # a summary of this supplement return "%s (%s)" % (self.realname, self.age)
Add
supplementtuttoINSTALLED_APPSand setREGISTRATION_SUPPLEMENT_CLASSto"supplementtut.models.MyRegistrationSupplementin yoursettings.pyDone, execute
syncdbandrunserverto confirm your registration supplement is used correctly. See more documentation inregistration.supplements.RegistrationSupplementBase