> So i have unknown hierarchy of classes - be them documents, entities,
> whatever u fancy. And they can point to each other in an unknown way.
so, you are looking to create an application that generates python
applications, basically.

hm, can be interpreted this way. just add 'and interpret them on the
fly'
i want to use and extend the python's self-reflection - and
self-modificiation - to get a sort-of self-interpretable thing, but
without generating any source. Haveing proper self-reflection can
auto-generate me the source - or multiple sources for multiple target
environments, e.g. idl->python->python+C+html+binary. i've done that
multiple times - but i want the thing to interpret itself. i know it's
slower, but more flexible.

if you want to use SA for that, you have to
completely master SA's relationships using simple, non-dynamically
generated examples first, so you can get a feel for what it does.

i've done tons of this, to get where i am now. And i keep doing it. My
approach is like "start always a new and try with minimal possible
stuff", so any thing i am using (e.g. those primary-joins) has been
required in a way, (e.g. when u have multiple references, SA wants u to
explicitly specify which is what).

For example, i notice in your example youre trying to send in "primaryjoin"
conditions which are already expressed in the Table objects - that
already is overly complex since SA can divine simple join conditions
from the tables themselves.
is it errorneus to explicitly put the (correct) joins even if they
could be figured out by SA?

for each pattern you are trying to create
dynamically, create a non-dynamic version first, get that to work, then
figure out what about your dynamic thing is different from the simple
version.
yes, yes. so far so good, see all the sa_*py files; and when i started
combining the different viewpoints - pure inheritance, pure (cyclical)
references, and pure types, the thing broke.

i hear theres a hot new template language
called "Mako" that does this kind of thing.*

*hehe*. good. i have done many languages before, interpretable and
compileable, but now i am basing all my language creations stuff onto
python - that is, using the python as syntax interpreter, and eventualy
completely replacing the actual semantix; be it on-the-fly or via the
objects themselves.

Two examples are the StaticType declarative structure "language"
(creatings python objects of unchangeable structure; very usable for
DBs, protocols and similar must-not-change stuff), and the expr.py,
which has a way to interpret python functions into Expr-trees, which
then can be translated (read code-generation) into whatever, like text
or sql-alchemy column expressions.

It's all like using the python to build _your_ syntax tree made of your
objects, and then use the objects - or some visitor - to do
code-generation/ interpretation.
But this is all offtopic; i could explain much-more if anyone is
interested.

i really _really_ want to extend the SA to be able to automaticaly do
table-decomposition and mapping of an object-hierarchy.
As i said, think of activemapper that also does inheritance and
queries, provided just a few hints of how user exactly wants it done.

So, back to the question: inheritance and referencing together?
This is what stops me now; otherwise i have about 10 diff.cases that SA
goes wrong, but i've found a way around so don't bother about them
_now_.

Also, if u can fix that "repeating" return obj.__dict__[key] in
orm/attributes.py InstrumentedAttribute.get()...
to be just "return value",
will be great. line 214 or so.
see, i am replacing it myself, runtime (see sahack4repeatability.py
;-), but it's not nice, changing library's source on the fly ;-).

Tomorrow i'll put a version stripped of all my statictype stuff, and
all of the testcases (if u want so), which may seem more "nice" to
you... all is about 1500 lines so far.

have fun.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to