Hi Chris,

Hmm, 'till now it's more like a guy inventing screws and looking for a screw
driver but finding only hammers:

- I want to generate classes/tables based on metadata in another table in
the database, filled by "designers" not programmers.
- From the designer perspective data will be separated from
procedures/methods, which should be type safe (preferably at "design time")
- Multiple inheritance (from the designer perspective) provides flexibility
in contracts ~ data attributes an object is sure to provide.
- The diamond problem would complicate matters too much for designers (and
for me), now it just checks whether a data attribute name already exists in
a superclass.
- SQLalchemy does not provide multiple inheritance (just single) out of the
box, as far as i have been able to figure out.

There are more requirements, like in the end having (persistent) objects
that still work like python classes for basic programming.

Not all problems can be solved with a simplistix approach ;-).

Cheers, Lars


On Mon, Mar 21, 2011 at 11:52 PM, Chris Withers <ch...@simplistix.co.uk>wrote:

> On 21/03/2011 19:29, farcat wrote:
>
>> Hi Chris,
>>
>> The short answer is that I want to dynamically create classes/tables
>>
>
> Why?
>
>  and I want to implement multiple inheritance
>>
>
> That's fine, that's what mixins give you.
> If you have more than one class with a __tablename__ in the class
> hierarchy, then you'll get table inheritance, which may also be what you
> want.
>
>  (simplified version: just
>> data and no overrides =>
>>
>
> What do you mean by "overrides"?
>
>   no diamond problem),
>>
>
> What do you mean by "diamond problem"? Python has a well defined MRO, if
> that's what you're worried about...
>
>  so I need some extra
>> work like a extra tables for polymorphism.
>>
>
> What does polymorphism mean to you? SQLAlchemy handles most polymorphic OR
> mapping quite gracefully...
>
>  I think it would be most
>> elegant to do this with metaclasses, but I am just experimenting until
>> now.
>>
>
> You come across as someone with a hammer desperately looking for nails and
> frustrated when you find only screws ;-)
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>           - http://www.simplistix.co.uk
>



-- 
====================================
Lars van Gemerden
l...@rational-it.com
+31 6 26 88 55 39
====================================

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to