0👍
Redefine your location method to following :
def location(self, item):
return reverse('url_name', args=(arg,))
- How to pre-fill a modelform field DJango
- How to choose Django config setting in virtualenv just once
- Django – Cant align html tabs properly
- Python / Django – creating a photo gallery – get pics' names instead of pics themself
- Exclude date via .exclude
0👍
Using the previous answers, I did this little piece of code, hope it can be of any help for others users:
def location(self, obj):
if len(obj) == 1:
return reverse(obj[0])
else:
return reverse(obj[0],args=[obj[1]])
obj are tuple objects declared in urls.py
- The value of 'prepopulated_fields' refers to 'slug', which is not an attribute of 'shop.Product'
- DRF – serialize different models into one
- Can't find strings that aren't words in Django Haystick/Elasticsearch
- Mezzanine – blog link is returning error page in ubuntu server
Source:stackexchange.com