On Jul 2, 2006, at 5:32 AM, Tzahi Fadida wrote:

> Hi,
> Sorry for the mass questions, i tried to concentrate these so as  
> not to flood
> the mailing list :)  :
> *How do i add a column to an existing table and

yah SQLAlchemy has no role in schema management; youd have to issue  
ALTER TABLE statements manually.


> *how is the migration Google SOC is going along (where is the code).

yah SQLAlchemy has no role in schema management; youd have to issue  
ALTER TABLE statements manually.


> *How do i do validation in SQLAlchemy in the database and outside.
>  For example: putting regular expressions to check if a field is  
> valid.

putting functions around managed attributes looks like:

http://www.sqlalchemy.org/docs/ 
adv_datamapping.myt#advdatamapping_properties_overriding


>  when saving, or assigning and when flush() called, run a test on  
> all objects
>  assigned to session.

youd have to write your own function that does something like:

        def myflush():
                for obj in session:
                        <something>
                session.flush()

> *Another more complex example, do an atLeastOne-To-one relationship,
>   i.e., verify when saving a user to users_table that it at least  
> have one
>   address.

yah thats domain-level stuff youd have to write on your own.

> *In the database, how can you add conditions, i.e. in users_table  
> schema
>   users_table.field_a>users_table.field_b
>   (postgresql can do that)

what, like CHECK CONSTRAINT ?  heres a ticket for that:  http:// 
www.sqlalchemy.org/trac/ticket/217  its not planned for the immediate  
future, its a TODO.   this is the kind of thing someone can also  
contribute;   (ive had a lot of schema-level code contributions, i  
guess thats the part of the code that people can get right into :) ).

unless you are packaging your app to be installed by end users where  
it creates its own database, i would advise not leaning too heavily  
on SA's schema creation utilities;  its probably never going to  
support everything (such as an Oracle table can have TABLESPACE and  
MAX EXTENTS, etc. it goes on and on with oracle...)

> *Does SQLAlchemy have a mechanism to deal with Schema like in  
> postgresql,
>   i.e., namespaces? For example LABranch.users_table

Table has a "schema" keyword.

> *Using ORM, are there any security problems in serializing (pickling)
> a User() object (of users_table) and sending it to a client from  
> the server?
>

if youre sending a cleartext password over the wire, sure.  pickling  
is not an encrypted format.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to