在 Django Oscar 中过滤和排序产品?内置功能还是必须自定义构建?
Filtering and Sorting Products in Django Oscar ? In-built feature or have to custom build?
本身不是编程问题,更像是一个功能问题。我正在尝试 Django-Oscar 并发现它很棒。是否有按类别过滤产品的内置方法?
还有内置的方法可以按价格对产品进行排序吗?我可以自己构建它,只是询问以防万一某些功能可用。我试着阅读它的文档:http://django-oscar.readthedocs.org/。我没找到什么。
首先安装 Solr 4。例如,在 OSX 上,您可以:
$ brew tap homebrew/versions
$ brew install solr4
(必须是 Solr 4 才能使用 Oscar 的现成配置)
然后获取奥斯卡源代码的副本:
$ git clone https://github.com/django-oscar/django-oscar.git
然后将 Solr 示例站点中的 conf(Solr 服务器默认提供的服务)替换为 Oscar 演示站点中包含的 Solr conf 的符号链接,大致按照 Oscar 文档 here
首先找到您的 Solr 安装:
$ brew info solr4
homebrew/versions/solr4: stable 4.10.4
Enterprise search platform from Apache Lucene project
https://lucene.apache.org/solr/
Conflicts with: solr
/usr/local/Cellar/solr4/4.10.4 (4658 files, 248M) *
Built from source
然后看看,这里是我对 conf 进行符号链接的地方:
$ ls -l /usr/local/Cellar/solr4/4.10.4/example/solr/collection1/
total 24
-rw-r--r-- 1 me wheel 2146 8 Sep 2014 README.txt
lrwxr-xr-x 1 me wheel 44 7 Jun 13:37 conf -> <path to oscar repo>/sites/demo/deploy/solr
drwxr-xr-x 24 me wheel 816 27 Feb 2015 conf.original
-rw-r--r-- 1 me wheel 16 8 Sep 2014 core.properties
drwxr-xr-x 4 me wheel 136 6 Jun 17:03 data
本身不是编程问题,更像是一个功能问题。我正在尝试 Django-Oscar 并发现它很棒。是否有按类别过滤产品的内置方法?
还有内置的方法可以按价格对产品进行排序吗?我可以自己构建它,只是询问以防万一某些功能可用。我试着阅读它的文档:http://django-oscar.readthedocs.org/。我没找到什么。
首先安装 Solr 4。例如,在 OSX 上,您可以:
$ brew tap homebrew/versions
$ brew install solr4
(必须是 Solr 4 才能使用 Oscar 的现成配置)
然后获取奥斯卡源代码的副本:
$ git clone https://github.com/django-oscar/django-oscar.git
然后将 Solr 示例站点中的 conf(Solr 服务器默认提供的服务)替换为 Oscar 演示站点中包含的 Solr conf 的符号链接,大致按照 Oscar 文档 here
首先找到您的 Solr 安装:
$ brew info solr4
homebrew/versions/solr4: stable 4.10.4
Enterprise search platform from Apache Lucene project
https://lucene.apache.org/solr/
Conflicts with: solr
/usr/local/Cellar/solr4/4.10.4 (4658 files, 248M) *
Built from source
然后看看,这里是我对 conf 进行符号链接的地方:
$ ls -l /usr/local/Cellar/solr4/4.10.4/example/solr/collection1/
total 24
-rw-r--r-- 1 me wheel 2146 8 Sep 2014 README.txt
lrwxr-xr-x 1 me wheel 44 7 Jun 13:37 conf -> <path to oscar repo>/sites/demo/deploy/solr
drwxr-xr-x 24 me wheel 816 27 Feb 2015 conf.original
-rw-r--r-- 1 me wheel 16 8 Sep 2014 core.properties
drwxr-xr-x 4 me wheel 136 6 Jun 17:03 data