iain duncan wrote: > > > > You're perfectly "on the rails" with that approach :) Even more, if the > > widget is of enough common-use (like the inexisting "star-rater" which > > was discussed a few days ago ;)) you can pack it along with it's > > related javascript, css, valiators, etc... into an egg and easily reuse > > it in any TG app. > > I'll have to look into that. An example of the smart way to package the > js and css up with the widget would be a great wiki addition. How in > brief do you do that, link the js source file and css from the widget > directly? Would it be smart to have the widget use a default css that > can just be overridden in a contructor paramater or something?
Take a look at the code of any widget egg listed at the cogbin (http://www.turbogears.org/cogbin/) for inspiration. Basically: 1) tg-admin quickstart -tgwidget mywidget This will get you the basic layout for a widget egg. 2) Place your static resources in the static directory and register them with turbogears.widgets.register_static_directory 3) Write, test and debug the widget. If you "python setup.py develop" it, it will appear in the widget browser at the toolbox 4) python setup.py register bdist_egg upload To register it at PyPI. The metadata tg-admin places at setup.py will enable the cogbin to find it and list there along with the other widgets. 5) Announce it here to let all of us know of it's existence :) Alberto --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

