3👍
✅
Not sure if it is the prettiest way in town but this should work:
while self.__class__.objects.filter(...):
pass
-1👍
When you create SomeModel(SomeAbstractModel), just create the class Meta from scratch without inheriting. By inheriting vom SomeAbstractModel.Meta you make it abstract again, and you cannot query on abstract model, not because they have no manager, but because there are no tables created.
So either you do this:
class SomeModel(SomeAbstractModel):
...
class Meta(SomeAbstractModel.Meta):
abstract=False
... your other model specific options
Or you do this (if you do not have any other model specific options:
class SomeModel(SomeAbstractModel):
...
- [Answered ]-Getting "AttributeError: 'str' object has no attribute 'regex'" in Django urls.reverse
- [Answered ]-Django-registration module dont send email
- [Answered ]-Django: CSS and Images (Static Files) loaded successfully but not applied
- [Answered ]-Django source code won't update on server
- [Answered ]-POST request in angular in django project with MultiValueDictKeyError
Source:stackexchange.com