[Zope-dev] Idea: Create SQL-Alchemy tables via interfaces

Brian Sutherland brian at vanguardistas.net
Wed Sep 3 10:02:17 EDT 2008


On Wed, Sep 03, 2008 at 02:43:31PM +0200, Hermann Himmelbauer wrote:
> Hi,
> In my current SQLAlchemy / Zope-based design, I need the following:
> 
> - SQLAlchemy table definitions
> - classes + mappers
> - Zope interfaces
> 
> The problem with this design is that much data has to be defined twice, e.g. 
> the datatype "varchar(50)" should be represented by an interface with 
> TextLine(max_length="50"). Moreover, any changes such as adding columns etc. 
> also have to be done in the interface and the table definition.
> 
> To overcome this, I just had the idea to use the interface/schema definitions 
> for the table definition itself. Probably I'm not the first who had this 
> idea, but I'm not aware of such an extension to interfaces.
> 
> Any thoughts on this?

I'm much more in favour of the reverse procedure. I think the database
is the canonical store of this information and that SQLAlchemy should
read that and make it available for doing form validation.

> 
> Best Regards,
> Hermann
> 
> -- 
> hermann at qwer.tk
> GPG key ID: 299893C7 (on keyservers)
> FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )

-- 
Brian Sutherland


More information about the Zope-Dev mailing list