By "dir(manter)" do you refer to the manter template or the controller
method?
Either way I get an error from dir(manter.p)
>>> p=session.query(PPI).get_by(t_year=2008, t_dimx='3.4208')
>>> p.c.keys()
['t_dimx', 't_ceco', 't_desc', 't_pdix', 't_objc', 't_npro', 't_frea',
't_resp', 't_dtai', 't_dtaf', 't_fexe', 't_corg', 't_real', 't_year',
't_ornd', 't_deno', 't_div1', 't_pfac', 't_pffc', 't_pfar', 't_vof1',
't_vof2', 't_vof3', 't_vof4', 't_ref1', 't_ref2', 't_ref3', 't_ref4',
't_obs1', 't_Refcntd', 't_Refcntu']
Paulino
On 8 Out, 14:44, "Lukasz Szybalski" <[EMAIL PROTECTED]> wrote:
> On 10/8/07, Paulino <[EMAIL PROTECTED]> wrote:
>
> > Hi!
>
> > I have the same problem as Lukasz, but giving uppercase names to my
> > widgets doesn't make any diference.
>
> Open your TG app in tg-shell and then do
> dir(manter)
> dir(manter.p)
> dir(mater.p.c) and see what are the column names you have.
>
> > I still don't have thevaluesshown in th form.
>
> > @expose(template="ppi.templates.manter")
> > def manter(self, *args):
> > ano, plano, clec = args[:3]
> > p = session.query(PPI).get_by(t_year=ano, t_dimx=plano, t_ceco
> > = clec)
>
> I am not sure if get_by result will give you the same type of data as
> x=model.yourtable.get((primarykey1,primarykey2))
>
>
>
>
>
> > return dict(form=manter_form,values=p, action="/ppi/guardar")
>
> > class formPPI(widgets.WidgetsList):
> > t_dimx = widgets.TextField(label="Objectivo",
> > validator=validators.NotEmpty )
> > t_ceco = widgets.TextField(label=u'Económica',
> > validator=validators.NotEmpty )
> > (...)
>
> > ppi_tab = Table('ttfvbs061100', metadata,
> > Column('t_year', Integer, primary_key=True,
> > autoincrement=False),
> > Column('t_dimx', String(), primary_key=True),
> > Column('t_ceco', String(), primary_key=True),
> > autoload = True)
>
> Also my database existed already but I am not sure if that makes a
> difference in your example.
>
>
>
>
>
> > Paulino
>
> > On 5 Set, 17:44, Paul Johnston <[EMAIL PROTECTED]> wrote:
> > > Hi,
>
> > > >CONCLUSION: When usingsqlalchemyand widgets we need to name our
> > > >attributes in the widget using CAPITAL letters. when we usesqlalchemy
> > > >autoload function.
>
> > > Yes, this is expected behaviour. Widget names have to match column names
> > > (case sensitively). WhenSQLAlchemyreflects tables on some DBs, the
> > > columns are upper-cased.
>
> > > This definitely should be documented somewhere, although I'm not quite
> > > sure where. Do we have a "common gotchas" page?
>
> > > Paul
>
> --
> TurboGears from start to finish:http://www.lucasmanual.com/mywiki/TurboGears-
> Ocultar texto citado -
>
> - Mostrar texto citado -- Ocultar texto citado -
>
> - Mostrar texto citado -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---