On 24/10/2009, at 11:48, Bill Moseley wrote:

Can the virtual view inherit from the user? That is, can I convince DBIC that the object returned is a real user object so I can update the object and have it written to storage? The cookbook just says that the view cannot be operated on. Obviously, it would be much more useful to have a real user object.

You can do it if you use a DBMS with RULEs support (like PostgreSQL).
Or you can setup a belongs_to rel (where is_foreign_key_constraint => 0) to the user and override qw/insert delete update/ row methods in your view class to do such operations on ->referred_user instead of $self, like you would do with RULEs on DBMS.

--
wallace reis/wreis Catalyst and DBIx::Class consultancy with a clue
   Software Engineer          and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk     http://www.linkedin.com/in/wallacereis

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to