Hello Django Users,

I try to have some additional data per user, like DOB, a picture,
gender, stuff...

My thought was to have a OneToOneField in one of my selfdefined models
like that:

--- cut ---
from django.core import meta
from django.models.auth import User

class Member(meta.Model):
  uid = meta.OneToOneField(User)
  gender = meta.CharField(maxlength=1, choices=GENDER_CHOICES)
  dob = meta.DateField()
  desc = meta.TextField()
  [etc.pp.]
--- cut ---

When I try to install that, everything works correctly, also the SQL
looks good to me.

But when I try to use the admin interface, it gives me bad errors:

--- cut ---
OperationalError at /app/admin/match/members/
(1109, "Unknown table 'auth_users' in order clause")
--- cut ---

A quick lookup gave me the following SQL statement generated for the
lookup: (Hooray for the _great_ debug pages :)

--- cut ---
'SELECT
`match_members`.`uid_id`,`match_members`.`image`,`match_members`.`gender`,`match_members`.`dob`,`match_members`.`desc`
FROM `match_members` ORDER BY `auth_users`.`username` DESC'
--- cut ---

which does not contain 'auth_users' in the FROM clause.

Is it my fault, what am I doing wrong?

Or is it the complete wrong way to have that additional user data?

I'm using mysql, django dev rev. 1809

Thanks for your help and a happy new year

:)


--
Andreas Neumeier
http://andreas.neumeier.org || http://lovebox.ath.cx ||
mailto:andreas(at)neumeier.org

Reply via email to