My models.py

class Foo(models.Model):
    name = models.CharField(max_length = 100)

    def save(self):
        self.id = None
        super(Foo, self).save()

class Bar(Foo):
    created = models.DateTimeField(auto_now_add = 1)


This gives me,

In [1]: from djcalendar.models import Foo

In [2]: shabda  = Foo(name = 'Shabda')

In [3]: shabda.save()

In [4]: Foo.objects.all()
Out[4]: [<Foo: Foo object>]

In [5]: shabda.name = 'Shabda Raaj'

In [6]: shabda.save()

In [7]: Foo.objects.all()
Out[7]: [<Foo: Foo object>, <Foo: Foo object>]


Which is what I expect. Now doing the same thing to Bar

In [1]: from djcalendar.models import Bar

In [2]: shabda  = Bar(name = 'Shabda')

In [3]: shabda.save()

In [4]: shabda.name = 'Shabda Raaj'

In [5]: shabda.save()

In [6]: Bar.objects.all()
Out[6]: [<Bar: Bar object>]

Here I am expecting two objects, similar to what happened with Foo,
but I get only one.

Am I missing something, or is this a bug?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to