Guest User

Untitled

a guest
Mar 27th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.36 KB | None | 0 0
  1. cat site/register/forms.py
  2. #!/usr/bin/env python
  3. # -*- coding: utf-8 -*-
  4.  
  5. from registration.forms import RegistrationForm
  6. from django import forms
  7. class UserRegistrationForm(RegistrationForm):
  8.     #unique_id = forms.CharField(min_length=12,max_length=12,label=("Unique id"))
  9.     user = models.ForeignKey(User, unique=True)
  10.     url = models.URLField("Website", blank=True)
  11.     company = models.CharField(max_length=50, blank=True)
  12. settings.py
  13. AUTH_PROFILE_MODULE = "account.UserProfile"
  14.  
  15. ./manage.py shell
  16. Python 2.7.3 (default, Mar 22 2013, 00:04:12)
  17. [GCC 4.6.3] on linux2
  18. Type "help", "copyright", "credits" or "license" for more information.
  19. (InteractiveConsole)
  20. >>> from registration.forms import RegistrationForm
  21. >>> f =  RegistrationForm()
  22. >>> print f
  23. <tr><th><label for="id_username">Username:</label></th><td><input id="id_username" type="text" class="required" name="username" maxlength="30" /></td></tr>
  24. <tr><th><label for="id_email">E-mail:</label></th><td><input id="id_email" type="text" class="required" name="email" maxlength="75" /></td></tr>
  25. <tr><th><label for="id_password1">Password:</label></th><td><input id="id_password1" type="password" class="required" name="password1" /></td></tr>
  26. <tr><th><label for="id_password2">Password (again):</label></th><td><input id="id_password2" type="password" class="required" name="password2" /></td></tr>
Advertisement
Add Comment
Please, Sign In to add comment