agateblue / agateblue/django-navutils

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

Đang mở
#2 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
40
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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
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
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)
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.