Commit graph

24 commits

Author SHA1 Message Date
Emil Stenström
2c95b0930f Remove support for Python < 3.6 and Django < 2.2. 2021-02-12 21:10:33 +01:00
rbeard0330
87f9994c81
Performance (+50%): Compile ComponentNode at creation, not render (#22)
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-02-06 10:09:57 +01:00
rbeard0330
1ea86fc50d
Create cloned template for rendering so test instrumentation works.
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-01-31 23:18:04 +01:00
rbeard0330
2633c3f08f
Pass context into component tags by default, and let components disable with "only" (#20)
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2021-01-25 12:31:54 +01:00
rbeard0330
979dc82eda
Fix bug where template with multiple component_block tags could raise KeyError (#19)
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2020-12-30 08:01:57 +01:00
rbeard0330
93b8a7404a
Rework of context handling (#18)
Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2020-12-28 10:40:35 +01:00
rbeard0330
be0a75e2a3
Missing context variables and kwargs in component_block (#17)
* Fix issue with missing variables by binding template to context in Component.render method.
* Pass extra_context to Component.render()

Co-authored-by: rbeard0330 <@dul2k3BKW6m>
2020-12-14 18:25:36 +01:00
Emil Stenström
34098c375a Sort imports to isort is happy. 2020-11-02 15:08:26 +01:00
Bradley Stuart Kirton
2c644d4c06 Add pytest-cov
Apply black formatting
Add component_css_dependencies_tag and component_js_dependencies_tag tags
Add convenience methods render_css_dependencies and render_js_dependencies to component class
Create additional test cases
Add license to setup.py
Add pytest.ini config file
2020-07-10 13:07:51 +02:00
Emil Stenström
5f63a6a6bd Add test for component with undefined template method. 2020-06-07 17:07:24 +02:00
Emil Stenström
b2f61b61ad Fix flake8. 2020-06-07 08:45:54 +02:00
Emil Stenström
9811a88904 Add backwards compatible getfullargspec and TokenType. 2020-06-06 09:29:51 +02:00
Emil Stenström
d1405dda13 Add slots to components that can be filled when using component. 2020-06-06 09:11:27 +02:00
Emil Stenström
40ebd6b936 Install isort and fix all imports. 2019-11-24 11:09:14 +01:00
Emil Stenström
cbe2bcc9c9 Use six to allow metaclass usage in both Python 2 and 3. 2019-11-24 10:57:55 +01:00
Emil Stenström
096057b33d Use built-in django form assets instead of custom logic. 2019-11-24 10:31:23 +01:00
Emil Stenström
ebb180c540 Use list instead of tuple to avoid errors with missing comma. 2019-11-23 19:26:16 +01:00
Emil Stenström
33b1930ed5 Dependencies are the same for all instances, so convert to classmethod. 2015-06-14 14:28:43 +02:00
Emil Stenström
6492081b64 Add render() and render_dependencies() to Compoent. 2015-06-12 22:15:09 +02:00
Emil Stenström
31261ece08 Add a basic Component class. 2015-06-11 21:14:21 +02:00
Emil Stenström
df22a4049f Move registry to separate file. 2015-06-11 21:11:13 +02:00
Emil Stenström
ebf4ac1d20 Add way to unregister components. 2015-06-11 20:52:46 +02:00
Emil Stenström
00bd40aaaf Don't allow registering the same component twice. 2015-06-11 20:47:35 +02:00
Emil Stenström
313852ce21 A simple ComponentRegistry to store components. 2015-06-11 20:42:16 +02:00