Its a typo. It should've been...
>> pid = models.ForeignKey(Person)
On Jun 9, 5:06 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> What is this `pid = models.ForiegnKey()` ?
>
> On 9 июн, 23:44, Huuuze <[EMAIL PROTECTED]> wrote:
>
> > I have the following models in my models.py file:
>
> > >>
What is this `pid = models.ForiegnKey()` ?
On 9 июн, 23:44, Huuuze <[EMAIL PROTECTED]> wrote:
> I have the following models in my models.py file:
>
> >> class Person(models.Model):
> >> pid = models.AutoField(primary_key=True)
> >> fname = models.CharField(max_length=50)
> >> lname =
from:
http://www.djangoproject.com/documentation/db-api/
Backward
If a model has a ForeignKey, instances of the foreign-key model will have
access to a Manager that returns all instances of the first model. By
default, this Manager is named FOO_set, where FOO is the source model name,
I have the following models in my models.py file:
>> class Person(models.Model):
>> pid = models.AutoField(primary_key=True)
>> fname = models.CharField(max_length=50)
>> lname = models.CharField(max_length=50)
>> class Books(models.Model)
>> bid = models.AutoField(primary_key=True)
>>
4 matches
Mail list logo