Re: Re: PyDO bugs
Jacob Smullyan <[email protected]> Thu, 11 Aug 2005 14:28:51 -0400
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 11, 2005 at 09:55:22AM -0700, Matthew Bogosian wrote:
> This seems like a very worthy improvement, and I'm happy to see its
> introduction in this version of PyDO. It got me thinking though....
>
> Will these relationships also be inferred by the pydo.autoschema()
> function? If not, I guess one could always add them to the classes
> after they were returned (but this seems to defeat the purpose of
> having a function like autoschema()).
I don't know about autoschema itself yet, but the place to start would
be the introspection api of the dbi drivers. This looked like a lot
of work to undertake for 2.0, so I deferred it, and whether it will
ever get done depends on whether it is really useful to somebody and
whether anyone wants to pitch in to help do it (or otherwise provides
inducements!).
The old PyDO did do this in its genscripts; it asked you interactively
to confirm its inferences.
I'm actually a bit annoyed by using these new methods I created,
because they require that the other PyDO class to which there is a
relationship be already defined when the relationship is defined.
That means that I have to do things like this:
class A(PyDO):
pass
class B(PyDO):
getA=OneToMany('a_id', 'id', A)
A.relatedB=ForeignKey('a_id', 'id', B)
That's OK, but not fantastic. Before, the references to related
classes were in methods that were evaluated at runtime, not class
definition time, so this problem wasn't present. Anyone have a bright
idea of how to avoid this?
--
Jacob Smullyan
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf