One I think I didn't understand from the wiki page:

You create Color.list_bright and Color.list_shades but don't use
Color.list_bright again.  The select is called bright_colours but uses
Color.list_shades for it's values (but seems to output bright
colours).

Is this just a small mistake in the text, or have I missed something?

It's very well written and I thought I understood it, until I got to the end.

Also, I tried running the last code example to have a play with it,
and got an error:

>>> Color.createTable(ifNotExists=True)

Traceback (most recent call last):
  File "<input>", line 1, in ?
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobject\main.py",
line 1319, in createTable
    conn = connection or cls._connection
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobject\dbconnection.py",
line 881, in __get__
    return self.getConnection()
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1675-py2.4.egg\sqlobject\dbconnection.py",
line 893, in getConnection
    raise AttributeError(
AttributeError: No connection has been defined for this thread or process

I used my own mysql connection and it went fine (maybe my sqlite isn't
working?).

There was a missing indent before the class method but I fixed that in the wiki.

Then I got an error on the widget declaration:

>>> widget = SingleSelectField('bright_colors', options=Color.list_shades)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python24\lib\site-packages\TurboGears-0.9a6-py2.4.egg\turbogears\widg
ets\meta.py", line 142, in widget_init
    func(self, *args, **kw)
  File "c:\python24\lib\site-packages\TurboGears-0.9a6-py2.4.egg\turbogears\widg
ets\forms.py", line 711, in __init__
    validator = self._guess_validator()
  File "c:\python24\lib\site-packages\TurboGears-0.9a6-py2.4.egg\turbogears\widg
ets\forms.py", line 735, in _guess_validator
    warnings.warn("unknown option type in SelectionField: " + \
TypeError: unsubscriptable object

Really don't know what to do with this one.

Ed

On 5/11/06, Matthew Bevan <[EMAIL PROTECTED]> wrote:
>
> On Wednesday 10 May 2006 13:49, Michele Cella wrote:
> > What about putting these things into a CookBook page?
>
> Done:
> http://trac.turbogears.org/turbogears/wiki/PassingArgumentsToCallables
>
> I may have been a bit verbose, though this particular concept is hard to
> describe to someone not familiar.
>
>   - Matthew
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to