Closed KillianKemps closed 7 years ago
Hello,
In your tutorial (https://eve-sqlalchemy.readthedocs.org/en/stable/tutorial.html), you got this snippet:
# but you can always customize it: DOMAIN['people'].update({ 'item_title': 'person', 'additional_lookup': { 'url': '[0-9]+', 'field': 'id' }, 'cache_control': 'max-age=10,must-revalidate', 'cache_expires': 10, 'resource_methods': ['GET', 'POST', 'DELETE'] })
However, the url field is not correct and raises an exception :
url
Traceback (most recent call last): ValueError: malformed url rule: '/my-resource/<[0-9]+:my_resource>'
In fact, it should be this instead (in my case, it solved the issue):
'additional_lookup': { 'url': 'regex("[0-9]+")', 'field': 'my_resource' },
@KillianKemps can you send a PR ? (Since you already know the fix)
@mandarvaze PR sent! :)
Hello,
In your tutorial (https://eve-sqlalchemy.readthedocs.org/en/stable/tutorial.html), you got this snippet:
However, the
url
field is not correct and raises an exception :In fact, it should be this instead (in my case, it solved the issue):