Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 1, 2005 15:15:28

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

pre_save problem


In a foreign key relationsship (like Polls and Choices in the
tutorial), the _pre_save() definition tries to retrieve the subordinate
("choices") items from the database. I really would like to get hold of
the subordinate items prior to being saved to database (well, it's
called pre_save, right?) in order to do some simple calculations before
the items get saved.

Does anyone know how this could be done?

Offline

#2 Nov. 1, 2005 17:39:09

Adrian H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

pre_save problem


On 11/1/05, stava <> wrote:
> In a foreign key relationsship (like Polls and Choices in the
> tutorial), the _pre_save() definition tries to retrieve the subordinate
> ("choices") items from the database. I really would like to get hold of
> the subordinate items prior to being saved to database (well, it's
> called pre_save, right?) in order to do some simple calculations before
> the items get saved.
>
> Does anyone know how this could be done?

A model's _pre_save() method doesn't have access to any related objects.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Offline

#3 Nov. 1, 2005 19:42:42

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

pre_save problem


OK, thanks.

Offline

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support