Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best way would be to create in the app where you have Organization a file (say, "forms.py"), and do this:</p> <pre><code>from registration.forms import RegistrationForm from forms import * from models import Organization class RegistrationFormWithOrganization(RegistrationForm): organization_logo = field.ImageField() organization_name = field.CharField() def save(self, profile_callback = None): Organization.objects.get_or_create(user = self.cleaned_data['user'], logo = self.cleaned_data['organization_logo'], name = self.cleaned_data['organization_name']) super(RegistrationFormWithOrganization, self).save(self, profile_callback) </code></pre> <p>And then in your base URLs, override the existing URL to registration, and add this form as your the form to use:</p> <pre><code> form organization.forms import RegistrationFormWithOrganization url('^/registration/register$', 'registration.views.register', {'form_class': RegistrationFormWithOrganization}), url('^/registration/', include('registration.urls')), </code></pre> <p>Remember that Django will use the first URL that matches the regexp, so will match your call and not django-registration's. It will also tell registration to use your form, not its own. I've skipped a lot of validation here (and, probably, the derivation of the user object... if so, go read the source code to registration to see where it comes from), but this is definitely the right track to get a few things into the page with a minimum amount of effort on your part.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload