Can I get a yes/no on this? I would like this to be a integral part of
SQLObject. Even the ability to have multiple factories.
Thanks
Scott
On Oct 29, 2004, at 11:17 AM, Scott Sanders wrote:
> Ian,
>
> I have successfully been using SQLObject svn trunk for a few days now,
> without modifications. I have implemented automatic class generation
> by reading information from the database about classes and their
> columns and joins. I did this by extending MetaSQLObject with my own
> behavior, and a factory method called getClass(classname), which
> checks the registry, and then constructs a new class if the registry
> does not contain the proper class.
>
> The problem I am running into now, is when you have joined classes,
> the joined classes have to be explicitly loaded. In your users/roles
> example, my code would have to look something like this:
> userClass = getClass('user')
> roleClass = getClass('role') #if this is not called here, user.roles
> will not be defined, because the role class is not in the registry
> user = userClass.get(1)
> print list(user.roles[0])
>
> It would great if the registry was allowed to have a factory method
> set to attempt automatic class creation if the class does not exist.
> If I coded this up as a patch, would it be accepted?
>
> Thanks,
> Scott
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> sqlobject-discuss mailing list
> sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
|