diff --git a/docs/source/usage.rst b/docs/source/usage.rst index e1f1fa1..98143a6 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -194,12 +194,25 @@ The attribute type *json* allows to store them in JSON format, which internally "it": "Scopa Verde" }) + prod2 = Product.objects.create(sku='PRD00002', eav__name_intl={ + "es": "Escoba Roja", + "en": "Red Broom" + }) + + prod3 = Product.objects.create(sku='PRD00003', eav__name_intl={ + "es": "Escoba Azul", + "it": "Scopa Blu" + }) + prod.eav.name_intl {'es': 'Escoba Verde', 'en': 'Green Broom', 'it': 'Scopa Verde'} type(prod.eav.name_intl) dict + Product.objects.filter(eav__name_intl__has_key="it") + , ]> + Finally, attribute type *object* allows to relate Django model instances via generic foreign keys: