smark-1 / django-easy-faq

a Django app to easily add FAQ into website with extremely little effort
MIT License
15 stars 9 forks source link

Auto-slug would be cool #2

Closed pors closed 2 years ago

pors commented 2 years ago

I have a feature request: When leaving the slug field for a question empty, can you generate it by using the question with the spaces replaced by a -?

BTW, why do answers have a slug field?

smark-1 commented 2 years ago

When leaving a slug blank this already generates a slug from random chars. This does not work through the django admin since it is still a required field. The slug field is not necessary but I like to expose the least amount of info to the end user as possible and a pk or slug most be exposed to allow voting for the answers. To make this work 2 values in the models.py have to be changed. In the answer save method check if slug is null instead of pk. In answer slug field set blank=True. I don't think I have time to add this on the next couple weeks but if you make a pull request I can add it.

pors commented 2 years ago

I'm happy to give it a try, but I haven't contributed to a Django app before, so I'm not sure how to set that up? I can check out the source, but how do I use it in my project instead of the released version?

pors commented 2 years ago

Never mind, I figured it out :)