I have a messaging system that I'd like to use on more than one site.
I don't really want to just copy/paste the code and do the integration
if I can find a way to use the same codebase for both sites.

The system has:
 1) a table in the db (yeah it's a pretty simple system right now)
 2) a .py file with a class inherited from controller (so you could
pretty much mount it to the application wherever you want)
 3) a js file
 4) two kid templates.

So to use the system you have to:
 1) install the schema, copy the kid templates/.py file into
appropriate places.
 2) mount the controller at some point in the application ( i.e.
root.messaging=Messaging() )
 3) provide links to the new mailbox at other places in your
application

Problems with using one code base:
 1) authentication is not exactly the same between sites. (Possibly
could be solved by using a site specific filter)
 2) kid templates need to be in the .templates directory unless they
are inlined into the .py file (which would be extremely ugly and hard
for the designers.)
 3) kid templates should inherit from a master so the look and feel of
the site is standard, but what if the master template is

I'd like to see something like this in both sites:

____in the root controller____
import mymessaging
class Root(controllers.Root):
  __init__(self):
    self.messaging=mymessaging.WhateverController()
__ all you'd need to do there.. __

... and then in the site template or wherever
<a href="/messaging">The installed message center</a>

Anyone have any suggestions or have already done something like this?
What about using widgets?  It seems to me widgets are more a dependancy
of an existing controller?  Perhaps the js file and the kid templates
could be handled sort of like the the MochiKit js file.  (give it a
/tg_widets static filter) I don't really want to inline the kid
templates though.  Perhaps someone could point out how to handle that
if it's possible.

Thanks All (TG is nifty)
-Dennis


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to