Mike,

Thank you for the prompt reply:

On Oct 1, 1:11 pm, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> Randy Syring wrote:
>
> I'm not sure of the context here.  are you generating code or just
> executing SQL ?  

Ok, maybe a small example.  Here is a declarative object and the how
the datagrid gets defined:

http://paste.pocoo.org/show/142448/

Note that the datagrid currently accepts the column from the table or
the declarative attribute.  It would also accept an elixir attribute.

Then, inside the datagrid library, I have references to those objects
that were passed in.  Use them to construct SQL based on options
selected by the user.  So, a user might request something like:

/foo?filteron=firstname&filteronop=ne&filterfor=test*

and we would generate something like:

SELECT persons.id AS persons_id, persons.firstname AS
persons_firstname, persons.last_name AS persons_last_name
FROM persons
WHERE persons.firstname NOT LIKE 'test'

run that against the DB and then return the results in an HTML table.

The way we generate the SQL is by using the SA/Elixir column/
attributes in a query, here is a small snippet of that:

http://paste.pocoo.org/show/142453/

So, my problem currently is that in the above snippet, "ffor" might be
an empty string.  That's fine if the column is a text type, but I have
to handle it differently if the column is a time stamp.  I am also
assuming I will run into other problems related to the type of column
being used that I will need to handle.  But, I can't currently handle
those situations b/c I don't know enough about the SA objects to
figure what type they are.

> if the latter wouldn't you be using TypeEngine subclasses
> to handle coersion of type values ?

And that's where you lose me, sorry.  All I know is that I have an SA
table column, SA declarative attribute, or elixir entity attribute and
I need to figure out what "type" of SA column they represent (i.e.
DateTime, Time, Date, etc.).  I really have no idea what it will take
to bridge the gap, hence this post.  :)


--~--~---------~--~----~------------~-------~--~----~
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