del):
> owner = models.ForeignKey(Person)
> name = models.CharField(max_length=30)
>
> Than it will work.
>
> On Fri, Aug 6, 2010 at 7:25 AM, bhuztez wrote:
> > I have my models declared in this way:
>
> > class Person(models.Model):
> >
I have my models declared in this way:
class Person(models.Model):
name = models.CharField(max_length=50, unique=True)
class Pet(models.Model):
owner = models.ForeignKey(Person, to_field='name')
name = models.CharField(max_length=30)
def __unicode__(self):
2 matches
Mail list logo