summaryrefslogtreecommitdiff
path: root/ishtar/furnitures
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures')
-rw-r--r--ishtar/furnitures/context_processors.py3
-rw-r--r--ishtar/furnitures/forms.py2
-rw-r--r--ishtar/furnitures/models.py6
3 files changed, 9 insertions, 2 deletions
diff --git a/ishtar/furnitures/context_processors.py b/ishtar/furnitures/context_processors.py
index ed6fb1252..f81b6f7c3 100644
--- a/ishtar/furnitures/context_processors.py
+++ b/ishtar/furnitures/context_processors.py
@@ -39,7 +39,8 @@ def get_base_context(request):
dct['JQUERY_URL'] = settings.JQUERY_URL
dct['JQUERY_UI_URL'] = settings.JQUERY_UI_URL
dct['current_menu'] = []
- for lbl, model in ((_(u"Archaelogical file"), models.File),):
+ for lbl, model in ((_(u"Archaelogical file"), models.File),
+ (_(u"Operation"), models.Operation)):
model_name = model.__name__.lower()
current = model_name in request.session and request.session[model_name]
items = []
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py
index 376287d68..5bb1af6a9 100644
--- a/ishtar/furnitures/forms.py
+++ b/ishtar/furnitures/forms.py
@@ -703,7 +703,7 @@ class OperationFormGeneral(forms.Form):
operation_type = forms.ChoiceField(label=_("Operation type"),
choices=models.OperationType.get_types())
start_date = forms.DateField(label=_(u"Start date"), required=False,
- initial=get_now, widget=widgets.JQueryDate)
+ widget=widgets.JQueryDate)
end_date = forms.DateField(label=_(u"End date"), required=False,
widget=widgets.JQueryDate)
year = forms.IntegerField(label=_("Year"),
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',