You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
I've started trying to reimplement a UI with django-material again from scratch. I'm running into an error and I've put quite a lot of time into trying to figure it out, but I can't make progress.
I assume cameramodel_add has the _add suffix automatically added by the ModelViewSet, but somehow the autoloading isn't working?
the parent app is camerahub
the app which contains an existing models.py is schema
the app which contains a skeleton Material project is ui
The schema app used to contain a bunch of views I wrote myself, but I have now deleted everything apart from models.py and the migrations.
# ui/views.pyfrommaterial.frontend.viewsimportModelViewSetfromschemaimportmodels# class MyModelViewSet(ModelViewSet):# model = models.MyModelclassCameraModelViewSet(ModelViewSet):
model=models.CameraModel
Trying to browse to http://127.0.0.1:8000/ui/cameramodel/ I get
Internal Server Error: /ui/cameramodel/
Traceback (most recent call last):
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/material/frontend/views/list.py", line 531, in dispatch
return super(ListModelView, self).dispatch(request, *args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/material/frontend/views/list.py", line 357, in dispatch
return handler(request, *args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/material/frontend/views/list.py", line 315, in get
context = self.get_context_data()
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/material/frontend/views/list.py", line 521, in get_context_data
kwargs['add_url'] = reverse('{}:{}_add'.format(opts.app_label, opts.model_name))
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/urls/base.py", line 86, in reverse
return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
File "/home/jonathan/.cache/pypoetry/virtualenvs/camerahub-FNy4MBnC-py3.10/lib/python3.10/site-packages/django/urls/resolvers.py", line 698, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'cameramodel_add' not found. 'cameramodel_add' is not a valid view function or pattern name.
"GET /ui/cameramodel/ HTTP/1.1" 500 117163
I've started trying to reimplement a UI with django-material again from scratch. I'm running into an error and I've put quite a lot of time into trying to figure it out, but I can't make progress.
I assume
cameramodel_add
has the_add
suffix automatically added by theModelViewSet
, but somehow the autoloading isn't working?camerahub
models.py
isschema
ui
The
schema
app used to contain a bunch of views I wrote myself, but I have now deleted everything apart frommodels.py
and the migrations.Trying to browse to
http://127.0.0.1:8000/ui/cameramodel/
I getOriginally posted by @djjudas21 in #513 (comment)
The text was updated successfully, but these errors were encountered: