To answer my own question on doing a psql dump of the data base found the 2 records
-- in books_user auth_user --now that the custom user has been entered on models.
Should of known from the line -- import from books.models import user
On Wednesday, December 21, 2016 at 9:46:20 PM UTC+1, NoviceSortOf wrote:
On Wednesday, December 21, 2016 at 9:46:20 PM UTC+1, NoviceSortOf wrote:
From the command line in Python>>from books.models import user>>custs = list(rusers.objects.all())>>print custs>>[<user: TEST145>, <user: TEST1459>]From SQLSELECT * FROM auth_user WHERE username LIKE '%TEST%'-- None found.auth_user has been vacuumed, and reindexed during the tests.- Where and in what schema are these mysterious 2 user rows being stored?Any clues welcome.Models.py excerpt follows.------------------------------------------------------------ ------------------------------ ------------------------------ ------------ From books.models.pyfrom django.db import modelsfrom django.contrib.auth.models import Userfrom django.core import validatorsfrom django.utils.http import urlquotefrom django.utils.translation import ugettext_lazy as _from django.core.mail import send_mailimport re# from userprofile.models import BaseProfilefrom django.utils.translation import ugettext as _from django.conf import settingsimport datetimefrom django.utils import timezonefrom django.contrib.auth.models import BaseUserManagerfrom django.contrib.auth.models import UserManagerfrom django.contrib.auth.models import AbstractBaseUser, PermissionsMixinclass user(AbstractBaseUser, PermissionsMixin):"""Custom user structure"""username = models.CharField(_('username'), max_length=30, unique=True, help_text=_('Required. 30 characters or fewer. Letters, numbers and ''@/./+/-/_ characters'),validators=[validators.RegexValidator(re.compile('^[\w.@+-]+$'), _('Enter a valid username.'), 'invalid') ])first_name = models.CharField(_('first name'), max_length=30, blank=True)last_name = models.CharField(_('last name'), max_length=30, blank=True)email = models.EmailField(_('email address'), blank=True)is_staff = models.BooleanField(_('staff status'), default=False,help_text=_('Designates whether the user can log into this admin ''site.'))is_active = models.BooleanField(_('active'), default=True, help_text=_('Designates whether this user should be treated as ''active. Unselect this instead of deleting accounts.'))date_joined = models.DateTimeField(_('date joined'), default=timezone.now)objects = UserManager()USERNAME_FIELD = 'username'REQUIRED_FIELDS = ['email']
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/95273b62-639a-44fe-b180-e0cf6a9c1f33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment