Rotem Tamir schrieb:
> i don't understand how to write it in turbogears?
>
>
> can you please give an example?
>
> my model:
> class BudgetTreeNode(Entity):
> name = Field(Unicode(255), required=True)
> organ = ManyToOne('Organ')
> value = Field(Float(), required=True)
> type = ManyToOne('BudgetLineType')
> actions = OneToMany('Action')
> budget = ManyToOne('Budget')
> created = Field(DateTime, required = True, default = datetime.now)
> active = Field(Boolean, required=True, default=True)
Did you bother reading the execellent SA documentation?
http://www.sqlalchemy.org/docs/05/sqlexpression.html#updates
Right out of my head, and untested:
btn = BudgetTreeNode
q = btn.update().where(
btn.id in id_list) # very unsure about this
.values({btn.value: btn.value + 100})
conn.execute(q)
Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---