Comments (9)
It works for me. Thank you very much!
from django-render-block.
At first glance it looks like it should be, yes. I'll try to take a look at this soon!
from django-render-block.
I have same problem.
I have two templates.
'base.email' :
{% block subject %}Email subject{% endblock %}
{% block html %}
<html>
..skip..
{% block html_content %}{%endblock %}
..skip..
</html>
{% endblock %}
and 'test.email':
{% extends "base.email" %}
{% block html_content %}
<h1>Hello world</h1>
{% endblock %}
I expect that render_block_to_string('test.email', 'html') returns full html code with text 'hello world',
but I only get html without block html_content
from django-render-block.
I think what's happening is that we:
- Check the sub-template for the black.
- The black isn't found so we check the base template.
- We find the block and render it using only data from the base template.
Clearly the last step here is wrong and that we need to be using the block from the sub-template here.
from django-render-block.
Thanks for the bug report, by the way! I was sure I had missed some cases in my test-cases. Clearly you found one!
from django-render-block.
I have this mostly fixed.
from django-render-block.
@aericson @dkopitsa Thanks for the reports! I just merged a PR (#8) which fixes this. There's a couple of minor clean-ups I want to do, but I should be able to do a release in the next few days. (Feel free to poke me if I don't!)
from django-render-block.
👏
from django-render-block.
Just pushed version 0.5 with these changes. Thanks for confirming it works!
from django-render-block.
Related Issues (13)
- Hook up the Jinja2 template engine
- Template inheritance issue HOT 3
- Inheritance more than one level seems to not work HOT 1
- Look into adding a template tag
- TemplateNotFound errors when the same context is passed to django_render_block multiple times HOT 7
- Update python_requires with supported Python versions HOT 2
- Wheel for 0.9 on PyPI empty HOT 4
- Support Jinja2 extended templates
- I am working on a Awesome-Python-HTMX, seeking your feedback HOT 7
- Template exception handing is broken when rendering a block
- Add an installation guide HOT 1
- Utilize Django Template Loaders HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-render-block.