←back to thread

379 points rbanffy | 1 comments | | HN request time: 0.202s | source
Show context
giancarlostoro ◴[] No.46210692[source]
Template partials look good, which is one of the key reasons frameworks like React are as good and popular as they are, because you can reuse small segments of code.
replies(8): >>46211187 #>>46211247 #>>46211354 #>>46211402 #>>46211982 #>>46212701 #>>46212849 #>>46213424 #
agumonkey ◴[] No.46211247[source]
indeed the vintage templating was a logical bottleneck
replies(1): >>46211347 #
f311a ◴[] No.46211347[source]
How is it different from include? Just less files from my perspective
replies(3): >>46211378 #>>46211408 #>>46214371 #
simonw ◴[] No.46211378[source]
The "inline partials" feature is neat, means you can use and define a partial at the same time.

The way you can render just a named partial from both the render() shortcut and the include tag is nice too:

https://docs.djangoproject.com/en/6.0/ref/templates/language...

replies(1): >>46211495 #
1. f311a ◴[] No.46211495[source]
Yeah, but I was doing the same thing 10 years ago with include mixed with extends and blocks. I can just include a file inside a template or render it directly.