turbogears

ToscaWidgets Recaptcha - Error Rendering Recaptcha => Page cuts off

Hello everyone, I am using the TW for recaptcha, integrated everything as shown in the examples. When sending the ReCaptcha to my template, my whole page output just cuts off. I have traced back the problem to the javascript code in the widget. It looks like this: <script ....></script> Only the dotted area contains some data, but t...

python/genshi newline to html <p> paragraphs

I'm trying to output the content of a comment with genshi, but I can't figure out how to transform the newlines into HTML paragraphs. Here's a test case of what it should look like: input: 'foo\n\n\n\n\nbar\nbaz' output: <p>foo</p><p>bar</p><p>baz</p> I've looked everywhere for this function. I couldn't find it in genshi or in python...

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!) ...

JavaFX or RIA desktop app (on dvd) also available on the web?

Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)? For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files. Can thi...

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...

What's the equivalent of Rails' Migrations or Django's South in Pylons and TG2?

Does anyone know how Pylons and TG2 projects handle database migrations? I'm looking for something similar to Rails' Migrations and Django's South. ...

Turbogears 2.0 with Python 2.6

I've tried to install TurboGears 2.0 with Python 2.6 on both Windows 7 and Windows XP, but both give the same error: File "D:\PythonProjects\tg2env\Scripts\paster-script.py", line 8, in <module> load_entry_point('pastescript==1.7.3', 'console_scripts', 'paster')() File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6....

Installing TurboGears on windows 7

Hi, I tried installing TurboGears 1.0 on Windows 7 using tgsetup.py. and got following error error: Couldn't find a setup script in c:\users\sandre~1\appdata\local\temp\ easy_install-jimbkt\Cheetah-2.4.0.linux-i686.tar.gz When looking into this folder I see easy_install-jimbkt folder appearing and disappearing right away. Is this some...

How can I use TurboGears2 auth with PyAMF?

I'm using TurboGears with PyAMF behind a Flex client, and everything works well. What I want to do is expose just a AMF login method to the world, and only allow access to other AMF functions once the user has logged in. Also, once the user is known, I'd like the protected AMF methods to get the username from the auth information, ...

turbogears request/user object in templates and request context

Hi all, I am currently making the switch from Django to Turbogears 2.1 and am running into some problems that I could not find the answers to in the Turbogears docs. If tg developers read this, let me tell you that one of the best features Django has over TG is its documentation! 1) How do I access the request (user?) object within a m...

Turbogears, mako form displaying as plain text

Hi I'm generating a sprox form with Turbogears 2.1 and trying to display it in a mako template. Here is my code: To define the form: class NewUserForm(AddRecordForm): model = User newuserform = NewUserForm(DBSession) The controller definition that assigns the form and calls the template: @expose('limelight.modules.users.templat...

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 do I add content before </body> in extended page? (KID templates)

I've got master.kid (simplified): <html> <head py:match="item.tag == 'head'"> <title>My Site</title> </head> <body py:match="item.tag == 'body'"> <h1>My Site</h1> <div py:replace="item[:]"></div> <p id="footer">Copyright Blixt 2010</p> </body> </html> And mypage.kid: <html> <head></head> <body> <p>Hello World!</p> </body> <...

Good interview questions for a Python/TurboGears web developer?

If you were looking to hire a web developer who would primarily be working with TurboGears/Python - what sort of questions should you ask them? ...

how to save data in a many to many relationship using turbogears and sqlalchemy

hi i have a many to many relationship between a user and a group.and i will like to add a user with many groups in my database.how do i do that if my database is as follows user_group_table = Table('tg_user_group', metadata, Column('user_id', Integer, ForeignKey('tg_user.user_id', onupdate="CASCADE", ondelete="CASCADE")), ...

Retrieving many-to-many relation properties using SQLAlchemy

I have a many-to-many relationship in which the relation-table contains more columns than only the primary key. As an example, consider a slide show system in which each image could have it's own timeout, and a different timeout depending on the slideshow. A daft example, but it will have to do for the sake of illustration ;) So I imagi...

Problem in creating new objects while using sqlalchemy with database sharding.

Hi, I am using sqlalchemy(version-0.4.5) with turbogears(version - 1.0) as its orm layer, with sharded multiple databases instances at the backend. While sqlalchemy seems to support passing session/engine bound to a database as a parameter to : Quering Tables : session.query(...) function Executing native sql queries : engine.execut...

TG2.1: Proper location to store a database session instance?

I am using a custom database (MongoDB) with TG 2.1 and i am wondering where the proper place to store the PyMongo connection/database instances would be? Eg, at the moment they are getting created inside of my inherited instance of AppConfig. Is there a standard location to store this? Would shoving the variables into the project.model....

Install TurboGears on windows xp

I've been trying to get TurboGears installed on Windows by following this site. I've installed virtualenv but when I execute the command "virtualenv --no-site-packages testproj", I get the following message: New python executable in testproj\Scripts\python.exe Traceback (most recent call last): File "C:\Python26\Scripts\virtualenv-sc...

turbogears 2.0 development server on windows

How do you make the server go offline or restart it in turbogears ? I typed "paster serve development.ini" for it to go online. After it goes online, the cursor is there in dos window but nothing I type is displayed. ...