Hi,
I'm new to django and python in general so, I'm not sure if the way
I'm doing this is the most correct way. But I'm writing a manager
application for FTP... I keep the user accounts in a database and I'm
writing the django app to manage it.
Anyway, I have three models more or less like this(just shortened for
brevity):
class Groups(models.Model):
group_name = models.CharField(max_length=30)
gid = models.IntegerField()
class Users(models.Model):
user_name = models.CharField(max_length=32)
realname = models.CharField(max_length=50)
uid = models.IntegerField()
gid = models.IntegerField()
class User_Group(models.Model):
user = models.ForeignKey(Users)
groups = models.ForeignKey(Groups)
The users and groups are supposed to be just like a Unix/Linux groups
setup... uid is unique for the user (but i didn't want to have it as
the primary key) and the gid is just the primary group id not going to
be user adjustable... but the User_Group model is where I'm having the
trouble...
I want to allow a user to belong to more than one group from the
Groups model... So, I was thinking of just having multiple entries for
the same user in the User_Group model with all the different groups
they belonged to... but how to I get that into a form? or link to
that model at all... i've been looking around for a couple days off
and on and haven't really found anything that helps me figure it
out... any ideas or pointers would be greatly appreciated...
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---