Permalink
Browse files

initial punch logging

  • Loading branch information...
1 parent f7f0e27 commit 574fd4ef09097517b3bc8cd4c1b63a0f953e1ca8 @snarlygoster committed May 3, 2012
Showing with 20 additions and 4 deletions.
  1. +1 −4 timeclock/fixtures/initial_data.yaml
  2. +19 −0 timeclock/models.py
@@ -23,7 +23,4 @@
- fields: {description: '', job_complete: false, ticket: Close
Shop, on_work_queue: true}
model: timeclock.activity
- pk: 3
-- fields: {description: '', job_complete: false, ticket: Open Shop, on_work_queue: true}
- model: timeclock.activity
- pk: 1
+ pk: 3
View
@@ -92,3 +92,22 @@ class Meta:
fields = ('worker', 'activity')
widgets = {'worker': RadioSelect, 'activity': RadioSelect }
+
+class WorkPeriod(models.Model):
+ """a span of time when work on a job is done by a Worker"""
+
+ worker = models.ForeignKey(Worker)
+ job = models.ForeignKey(Activity)
+
+ start_time = models.DateTimeField()
+ end_time = models.DateTimeField()
+
+ class Meta:
+ ordering = ['start_time',]
+
+ def __unicode__(self):
+ return "%s - %s" % (self.worker, self.start_time)
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('')

0 comments on commit 574fd4e

Please sign in to comment.