On Fri, 2009-01-16 at 00:38 +0100, Sebastian Bauer wrote:
> I think ORM supposed to have save insert and update:
>
> save(force_insert=False,force_update=False)
> update() == save(force_update=True)
> insert() == save(force_insert=True)
There was a long discussion a couple of years ago about
W dniu 16.01.2009 16:34, varikin pisze:
>
> On Jan 15, 5:38 pm, Sebastian Bauer wrote:
>
>> I think ORM supposed to have save insert and update:
>>
>> save(force_insert=False,force_update=False)
>> update() == save(force_update=True)
>> insert() == save(force_insert=True)
On Jan 15, 5:38 pm, Sebastian Bauer wrote:
> I think ORM supposed to have save insert and update:
>
> save(force_insert=False,force_update=False)
> update() == save(force_update=True)
> insert() == save(force_insert=True)
>
> in that situation we could have clean code and
> Because I deleted that object. Delete method should be non-reversible
> (except in transactions) like "del" statement in Python. Or anybody
> knows any reason, why it should be reversible?
You didn't delete the object. That'd be spelled ``del instance``. You
called a method called ``delete``
I think ORM supposed to have save insert and update:
save(force_insert=False,force_update=False)
update() == save(force_update=True)
insert() == save(force_insert=True)
in that situation we could have clean code and we know that update is
realy update on DB
i now we can have
On Thu, Jan 15, 2009 at 11:11 PM, Collin Grady wrote:
> On Thu, Jan 15, 2009 at 2:09 PM, Jan Bednařík wrote:
>> That should not happen.
>>
>> instance.delete()
>> instance.save()
>>
>> should raise ObjectDoesNotExist exception. Any other behavior
On Thu, Jan 15, 2009 at 2:09 PM, Jan Bednařík wrote:
> That should not happen.
>
> instance.delete()
> instance.save()
>
> should raise ObjectDoesNotExist exception. Any other behavior is bug.
Why? You have a perfectly valid object instance, and you're then saving it.
2009/1/15 Ian Kelly :
> On Thu, Jan 15, 2009 at 1:58 AM, Jan Bednařík wrote:
>>
>> On Wed, Jan 14, 2009 at 6:51 PM, Sebastian Bauer wrote:
>>>
>>> Hi
>>>
>>> I think it's a bug, but maybe im wrong:
>>>
>>>
>>> print
On Thu, Jan 15, 2009 at 1:58 AM, Jan Bednařík wrote:
>
> On Wed, Jan 14, 2009 at 6:51 PM, Sebastian Bauer wrote:
>>
>> Hi
>>
>> I think it's a bug, but maybe im wrong:
>>
>>
>> print Categories.objects.count()
>> >>0
>> new_obj =
On Thu, Jan 15, 2009 at 2:58 AM, Jan Bednařík wrote:
> this is happening, because Django ORM is not working as what you
> expect from ORM.
>
> In real ORM, this:
No... I don't think you mean "real ORM", I think you mean
"identity-mapping ORM". Those terms are not the
On Wed, Jan 14, 2009 at 6:51 PM, Sebastian Bauer wrote:
>
> Hi
>
> I think it's a bug, but maybe im wrong:
>
>
> print Categories.objects.count()
> >>0
> new_obj = Categories.objects.create(name="test")
> instance_1 = Categories.objects.get(pk=new_obj.pk)
> instance_2 =
On Wed, Jan 14, 2009 at 12:51 PM, Sebastian Bauer wrote:
>
> Hi
>
> I think it's a bug, but maybe im wrong:
>
>
> print Categories.objects.count()
> >>0
> new_obj = Categories.objects.create(name="test")
> instance_1 = Categories.objects.get(pk=new_obj.pk)
> instance_2 =
On Wed, Jan 14, 2009 at 9:51 AM, Sebastian Bauer wrote:
> how orm can save second instance of the same row when its deleted?
Deleting an object won't magically remove all references to it - the
instance_2 variable still has a perfectly valid object, so saving it
just
Hi
I think it's a bug, but maybe im wrong:
print Categories.objects.count()
>>0
new_obj = Categories.objects.create(name="test")
instance_1 = Categories.objects.get(pk=new_obj.pk)
instance_2 = Categories.objects.get(pk=new_obj.pk)
instance_1.delete()
print Kategorie.objects.count()
>>0
14 matches
Mail list logo