That worked!
Thanks,
Dudley
On Wed, Jul 22, 2009 at 2:49 PM, Some Guy wrote:
>
> Just a guess, but maybe...
>
p = mymodels.Person()
p.name="John Smith"
f = mymodels.Friend()
f.name = "John Q. Smith"
>
> add this here so it gets an id??
> f.save()
>
p.friend = f
p.sa
Just a guess, but maybe...
>>> p = mymodels.Person()
>>> p.name="John Smith"
>>> f = mymodels.Friend()
>>> f.name = "John Q. Smith"
add this here so it gets an id??
f.save()
>>> p.friend = f
>>> p.save()
On Jul 22, 12:15 pm, Dudley Fox wrote:
> I have a simple test model defined:
>
> class Fr
I have a simple test model defined:
class Friend(models.Model):
name = models.CharField(max_length=120)
class Person(models.Model):
name = models.CharField(max_length=120)
friend = models.OneToOneField(Friend)
Here is a sample of usage, and obviously I am doing something wrong...
>>> p
3 matches
Mail list logo