class Period(models.Model):
- date_begin = models.DateField(_('begin date'), null=True, blank=True)
- date_end = models.DateField(_('end date'), null=True, blank=True)
+ date_from = models.DateField(_('begin date'), null=True, blank=True)
+ date_to = models.DateField(_('end date'), null=True, blank=True)
class Meta:
abstract = True
return None
def get_activity(self):
- self.activity.date_begin = datetime.datetime(*xlrd.xldate_as_tuple(self.row[4].value, self.datemode)) if self.row[4].value else None
- self.activity.date_end = datetime.datetime(*xlrd.xldate_as_tuple(self.row[5].value, self.datemode)) if self.row[5].value else None
+ self.activity.date_from = datetime.datetime(*xlrd.xldate_as_tuple(self.row[4].value, self.datemode)) if self.row[4].value else None
+ self.activity.date_to = datetime.datetime(*xlrd.xldate_as_tuple(self.row[5].value, self.datemode)) if self.row[5].value else None
try:
self.activity.weeks = int(self.row[6].value) if self.row[6].value else None
except:
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-21 17:08
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-network', '0020_auto_20160921_1043'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='personactivity',
+ old_name='date_begin',
+ new_name='date_from',
+ ),
+ migrations.RenameField(
+ model_name='personactivity',
+ old_name='date_end',
+ new_name='date_to',
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-21 17:08
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-projects', '0008_auto_20160916_1835'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='project',
+ old_name='date_begin',
+ new_name='date_from',
+ ),
+ migrations.RenameField(
+ model_name='project',
+ old_name='date_end',
+ new_name='date_to',
+ ),
+ ]
def get_absolute_url(self):
return reverse("organization-project-detail", kwargs={"slug": self.slug})
+ @property
+ def status(self):
+ if datetime.date.today() >= self.date_from and datetime.date.today() <= self.date_to:
+ return _('in progress')
+ elif datetime.date.today() < self.date_from and datetime.date.today() < self.date_to:
+ return _('pending')
+ elif datetime.date.today() > self.date_to and datetime.date.today() > self.date_to:
+ return _('completed')
+
class ProjectTopic(Named):
-Subproject commit cf5caf29cfc9c893a091290a54589789cb0ada7b
+Subproject commit aea178e1000f7297ed7a76252518048ab8982276
-Subproject commit 1b7f9c30776907a7815109ec64f3347ab3c71705
+Subproject commit 37a97f9affa7979e52b6b0ff7c3bc39ce2c05302