Thanks for the quick fixe. Couldn't this read only class property also be set on any mapped attribute so that I can remove the boilerplate Synonym and just use the original mapped attribute as a read only one? A mapper level readonly option (like column_prefix) would be very useful too.
On 27 juin, 22:47, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Jun 27, 2007, at 3:48 PM, jdu wrote: > > > > > > > It seems that both options don't work in common: > > > dates = Table('dates', meta, > > Column('date', Date, primary_key=True) > > ) > > mapper(MyDate, dates, column_prefix='_', properties=dict( > > date = synonym('_date'), > > ) > > > produces with 0.3.8: > > > ArgumentError: WARNING: column 'date' not being added due to property > > '<sqlalchemy.orm.interfaces.SynonymProperty object at 0x8ec91ac>'. > > Specify 'allow_column_override=True' to mapper() to ignore this > > condition. > > this is a bug, fixed in r2795. > > > > > I don't want override. My underlying goal is to make MyDate readOnly. > > As mapped attributes are already properties, it would be great to be > > able to > > 'declare' the readonly behaviour in the mapper. > > id say this is out of scope for mapper. id favor adding a "property" > argument to SynonymProperty that specifies a property class (i.e. > __get__(), __set__(), __delete__()) to be assembled on the class > (currently the proxy=True argument will assemble a default accessor > to the column-mapped attribute). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---