registration.supplements package¶
Subpackages¶
Submodules¶
registration.supplements.base module¶
-
class
registration.supplements.base.
RegistrationSupplementBase
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A registration supplement abstract model
Registration supplement model is used to add supplemental information to the account registration. The supplemental information is written by the user who tried to register the site and displaied in django admin page to help determine the acceptance/rejection of the registration
The
__str__()
method is used to display the summary of the supplemental information in django admin’s change list view. Thus subclasses must define them own__str__()
method.The
get_form_class()
is a class method return a value ofform_class
attribute to determine the form class used for filling up the supplemental informatin in registration view ifform_class
is specified. Otherwise the method create django’sModelForm
and return.The
get_admin_fields()
is a class method return a list of field names displayed in django admin site. It simply return a value ofadmin_fields
attribute in default. If the method returnNone
, then all fields exceptid
(and fields inadmin_excludes
) will be displayed.The
get_admin_excludes()
is a class method return a list of field names NOT displayed in django admin site. It simply return a value ofadmin_excludes
attribute in default. If the method returnNone
, then all fields selected withadmin_fields
exceptid
will be displayed.The
registration_profile
field is used to determine the registration profile associated with.related_name
of the field is used to get the supplemental information in_get_supplement()
method ofRegistrationProfile
thus DO NOT CHANGE the name.-
RegistrationSupplementBase.
admin_excludes
= None¶
-
RegistrationSupplementBase.
admin_fields
= None¶
-
RegistrationSupplementBase.
form_class
= None¶
-
classmethod
RegistrationSupplementBase.
get_admin_excludes
()[source]¶ Return a list of field names NOT displayed in django admin site
It is simply return a value of
admin_excludes
in default. If it returnsNone
then all fields (selected inadmin_fields
) exceptid
will be displayed.
-
classmethod
RegistrationSupplementBase.
get_admin_fields
()[source]¶ Return a list of field names displayed in django admin site
It is simply return a value of
admin_fields
in default. If it returnsNone
then all fields exceptid
(and fields inadmin_excludes
) will be displayed.
-
classmethod
RegistrationSupplementBase.
get_form_class
()[source]¶ Return the form class used for this registration supplement model
When
form_class
is specified, this method return the value of the attribute. Otherwise it generate django’sModelForm
, set it toform_class
and return itThis method MUST BE class method.
-
RegistrationSupplementBase.
registration_profile
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
RegistrationSupplementBase.
registration_profile_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Module contents¶
-
registration.supplements.
get_supplement_class
(path=None)[source]¶ Return an instance of a registration supplement, given the dotted Python import path (as a string) to the supplement class.
If the addition cannot be located (e.g., because no such module exists, or because the module does not contain a class of the appropriate name),
django.core.exceptions.ImproperlyConfigured
is raised.