reg isn't a dict, is it?
it looks like it's an SQLObject, which means that the `get()` method is
trying to find a record by id.
now if you want the rxName attribute of the RegExps object, then you
need to do reg.rxName
Sean
[EMAIL PROTECTED] wrote:
> Tim...
>
> Thank you for the help....but it's still not working no matter how I
> try it.
>
> When I break it down to it's simplest component...and put this in my
> kid template:
> ${reg.get('rxName')} ---- I get an internal error, the last few lines
> of which are as follows:
>
> File "/home/me/ws/xstart/xstart/templates/pattern_match.py", line 96,
> in _pull
> File
> "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py",
> line 898, in get
> id = cls.sqlmeta.idType(id)
> ValueError: invalid literal for int(): rxName
>
> Any ideas?
>
> Thanks
>
> Tim Lesher wrote:
> > On 7/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > but the real value I'm interested in is reg[rxName] -- I can refer to
> > > it as ${reg.rxName} to get the value stored inside...but I don't know
> > > what syntactic sugar to use to get this expression to evaluate properly
> > > as a parameter for value_of....
> >
> > Use:
> >
> > value_of(reg.get('rxName'))
> >
> > The get method of a dict returns a default value None if the dict
> > doesn't contain the key (as opposed to the bracket operator, which
> > raises a KeyError). So if reg doesn't exist, or if reg has no
> > 'rxName' key, the expression will evaluation to None.
> >
> > If you want it to return a different default value, specify it as the
> > second parameter to get:
> >
> > reg.get('rxName', 'defaultRxValue')
> >
> > where 'foo' is the value you want if reg has no rxName key.
>
> > --
> > Tim Lesher <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---