diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-01-14 14:55:41 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-01-14 14:55:41 +0100 |
| commit | 851e8b81898279079c14c4c0c3580699f9bb9998 (patch) | |
| tree | 65cc22967af05ef7f9f8b61ca49b992b92dd8b0e /ishtar/furnitures/models.py | |
| parent | 8713dc19cb4ae5c7d2539add214e6b2c4f5ac670 (diff) | |
| download | Ishtar-851e8b81898279079c14c4c0c3580699f9bb9998.tar.bz2 Ishtar-851e8b81898279079c14c4c0c3580699f9bb9998.zip | |
Implementation of default operations (refs #16)
Diffstat (limited to 'ishtar/furnitures/models.py')
| -rw-r--r-- | ishtar/furnitures/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py index e3c434f7a..01296c109 100644 --- a/ishtar/furnitures/models.py +++ b/ishtar/furnitures/models.py @@ -334,6 +334,12 @@ class Operation(BaseHistorizedItem, OwnPerms): if getattr(self, k)] return u" - ".join(items) + @classmethod + def get_owns(cls, user, order_by=['-year', '-operation_code']): + if user.is_anonymous(): + return [] + return cls.objects.filter(history_modifier=user).order_by(*order_by + ).all() class Parcel(LightHistorizedItem): associated_file = models.ForeignKey(File, related_name='parcels', |
