I'm experimenting with creating templates out of subtemplates. These 
subtemplates can be either (a) simple text or (b) a hash representing a 
sentence (i.e. {subject: "Dog", verb: "eat", object: "my {{var}}", tense: 
"past"}). I would like to run the hashes through a realization engine which 
would render as "Dog ate my homework" given a context dictionary of {var: 
"homework"}. The realization engine is accessed via a REST API.

Does that make sense?

On Friday, September 2, 2016 at 1:38:39 AM UTC-4, Constantine Covtushenko 
wrote:
>
> Hi All,
> There is no valuable reason to do it in the template. And no matter how to 
> ate using it, cause template should only present view model(s).
>
> But if you tell us your intention may be we can suggest a better place for 
> such request?
>
> Regards,
>
> On Sep 2, 2016 6:03 AM, "Al Johri" <al.j...@gmail.com <javascript:>> 
> wrote:
>
>> Ludovic,
>>
>> I'm using the templates for a different purpose, not in a web framework 
>> or view.
>>
>> Thanks,
>>
>> Al
>>
>> On Thursday, September 1, 2016 at 8:09:29 AM UTC-4, ludovic coues wrote:
>>>
>>> I wouldn't do it this way. 
>>> Personally, I would make the POST request in the view function, put 
>>> the return value in the context. The template isn't a good place to 
>>> have logic. It should only take data and format them. 
>>>
>>> 2016-09-01 5:33 GMT+02:00 Al Johri <al.j...@gmail.com>: 
>>> > Hi Django Users, 
>>> > 
>>> > I want to make a custom template tag where the tag's renderer needs to 
>>> make 
>>> > a POST request. 
>>> > 
>>> > 
>>> https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#writing-the-renderer
>>>  
>>> > 
>>> https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#thread-safety-considerations
>>>  
>>> > 
>>> > Is it possible to render the nodes of a template in multiple threads? 
>>> I 
>>> > would ideally like those POST requests to happen at the same time. 
>>> > 
>>> > Does anyone know of some similar project? 
>>> > 
>>> > Thanks, 
>>> > 
>>> > Al 
>>> > 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups 
>>> > "Django users" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an 
>>> > email to django-users...@googlegroups.com. 
>>> > To post to this group, send email to django...@googlegroups.com. 
>>> > Visit this group at https://groups.google.com/group/django-users. 
>>> > To view this discussion on the web visit 
>>> > 
>>> https://groups.google.com/d/msgid/django-users/84ccc6dc-ae1d-404c-9a05-1b72fc36a778%40googlegroups.com.
>>>  
>>>
>>> > For more options, visit https://groups.google.com/d/optout. 
>>>
>>>
>>>
>>> -- 
>>>
>>> Cordialement, Coues Ludovic 
>>> +336 148 743 42 
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/7eaa219b-ddee-4fa2-8ffb-37d04f168965%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/7eaa219b-ddee-4fa2-8ffb-37d04f168965%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2718aa6b-3f5c-4c38-843b-773d41d944e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to