Re: strange behavior of primary_key and ManyToManyField

2007-10-01 Thread zeliboba
Nis Jørgensen wrote: > Yes, this is a bug. ok, I'll make a bug ticket > .add(a) to gfive a foreign key violation. Does your backend support > foreign keys? I guess so, I'm using sqlite3 > Also, if you understand what is happening, why aren't you just doing > what Leo is suggesting, rather tha

Re: strange behavior of primary_key and ManyToManyField

2007-10-01 Thread Nis Jørgensen
zeliboba skrev: > actually, I understand how it works, it seems to be a bug anyway. > consider this: > > from django.db import models > > class Author(models.Model): > name = models.CharField(maxlength=50) > > class Reference(models.Model): > """ > >>> a = Author(name='some name') >

Re: strange behavior of primary_key and ManyToManyField

2007-09-29 Thread zeliboba
actually, I understand how it works, it seems to be a bug anyway. consider this: from django.db import models class Author(models.Model): name = models.CharField(maxlength=50) class Reference(models.Model): """ >>> a = Author(name='some name') >>> a.save() >>> r = Reference(

Re: strange behavior of primary_key and ManyToManyField

2007-09-28 Thread Leo
Django's beautiful abstraction of object-orientation is leading you astray... here's the test that will work (note the earlier added r.save()): from django.db import models class Author(models.Model): name = models.CharField(maxlength=50) class Reference(models.Model): """ >>> a =

strange behavior of primary_key and ManyToManyField

2007-09-27 Thread zeliboba
hi again I'm writing custom scientific reference management application and encountered a strange thing, cannot understand if it is bug or feature, see example models.py: from django.db import models class Author(models.Model): name = models.CharField(maxlength=50) class Reference(models.M