I tried this before I comment it. But it has error: Error: Couldn't install apps, because there were errors in one or more models: timetracker.tracker: name 'Project' is not defined
I think because class Project is defined after User in source code. If I copy Project above User, timetracker.tracker: name 'User' is not defined I remember that In C language I can write function header at the start of source code and function body later... I need something like this in this case... It can be done somehow? Stano. KpoH napísal(a): > projects = models.ManyToManyField('Project', > > without comments :) > > stano : > > 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 Paka > > > > > > > > > > > -- > Artiom Diomin, Development Dep, "Comunicatii Libere" S.R.L. > http://www.asterisksupport.ru > http://www.asterisk-support.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---