Greetings,

I'm not sure if this is the best way to go about achieving my goal, so
please let me know if there is a better way. First a little background:

I'm working on a website with authentication, and at the time of user
creation I'd like the applicant to be able to select the school they go
to. It would appear that there's no sane way to add on to the User
model and add another profile field to the auth_user table and have it
fit nicely, so I created a new model, 'user_affil'. This looks like:

from django.db import models
from linuxsite.apps.schools.models import School
from django.contrib.auth.models import User

# Create your models here.
class user_affil(models.Model):
   user = models.ForeignKey(User, edit_inline=models.TABULAR,
core=True)
   school = models.OneToOneField(School, core=True)

So I'm relating each user to a school. The school model is as such:
class School(models.Model):
   name    = models.CharField("School Name", maxlength=50, unique=True)

So it's a reasonably simple relation. I want to be able to edit a
user's school from the admin interface, and I'd like a nice clean way
to do so under regular views. I suspect things are going to be fine
outside of admin land, but I'm running into a problem. Check out this
screenshot:

http://gis.clemson.edu/~gtaylor/shot.png

With any number of schools defined, I'm only seeing the "User" header
and some static text indicating the user's current school under the
standard Django 'Change User' admin interface. I'd like to have a
dropdown box there so I can select a different school.

Am I doing this completely wrong and is there a better way to do it?
I'm going to need to do some other similar relations down the road, so
figuring this out will allow for a lot of other things down the road
for my project.

Any feedback is appreciated. I've been looking through the
documentation, but the examples don't seem to cover this well.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to