asifpy / django-crudbuilder

Generic CRUD implementation in Django
https://django-crudbuilder.readthedocs.org/en/latest/index.html
Apache License 2.0
193 stars 67 forks source link

Primary Key Issues #49

Closed invious closed 6 years ago

invious commented 7 years ago

As soon as I loaded some models into the database, the listview url wouldn't load and gave me an error about the detail view and primary keys.

My model uses

id = models.CharField(primary_key=True, max_length=255)

and the error I'm getting when viewing crud/updates/instances/ without even specifying a pk in the url (I want to see the list view not detail view!)

...
  File "/Users/aymon/Envs/dchw/lib/python2.7/site-packages/django_tables2/columns/linkcolumn.py", line 187, in render
    self.compose_url(record, bound_column),
  File "/Users/aymon/Envs/dchw/lib/python2.7/site-packages/django_tables2/columns/linkcolumn.py", line 183, in compose_url
    return reverse(viewname, **params)
  File "/Users/aymon/Envs/dchw/lib/python2.7/site-packages/django/urls/base.py", line 91, in reverse
    return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
  File "/Users/aymon/Envs/dchw/lib/python2.7/site-packages/django/urls/resolvers.py", line 497, in _reverse_with_prefix
    raise NoReverseMatch(msg)
NoReverseMatch: Reverse for 'updates-instances-detail' with arguments '(u'i-088d2ca2577027d22',)' not found. 1 pattern(s) tried: ['crud/updates/instances/(?P<pk>\\d+)/$']
asifpy commented 6 years ago

Check this : #47