Your call to Greet() is creating a new SQLObject (g), which is then (by
default) committed to the database when your controller method finishes.
Since you haven't set any of the values in "g", it shows up as an empty
record in the database.

What are you trying to do in your index method?

Kevin Horn

On 5/3/07, Thierry <[EMAIL PROTECTED]> wrote:
>
>
> I'm currently using an existing database(MySQL) with table Greet, so
> my model.py looks like the following:
>
> class Greet(SQLObject):
>     class sqlmeta:
>         fromDatabase = true
>
>
> My controller.py:
>
> class Root(controllers.RootController):
>     @expose(...)
>     def index(self):
>         g = Greet()
>         return dict(hellos=[])
>
>
> Each time I reload my main web page, I an empty new entry is populated
> in the table Greet. It seems to be coming from the call Greet() in
> index(). Does anyone know why this is happening?
>
>
> >
>

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

Reply via email to