Saturday, August 23, 2014

Re: Problems with class based views

Hi again,

I found what the problem was. I had errors in the template that the internal view was using. Therefore django used the default template. Strange but at least understandable behaviour.

Regards,

Andréas

Med vänliga hälsningar,

Andréas Kühne
Software Development Manager
Suitopia Scandinavia AB


2014-08-23 17:36 GMT+02:00 Andreas Kuhne <andreas.kuhne@suitopia.com>:
Hi all,

I am working on rewrite of our website with the latest version of django and Python 3. I have had alot of strange things occuring because we are using Python 3, however today I had the first problem with django. I would like to know if this is per design or if I have done something wrong.

My problem is that I have 2 ListView's for an object. One in the public part of our website and one in the internal admin. They create lists of an object called Order.

The public view is called OrderListView and lists all of the orders that a user has. The template used for this OrderListView is in the directory shop/order_list.html. This is also the default for a ListView based on the Order object (the Order object is in the shop app). 

The internal view is alse called OrderListView, but in a different application. I have set the template_name variable on that OrderListView so that it uses a different template. The problem I am having is that this doesn't work. The internal version still uses the default template, but with the correct list.

I really don't understand why this is happening, I seems as though the template_name variable only works if you don't have the "default" template name present. Is this true? Has anyone else run into this problem?

Regards,

Andréas

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALXYUbnGPPonAkuA0wXjvzpzKuTOPg0fpOiCJTiX9KRyfjLNCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment