vendredi 31 juillet 2015

Django model structure without rows

I am new in Django and I really love it, however, I am having an issue working with models and Django admin. Usual model, like for e.g. 'users', can have unlimited users and they can be manipulated in any way. in my case, there are four links(exactly four, not more, not less) to different URL's on my landing page that can be changed any time, so it must be managed through admin environment.

At first I thought I will create a new model and add four instances, hardcode each of them into view file by ID, but it does not seem like a great approach - what if administrator delete's one of them?

Same problem could be applied, for example, for footer message (like "2015 Copyright Company Name") that administrator should be able to change at any time.

What are the best database - model design approaches / patterns in such situation? Maybe Django has some package or app for a such thing?

Thank you very much!

Aucun commentaire:

Enregistrer un commentaire