I tried:
deposit = DepositController(DBSession,menu_items = dict(menu_items))

and got the following error

>>  deposit = DepositController(DBSession,menu_items = dict(menu_items))
NameError: name 'menu_items' is not defined

I then tried:
deposit = DepositController(DBSession,menu_items = dict
(deposit=Deposit))
This works, but shows Deposit as a menu item, Now I just need to
figure out how to get rid of the menu item.

I suspect a bug or a bad install is the underlying problem, but don't
really know which.


On Apr 15, 2:29 am, Jonathan Schemoul <[email protected]>
wrote:
> DepositController(DBSession,menu_items=None)
> You are defining menu_items as None, and the templates are trying to
> do an iteritems on it.
>
> Can you try setting it as dict() instead of None ?
>
> On 14 avr, 18:28, shorttimer <[email protected]> wrote:
>
> > I'm not sure this is the correct mailing list, but I am trying to
> > create a sprox table outside of admin and I am getting a pylon error.
> > The table works OKAY in admin.  The pylon error seems to come up when
> > python trys to iteritems() menu_items which does not exist.  Any
> > suggestions??
>
> > class DepositTable(TableBase):
> >     __model__ = Deposit
> > deposit_table = DepositTable(DBSession)
>
> > class DepositTableFiller(TableFiller):
> >     __model__ = Deposit
> > deposit_table_filler = DepositTableFiller(DBSession)
>
> > in the rootcontroller
> > deposit = DepositController(DBSession,menu_items=None)
>
> > Pylons error.
>
> > Module ?:22 in <Expression u'iter(sorted
> > (tmpl_context.menu_items.iteritems()))'>          view
> > <<      <div style="float:left; padding-left:0px;">
> >                <ul id="menu_items" py:if="hasattr(tmpl_context,
> > 'menu_items')">
> >                    <li py:for="lower, item in sorted
> > (tmpl_context.menu_items.iteritems())"><a href="../$lower">
> > $item.__name__</a></li>
> >                </ul>
> >            </div>>>  <li py:for="lower, item in 
> > sorted(tmpl_context.menu_items.iteritems())"><a 
> > href="../$lower">$item.__name__</a></li>
>
> > Module genshi.template.eval:321 in lookup_attr         view
> > Module genshi.template.eval:405 in undefined         view
> > UndefinedError: '' has no member named "iteritems"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to