Skip to content

AttributeError: 'list' object has no attribute 'add' #2

Description

@SoulRaven

a new error is rised:

Traceback (most recent call last):
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    worker.init_process()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 192, in init_process
    super(GeventWorker, self).init_process()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 118, in init_process
    self.wsgi = self.app.wsgi()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
    __import__(module)
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gevent/builtins.py", line 58, in __import__
    result = _import(*args, **kwargs)
  File "/mnt/usb500G/pyProjectsEnv/proGeekAPI/proGeekAPI/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
    django.setup()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/navutils/apps.py", line 10, in ready
    menu.registry.autodiscover(settings.INSTALLED_APPS)
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/persisting_theory/registries.py", line 107, in autodiscover
    module = __import__(package)
  File "/mnt/usb500G/pyProjectsEnv/proGeekEnv/local/lib/python2.7/site-packages/gevent/builtins.py", line 58, in __import__
    result = _import(*args, **kwargs)
  File "/mnt/usb500G/pyProjectsEnv/proGeekAPI/dashboard_main/menu.py", line 20, in <module>
    blog.children.add(
AttributeError: 'list' object has no attribute 'add'

Menu file:

menu.py
from navutils import menu

main_menu = menu.Menu('main')
menu.register(main_menu)

# will be shown to everybody
blog = menu.Node(id='blog', label='Blog', pattern_name='blog:index')
main_menu.register(blog)

# nodes created with a pattern_name argument will use django reverse
#assert blog.get_url() == '/blog'

# if you want to disable reversion, use the url argument
django = menu.Node(id='django',
                   label='Django project',
                   url='http://djangoproject.com',
                   link_attrs={'target': '_blank'})

# Each node instance can accept an arbitrary number of children
blog.children.add(
    menu.Node(id='last_entries',
              label='Last entries',
              pattern_name='blog:last_entries')
)
blog.children.add(
    menu.Node(id='archives', label='Archives', pattern_name='blog:archives')
)

# will be shown to anonymous users only
login = menu.AnonymousNode(id='login',
                           label='Login',
                           pattern_name='accounts_login',
                           link_attrs={'class': 'big-button'})
main_menu.register(login)

# will be shown to authenticated users only
logout = menu.AuthenticatedNode(id='logout',
                                label='Logout',
                                pattern_name='accounts_logout')
main_menu.register(logout)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions