Jason Scheirer ha scritto:
> This should give a good ides on how to get access to your turbogears
> data outside of a turbogears app:
>
> http://docs.turbogears.org/1.0/ModelOutsideTG
>
> And before that, you're probably going to want to add the directory
> your turbogears app lives inside to your python path, you can
> accomplish that by something along the lines of:
>
> import sys
> sys.path.append("/path/to/your/tubogears/thing")
>
In my application i payed attention to this issue, i want to use the same
validators and the same model in case of WebServices call or massive file
upload from PDA.
So my intent is to explain this concept.
In all cases, with all model, i've done this:
data is a dictionary rappresent the same structure as the Model
if data.get( pk ):
a = MyAclass.search( pk = data.get( pk ) )
else
a = MyAclass()
a.get_from_dict( data )
a.flush()
with the get_from_dict i've resolved all poblem to getting data from
forms or file
:-)
Glauco
--
+------------------------------------------------------------+
Glauco Uri - Programmatore
glauco(at)allevatori.com
Sfera Carta Software(r) [EMAIL PROTECTED]
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---