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.
...
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 ...
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?
...
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.
...
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...
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!)
...
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...
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...
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...
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...
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...
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")...
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.
...
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...
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 ...
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 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'...
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...
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 ...
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...