Jonathan LaCour wrote: > Charles Duffy wrote: >> When building a mapper manually, one can control ordering per >> http://sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_orderby; >> I don't see a mechanism (in either code or documentation) for doing >> the same via ActiveMapper. Are there any plans for adding similar >> support to ActiveMapper for specifying this on a per-relation or >> per-mapper basis? > > This would be a great addition to ActiveMapper, and I have definitely > thought about putting this into the code, but have not yet had the time > to make this happen. Contributions are, of course, welcome ;)
Given all the great support I've received here, I'm more than glad to try my hand at a patch -- but not tonight; I'm 2.5hrs past my bedtime already. Hmm. For per-relation settings, it looks extremely straightforward: Add some new members to the relationship class, and allow them to be assigned from the relevant constructors; then, when all the relation objects are being instantiated in process_relationships(), I just pass in the extra members; nothing to it. >> Alternately, has there been thought given to providing a mechanism by >> which arbitrary keyword arguments for creation of relations or mappers >> could be passed through to the underlying code via ActiveMapper? > > I am not sure this will work right now. Currently, ActiveMapper is > using `assign_mapper` to create and attach mappers to classes, and in > order to support ordering either in an explicit way or by being able to > pass arbitrary keyword arguments, we would have to change this. I don't think I understand the impediment here -- it looks to me like extra keyword arguments can be passed through to assign_mapper() and will from there make it into the constructor for the mapper itself. What am I missing? _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users