You could try something like this (in models.py)

from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class Interest(models.Model):
    label = models.CharField(max_length=64)
    users = models.ManyToManyField(User, blank=True)
    def __unicode__(self):
        return unicode(self.label)

You can enable the admin interface for the Interest model so that the
list if interests can be easily updated without have to edit any
code.  You can generate the form that the users fill out
programmatically.

Given any Interest i, you will have i.users that represents all of the
Users who have indicated that interest applies to them.

Given any User u, u.interest_set will be the collection of all of the
Interests that they have.

--gordy
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to