Creating a db driven primary navigation in django?
- by Fedor
I find that it's pretty common most people hardcode the navigation into their templates, but I'm dealing with a pretty dynamic news site which might be better off if the primary nav was db driven.
So I was thinking of having a Navigation model where each row would be a link.
link_id INT primary key
link_name varchar(255)
url varchar(255)
order INT
active boolean
If anyone's done something similar in the past, would you say this sort of schema is good enough?
I also wanted for there to be an optional dropdown in the admin near the url field so that a user could choose a Category model's slug since category links would be common, but I'm not quite sure how that would be possible.