RedPanal / redpanal

RedPanal web
https://redpanal.org
GNU Affero General Public License v3.0
18 stars 9 forks source link

[Feature Request] API search by slug #124

Closed selankon closed 3 years ago

selankon commented 3 years ago

Hi,

We are writing a series of scripts to import public datasets from internet to the decentralized culture repository of elrepo.io.

We started to write the code to import data from redpanal to our platform and realized that could be useful for us to search by slug instead that by id.

This will make easier for the user to import the data just copying the url, and easier for our program to don't parse all audio list looking for the id of an slug.

But I forget all my Django knowledge and I'm not pretty sure what file I have to modify to write a pull request. I'm looking where is written the logic to search by Id but I don't find it (is this Django automatically generated?). I found where the API is defined but I'm not sure if I have to add the code there.

Thanks in advance!

spiccinini commented 3 years ago

Hi! As the django rest framework is not very easy to follow/understand I've implemented what I understood from your feature request. Can you please review and/or do the modifications to this PR https://github.com/RedPanal/redpanal/pull/125 It's great to know that you are working in the elrepo.io integration!

selankon commented 3 years ago

Hi! I reviewed the commit and seems to do exactly what we want!

Please say me when it will be on production to test it

Thanks!

spiccinini commented 3 years ago

Great thanks! It is deployed now! Eg: https://redpanal.org/api/audio/by-slug/el-quique-2/