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 the values shown 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---