Re: Update database field

2006-11-18 Thread Manu J
Hi, This is what i ended up doing in a project of mine.But this involved two DB calls One to retrieve and another to save, but with just SQL can be accomplished in a single UPDATE statement. Django docs menthion that if you explicitly specify an id (primary key ) it should update the db. So I d

Re: Update database field

2006-11-14 Thread [EMAIL PROTECTED]
Yea, that will work. Get the "thing" change the value store it. tinti wrote: > Got it: > > update = Queue.objects.get(message=message_id) > update.read = 1 > update.save() > > I thinks this is the correct way, if not somebody can advise me another > ;) > > On Nov 14, 11:37 am, "tint

Update database field

2006-11-14 Thread tinti
Hi all, I need some help updating a database field. Can someone post me an example on updating a database field using the views.py and a static value to update. For example each time an item is requested set the field read to 1. I have to build something similar. Thanks for any reply tinti --~

Re: Update database field

2006-11-14 Thread tinti
Got it: update = Queue.objects.get(message=message_id) update.read = 1 update.save() I thinks this is the correct way, if not somebody can advise me another ;) On Nov 14, 11:37 am, "tinti" <[EMAIL PROTECTED]> wrote: > Hi all, > I need some help updating a database field. Can someone