Hi, I am totally new. I am trying make TimeTracker project.
Now I am playing only with admin interface.

I have this model:

class User(models.Model):
        timestamp = models.DateTimeField()
        login = models.CharField()
        password = models.CharField()

# does not work, Project is not defined here
#       projects = models.ManyToManyField(Project,
filter_interface=models.HORIZONTAL)

        def __str__(self):
                return self.login

        class Admin:
                fields = (
                        (None, {'fields':('timestamp',)}),
                        (None, {'fields':('login',)}),
                        (None, {'fields':('password',)}),
# does not work, unknown projects
#                       (None, {'fields':('projects',)}),
                )

class Project(models.Model):
        timestamp = models.DateTimeField()
        name = models.CharField()
        users = models.ManyToManyField(User,
filter_interface=models.HORIZONTAL)

        def __str__(self):
                return self.name

        class Admin:
                list_filter = ('name', 'timestamp')
                search_fields = ('name',)

While editing Project, I am able to select existing users which
belongs to project.
It is possible to show list of Projects while editing User?


Thanks.

Stano Paška


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to