Has anyone made use of the related_categories ManyToMany relation?
I need a sub category to appear as if it belongs under several
parents.
For example: I have "Tie Tacks" categorized under Accessories.
It can logically appear in other places, such as:
Accessories
Tie Tacks
Men's Jewelry
Tie Tacks
Gifts
For Him
Tie Tacks
Was related_categories intended for this case?
It expresses a ManyToMany relation between product_category and
itself.
I find no support for it in templates or templatetags.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Category(models.Model):
. . .
related_categories = models.ManyToManyField('self',
blank=True, null=True,
verbose_name=_('Related Categories'),
related_name='related_categories')
. . .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CREATE TABLE "product_category" (
"id" serial NOT NULL PRIMARY KEY,
"site_id" integer NOT NULL REFERENCES "django_site" ("id")
DEFERRABLE INITIALLY DEFERRED,
"name" varchar(200) NOT NULL,
"slug" varchar(50) NOT NULL,
"parent_id" integer,
"meta" text,
"description" text NOT NULL,
"ordering" integer NOT NULL,
"is_active" boolean NOT NULL,
UNIQUE ("site_id", "slug")
);
CREATE TABLE "product_category_related_categories" (
"id" serial NOT NULL PRIMARY KEY,
"from_category_id" integer NOT NULL REFERENCES
"product_category" ("id") DEFERRABLE INITIALLY DEFERRED,
"to_category_id" integer NOT NULL REFERENCES
"product_category" ("id") DEFERRABLE INITIALLY DEFERRED,
UNIQUE ("from_category_id", "to_category_id")
);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---