Yes, I saw this case and that's what I need... The point is that the proposed fix implies to patch the django core which I would prefer to avoid. The other solution need to add as many lines of code as you have associated objects (and for all objects)... which is quite heavy (if you add a foreign key to your table you need to update the model definition + the reload method...). F.
On Jul 31, 2:30 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Fri, Jul 31, 2009 at 5:51 AM, Fleg <francois.legr...@gmail.com> wrote: > > > Thanks for your suggestion, but I cannot... I need to do that from a > > method of the model itself. > > Basically, I need to use some stored procedures to modify datas in the > > database (and these stored procs can also modify some other tables), > > thus I need to reload after calling these procedures in order to > > update the modified values. And this must be done from the instance > > because it's only a part of a process. > > > Example: > > action=Scheduler.objects.get(id_schedule=22) > > action.do_something() > > > and in the Scheduler class I have > > def do_something(self): > > call_proc_stock_1() --> this will update id_status in table > > schedule and modify the line corresponding to the id_release in table > > release > > do_smething_else() etc... > > > So after call_proc_stock_1() I need to reload to have the correct > > (updated) id_status and id_release objects (and not only the value of > > the key, the whole associated object). > > Sounds similar to the use case for reload that was mentioned here: > > http://code.djangoproject.com/ticket/901 > > That was closed wontfix, but the discussion includes a way to accomplish the > desired effect: reload the model instance into a new object, and re-set the > possibly changed attribute(s) on the existing instance from the newly-loaded > one. > > Karen --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---