abbreviation = StringCol(length=ABBREVIATION_LENGTH,
alternateID=True)
name = StringCol(length=NAME_LENGTH)
# class methods
def optionList():
list = []
for state in State.select(orderBy=State.q.abbreviation):
list.append((state.id, state.abbreviation))
return list
>>> State.optionList()
Traceback (most recent call last):
File "<console>", line 1, in ?
TypeError: unbound method optionList() must be called with State
instance as fir
st argument (got nothing instead)
Don't get this one. Why is python treating this like an instance
method? And yes, the indents line up in the original source.
for state in
class_.select(orderBy=State.q.abbreviation):
> list.append((state.id, state.abbreviation))
> return list
Some people prefer klass to class_
>
> >>> State.optionList()
> Traceback (most recent call last):
> File "<console>", line 1, in ?
> TypeError: unbound method optionList() must be called with State
> instance as fir
> st argument (got nothing instead)
>
> Don't get this one. Why is python treating this like an instance
> method? And yes, the indents line up in the original source.
>
>
>
--
Lloyd Kvam
Venix Corp