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
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
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
3 matches
Mail list logo