Skip to content

Commit fb70133

Browse files
committed
LITE-25949 Added info on support of proxied models to README
1 parent 21e4df1 commit fb70133

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,22 @@ class Author(MasterMixin, models.Model):
5252
CQRS_SERIALIZER = 'app.api.AuthorSerializer'
5353

5454

55-
# For cases of Diamond Multiinheritance the following approach could be used:
55+
# For cases of Diamond Multi-inheritance or in case of Proxy Django-models the following approach could be used:
5656
from mptt.models import MPTTModel
5757
from dj_cqrs.metas import MasterMeta
5858

5959
class ComplexInheritanceModel(MPTTModel, RawMasterMixin):
6060
pass
6161

62+
class BaseModel(RawMasterMixin):
63+
pass
64+
65+
class ProxyModel(BaseModel):
66+
class Meta:
67+
proxy = True
68+
6269
MasterMeta.register(ComplexInheritanceModel)
70+
MasterMeta.register(BaseModel)
6371
```
6472

6573
```python

0 commit comments

Comments
 (0)