Model Blues - A Newbie's question

2008-02-04 Thread nikosk
I need the default value of a field in a model to be the id of the user creating the new instance of the object the model is modeling ( am I making sense at all?) i.e. : class Article(models.Model): category = models.ForeignKey(Category) title = models.CharField(max_length=200) sub_ti

Re: Model Blues - A Newbie's question

2008-02-06 Thread nikosk
simply > put it into your view as all views get the request, request.user will > provide you with what you need. > > On Feb 4, 2:48 pm, nikosk <[EMAIL PROTECTED]> wrote: > > > I need the default value of a field in a model to be the id of the > > user creating the

Django models - newbie question

2008-06-07 Thread nikosk
Hi all Does anyone know how to do something like this : class Game(models.Model): team1 = models.ForeignKey(Teams, related_name=u'team_home') team2 = models.ForeignKey(Teams , related_name=u'team_away') round = models.ForeignKey(Round) game_date = models.DateField() def __uni