Email or username:

Password:

Forgot your password?
Nikita

#Django advice needed!

My setup is: I have 5 Django apps, each has 3–7 models. For each model, there is a list and a create/edit view. All are based on the same base.html.

I want to have <title> be set in a LIFO manner. For example, list of ‘items’ inside ‘warehouse’ app would have the title ‘Items - Warehouse - Site name’.

Right now I have to create almost identical base templates with just the title block for every app. Is there a less repetitive way?

cc: @ru @pbx

#AskFedi #BoostsWelcome

2 comments
Paul :python: :django:

@kytta @ru Are these generic views? If not, I'd think you could generate an appropriate title in each of the views, putting it in the template context, and reference it in the template. This may be off-base but it's the first thing that comes to mind.

Ru (Tech) :blobcatsadlife:

@kytta I’ve actually been using blocks as well at the moment. I haven’t cared to optimise this as I haven’t felt the need.

@pbx

Go Up