Replies: 4 comments 3 replies
-
I just attached a draft PR with how I think rendering a component view directly might work. Something like: from example.unicorn.components.text_inputs import TextInputsView
urlpatterns = [
path("direct-view", TextInputsView.as_view(), name="direct-view",),
] How does that look to you? I still need to figure out how the csrf token and javascript portion would get included on the page. I think that the component would extend/include a template with |
Beta Was this translation helpful? Give feedback.
-
Yeah extending seems great to me. |
Beta Was this translation helpful? Give feedback.
-
Is there anything I can do to help to get this one merged soon? My team is using unicorn for a larger project and this would really help us save some development time and keep a cleaner codebase. |
Beta Was this translation helpful? Give feedback.
-
#181 now works as expected with a basic test case I've set up. I'm going to do some more testing, but am hopeful to merge this into master and tag a new release in the next day or so. The basic gist is that the component template can look like any other Django template (i.e. it can extend a base template, have blocks, etc), but there are two requirements:
|
Beta Was this translation helpful? Give feedback.
-
I find myself writing duplicate views. A Django regular view that simply serves an html which does nothing but load a unicorn view and then the unicorn view itself.
I was wondering if it was possible to present the unicorn view directly to the user.
Also I was wondering if unicorn will have an equivalent of some client side routing strategy
Beta Was this translation helpful? Give feedback.
All reactions