Product categories

694 views
Skip to first unread message

Raymond Besiga

unread,
Aug 15, 2013, 5:11:57 AM8/15/13
to django...@googlegroups.com
How are product categories implemented in Django Oscar. Going by the example in the sandbox, it does not seem like a straight forward process. I have tried to add product categories or just categories but its not working as expected.

When i try to add a category, i get the following error:

TemplateDoesNotExist at /admin/catalogue/category/
admin/tree_change_list.html
Is there a template in Django Oscar that I am missing or do I have to create it myself. Any advice regarding product categories will be appreciated

David Winterbottom

unread,
Aug 19, 2013, 5:22:13 PM8/19/13
to django-oscar
You can use the dashboard to add categories.

Ensure you have treebeard in your INSTALLED_APPS for that template to be picked up.  If you use the get_core_apps helper function, this happens automatically.


--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-oscar/53b9e15e-b974-415d-98ba-18357ee8e742%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
David Winterbottom
Head of Programming

Tangent Labs
84-86 Great Portland Street
London W1W 7NR
England, UK

Raymond Besiga

unread,
Aug 21, 2013, 9:50:30 AM8/21/13
to django...@googlegroups.com
Hey David,

I added treebeard and was already using the get_core_apps helper function. Running pip install django-treebeard alerts me that the requirement is already satisfied. My traceback is as follows:

Environment:


Request Method: GET

Django Version: 1.5.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.flatpages',
 'django.contrib.admin',
 'treebeard',
 'south',
 'compressor',
 'oscar',
 'oscar.apps.analytics',
 'oscar.apps.order',
 'oscar.apps.checkout',
 'oscar.apps.shipping',
 'oscar.apps.catalogue',
 'oscar.apps.catalogue.reviews',
 'oscar.apps.basket',
 'oscar.apps.payment',
 'oscar.apps.offer',
 'oscar.apps.address',
 'oscar.apps.partner',
 'oscar.apps.customer',
 'oscar.apps.promotions',
 'oscar.apps.search',
 'oscar.apps.voucher',
 'oscar.apps.dashboard',
 'oscar.apps.dashboard.reports',
 'oscar.apps.dashboard.users',
 'oscar.apps.dashboard.orders',
 'oscar.apps.dashboard.promotions',
 'oscar.apps.dashboard.catalogue',
 'oscar.apps.dashboard.offers',
 'oscar.apps.dashboard.partners',
 'oscar.apps.dashboard.ranges',
 'oscar.apps.dashboard.vouchers',
 'oscar.apps.dashboard.communications',
 'haystack',
 'treebeard',
 'sorl.thumbnail']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'oscar.apps.basket.middleware.BasketMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/Users/raybesiga/Documents/Sites/defshop/templates/admin/tree_change_list.html (File does not exist)
/Users/raybesiga/Documents/Sites/django-oscar/oscar/templates/oscar/admin/tree_change_list.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/contrib/auth/templates/admin/tree_change_list.html (File does not exist)
/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/contrib/admin/templates/admin/tree_change_list.html (File does not exist)
/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django_compressor-1.3-py2.7.egg/compressor/templates/admin/tree_change_list.html (File does not exist)
/Users/raybesiga/Documents/Sites/django-oscar/oscar/templates/admin/tree_change_list.html (File does not exist)
/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django_haystack-2.0.0_beta-py2.7.egg/haystack/templates/admin/tree_change_list.html (File does not exist)



Traceback:
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  140.                     response = response.render()
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/template/response.py" in render
  105.             self.content = self.rendered_content
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  80.         template = self.resolve_template(self.template_name)
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/template/response.py" in resolve_template
  58.             return loader.get_template(template)
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/template/loader.py" in get_template
  146.     template, origin = find_template(template_name)
File "/Users/raybesiga/.virtualenvs/oscar/lib/python2.7/site-packages/django/template/loader.py" in find_template
  139.     raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /admin/catalogue/category/
Exception Value: admin/tree_change_list.html

Maik Hoepfel

unread,
Aug 21, 2013, 12:27:03 PM8/21/13
to django...@googlegroups.com
Hi Raymond,

I think you're seeing this issue: https://github.com/tangentlabs/django-oscar/issues/761 Can you enable 'django.template.loaders.eggs.Loader' and let me know if it fixes things?

Please test against a current checkout of Oscar's master branch. I was just trying to recreate the issue, and for me the category display is working. Note that this is unsupported and you should use the dashboard.



Cheers,

Maik

Raymond Besiga

unread,
Aug 21, 2013, 7:51:12 PM8/21/13
to django...@googlegroups.com
Hey Maik,

Thanks so much. This fixed everything. Was having a similar issue! Thanks for saving me lots of time. And for being so helpful.

Maik Hoepfel

unread,
Aug 22, 2013, 5:08:17 AM8/22/13
to django...@googlegroups.com
Hi Raymond,

good to hear it worked. I've made it the default behaviour now:
https://github.com/tangentlabs/django-oscar/commit/e38e8c95f822b11f201e6b020a5dc3f5c8eb9b7e

Have a good week,

Maik
> You received this message because you are subscribed to a topic in the
> Google Groups "django-oscar" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-oscar/aiMG799UgAE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-oscar...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-oscar.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-oscar/5c34f6c4-71be-4a97-84f5-8853f3d25e05%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



Maik Hoepfel


Tangent Snowball
84-86 Great Portland Street
London
W1W 7NR




www.tangentsnowball.com

Tangent Snowball is a registered trading name of Tangent Marketing Services Limited
Registered Office: 84-86 Great Portland Street, London W1W 7NR
Registered in England Wales Number 4323657

This message contains confidential information and is intended only for the individual named.
If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail by mistake
and delete this e-mail from your system.


Reply all
Reply to author
Forward
0 new messages