5

I tried to override category_tags by creating a local version of catalogue application with a local templatetags folder which has a category_tags.py file (also init.py). It seems the default category_tags file is used. If I change the name of my local tag file and of course I load the new name of the tag in the template it works but I would like to override or extend the default category_tags not to create another one.

Any ideas?

thanks!

4

2 回答 2

1

我通过将模板放入我的 project_folder > templates > oscar_app_name > template_name.html 来让它工作

因此,要覆盖“结帐”应用程序和模板,我的结构如下所示:

/project
--/apps
----/checkout
------[change checkout models]
----__init__.py
----app.py

--/project
----/templates
------/checkout
--------payment_details.html

----__init__.py
----settings.py
----urls.py

--manage.py

然后你必须编辑 settings.py 已安装的应用程序

INSTALLED_APPS = [
    'django.contrib.admin',
    ...
    'compressor',
    'paypal',
] + get_core_apps(['apps.checkout'])
于 2014-10-17T08:17:12.080 回答
0

我会假设模板标签按INSTALLED_APPS. 包含您的应用程序是否category_tags.py出现在之前(或者不是,例如,当使用 Oscar 的get_core_apps覆盖来扩展 Oscar 核心应用程序时)oscar.core.apps.catalogue

PS。我是奥斯卡作家,不得不承认我们不经常检查 StackOverflow。邮件列表是您目前最好的选择。

于 2013-07-19T06:44:45.900 回答