At 01:04 -0600 24-03-99, David Neumann wrote:
>Well, yeah, if you make the Session the delegate of the editing context
>(which is passed in here)... but why would you want to?  The idea of
>putting the defaults in the EO is so they are the EO's problem... not
>controller code like your session.


Thanks for your answer!

What I want to do is to set some default values for the objects I insert.
There is (as allways :) many ways of doing this.

I am not sure what is the smartest way, but I tried with a awakeFromInsert
in the class generated from EOModeler. In that awakeFromInsert I now set
the "created" attribute of my object. That works ok.

I also have a "owner" attribute, that should be equal to the
session().username(). I now have created a method in the component where I
insert the object that does the job when pressing the "insert"-button, and
in that method I now set the "owner" attribute. That too work ok.

Maybe I was wrong, but I was thinking that I should use the awakeFromInsert
to set all the default values for new objects that is inserted into the
database.



-Kaj :)

Reply via email to