So, I've been fretting at one particular problem for a while, and only last
night came up with a workable solution. This is definitely a question to ask
the TG community, though.

Some background: I'm working out the ideas for an extension called
tgext.config. It's going to provide a trac-style web admin interface. It'll
let extension developers have easy access to configuration variables, and
keep them stored in the database. The problem has been the database.

I'm a strong believer in the idea that any given component is responsible
for itself. The problem with this, though, is the question: How do I get the
extension's database model into the application's database model without
putting in more steps that the web developer must do?

I think I've come up with a way, though I've not implemented the exact
mechanics yet. I wanted to get feedback from the community before I do so.

setuptools provides a mechanism called entrypoints. Using this, any given
Python package can register itself with setuptools as supporting certain
things. Other packages can then query setuptools to find out which packages
meet its requirements, and can use those packages.

My thought process is to use this. In the default quickstart, add lines
which amount to "find all packages that have a tgext.dbmodelext entrypoint,
and then import the module named by that entrypoint into the current
myapp/model/__init__.py"

The end result is that extension developers will now be able to seamlessly
integrate into an application, and the web developer can use any extension
without worry about properly integrating with the database.

Now, I know that people seem to have hatred of setuptools. So far as I know,
only setuptools has the entrypoints mechanism. I don't want to write yet
another plugin mechanism. So, this idea might have issues right from the
start.

All in all, my major question is this: Why does this idea suck? Without any
feedback, I'm planning on implementing this idea pretty shortly (within the
next week). If it is a bad idea, tell me why, so I can try to find a way to
do this better.

-- 
Michael J. Pedersen
My IM IDs: Jabber/[email protected], ICQ/103345809, AIM/pedermj022171
          Yahoo/pedermj2002, MSN/[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en.

Reply via email to