#6883 (Product parameter category should include products from all the child categories)
by Sharif Mehedi · in Developers · assigned to Sharif Mehedi
Résumé
Concepts sous-jacents
Commentaires
- 4 mois ago by Luc Saffre about #6883 (Product parameter category should include products from all the child categories) : Forgive me if I'm nit-picky, but I tried to simplify your approach and pushed my suggestion. I now assume that a warning is enough.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : wrote an exception on pre_site_startup when django-mptt not installed.
- 4 mois ago by Luc Saffre about #6883 (Product parameter category should include products from all the child categories) : I ran the test suite after pulling your changes but without running "pm install", i.e. django-mptt was not installed. And it did not raise an exception in the cosi demo sites. That's actually wrong. Already "pm prep" should fail when with_mptt is True but django-mptt not installed.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : Using random in the demo fixtures seems like a bad idea. Some stuff has changed in pronto.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : Yes confirmed. It's the SiteConfig object. Everything is clean.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : I am wondering could it be the SiteConfig object!
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : Not sure If I should simply adopt the test suite
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : In book/docs/ref/commands/ddt.rst we have: >>> shell("django-admin ddt -b") previously it dumped and loaded 832 objects. And I added two more objects (the categories, Table and Chair), so, the number of objects should be 834, but mysteriously there are one more object, a total of 835. Can't figure wh...
- 4 mois ago by Luc Saffre in reply to Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : And yes, I would also use django-mptt for this.
- 4 mois ago by Luc Saffre in reply to Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : Yes, either a Site setting or a setting of the system plugin.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) (2 replies) : Should I then probably have a setting, (in the site, SITE.with_mptt or something else) to put django-mptt into the requirements and also, we can subclass MPTTModel in Hierarchical and replace the parent ForeignKey with TreeForeignKey.
- 4 mois ago by Luc Saffre in reply to Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : For example I can imagine that we will also need it for searching in comments.
- 4 mois ago by Luc Saffre in reply to Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : I suggest to start by writing a more complete example of categorized products. Either extend the furniture fixture, or write a new one. I think I would write it in the book, not just in pronto, because it is a general feature.
- 4 mois ago by Luc Saffre in reply to Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : I seem to prefer MPTT. And yes, I think that we will want a system task (probably just a data checker) for updating the tree.
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) (3 replies) : While category.whole_clan() is a solution, it still can't resolve all the subcategories from a parent. And pulling all the subcategories to python and query database back again from them is a resource intensive workflow. The other implementations that I can find and think of is using CTE or django-m...
- 4 mois ago by Luc Saffre about #6883 (Product parameter category should include products from all the child categories) : Together on Jitsi we wrote apply_simple_param_value() in dbtables.py
- 4 mois ago by Sharif Mehedi about #6883 (Product parameter category should include products from all the child categories) : Created new Ticket #6883 (Product parameter category should include products from all the child categories).