turbogears2

Can anyone point out the pros and cons of TG2 over Django?

Django is my favorite python web framework. I've tried out others like pylons, web2py, nevow and others. But I've never looked into TurboGears with much enthusiasm. Now with TG2 out of beta I may give it a try. I'd like to know what are some of the pros and cons compared to Django. ...

Handling controller missing controller parameters in turbogears 2

Suppose I have a controller method like so: @expose() def search(self, title): return dict() Going to http://site/search/ will cause an exception to be thrown: TypeError: search() takes exactly 2 arguments (1 given). The error is logical, but I'd rather handle it more gracefully. Is using *args or **kwargs the only way to avoid ...

Switching databases in TG2 during runtime

I am doing an application which will use multiple sqlite3 databases, prepopuldated with data from an external application. Each database will have the exact same tables, but with different data. I want to be able to switch between these databases according to user input. What is the most elegant way to do that in TurboGears 2? ...

Pylons vs Turbogears

I am considering whether I should use Turbogears or Pylons for my project. I know Turbogears2 is based on Pylons. What does Turbogears provide that Pylon doesn't? Thanks. ...

Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?

I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive and do pretty good...

Turbogears 2 Tutorials?

Anyone know of a good beginners tutorial for Turbogears 2? I'm particularly interested in one that would have some details on working with existing database schema rather than creating from scratch. (and some pointers on MS SQL server setup would help too!) ...

TurboGears2/SQLAlchemy: Inserting a new row into a table with an autoincrement Primary Key

I am a noob and am trying to get my head around TG2 and SQLAlchemy. The specific problem I am wrestling with at the moment is how to insert a new row into a table when the PK field is configured as autoincrement. For example: in my myproject.model.myproject.py file I defined the following table: class Dj(DeclarativeBase): __table...

How to keep query parameters during pagination with webhelpers.paginate

I look an example of paginating from http://rapidprototype.ch/bg2docs/tg2pagination.html for my Turbogears 2 project and it works great but, I have a problem regarding my query parameters when I change the page I'm looking. This is what I have in my controller when listing. def list(self, page=1, **kw): q = "" if kw.has_key('q...

How to initialize global variables in TurboGears 2 with values from a table

I need a global variable that I can call from the templates. I edited app_globals.py in lib directory to declare PATH_TO_IMAGES like this class Globals(object): """Container for objects available throughout the life of the application. One instance of Globals is created during application initialization and is available du...

Turbogears: Can not start paster after updateing to mac osx 10.6

After updateing to mac osx 10.6 I had to switch back to python 2.5 in order to make virtual env work. But still I can not start my turbogears project. Paster is giving this : Traceback (most recent call last): File ".../tg2env/bin/paster", line 5, in <module> from pkg_resources import load_entry_point File ".../tg2env/lib/python...

Cart item management in python Turbogears 2.0

I'm new to python an I decided to give it a try with TG2 by developing a small store. So far I've been loving it, but I'm guessing that my coding parading is still very attached to java's Like for example, the add to cart method in my CartController. def add(self, **kw): pid=kw['pid'] product = model.Product.by_id(pid) c...

Dynamically hiding ToscaWidgets fields

I am trying to dynamically hide fields depending on some data. With dynamically, I don't mean JavaScript, but server-side: class EditUserForm(TableForm): class fields(WidgetsList): user_id = HiddenField() user_name = TextField(label_text=u"User Name") reject_member = SubmitButton(default=u"Reject Membership")...

TurboGears for ecommerce

Is there a good Open Source shopping cart implementation for TurboGears? (I found Satchmo for Django, but I'm coming up empty handed for TurboGears.) I'd like to avoid reimplementing this particular set of wheels. ...

How to extend the Turbogears 2.1 login functionality

Hi all, I'm using Turbogears 2.1 and repoze.who/what and am having trouble figuring out how to extend the basic authentication functionality. I am essentially attempting to require users to activate their account via an emailed link before they can login. If they try to login without activating their account, I want to display an approp...

how to update a record using DBSession in turbogears 2

Hi I'm trying to update a user row upon the user logging in. I simply want to increase the users login count by one. Here is the code in the post_login controller method: @expose() def post_login(self, came_from=url('/')): """ Redirect the user to the initially requested page on successful authentication or redirect ...

SVG in pylons or turbogears?

Are there documented pylons or turbogears2 widgets for generating SVG markup as components and are there example applications that use them returning an SVG primary document? ...

how to check if request is ajax in turbogears

How do I go about checking if a request is an ajax request in a controller method in Turbogears? Further, is it possible to return a 'partial' much like in rails or symfony if the request is an ajax request. I know about the json decorator but I need a way to return a partial of a mako template (because I need to format the data and don'...

File Uploads with Turbogears 2

I've been trying to work out the 'best practices' way to manage file uploads with Turbogears 2 and have thus far not really found any examples. I've figured out a way to actually upload the file, but I'm not sure how reliable it us. Also, what would be a good way to get the uploaded files name? file = request.POST['file'] perma...

Comparing GWT and Turbo Gears

Anyone know of any tutorials implemented across multiple web application frameworks? For example, I'm starting to implement GWT's Stock Watcher tutorial in Turbo Gears 2 to see how difficult it will be to do in Turbo Gears 2. Likewise, I'll be looking for a Turbo Gears 2 tutorial to implement in GWT. But I hate to re-create the wheel ...

Renaming TurboGears 2's Repoze Fields with TGAdmin

I've been working on renaming TurboGears 2's Repoze 'groups' field to 'roles' to free the namespace and db tables for other purposes. Also roles makes much more sense to me then groups because I have a strong Drupal background. Now I have found some of the docs to do this such as these: http://www.turbogears.org/2.1/docs/main/Auth/Cust...