Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I have a Task model in Django which looks like the following:

class Task(TimeStampedModel):
    project = models.ForeignKey(Project, related_name='tasks')
    date = models.DateField(_('date'))
    task = models.TextField(_('what\'s the task?'))
    status = models.CharField(
        _('what\'s the status'), default=constants.TASK_STATUS_EMPTY,
        max_length=40, choices=constants.TASK_STATUS_CHOICES)
    status_note = models.TextField(_('write a note about status'), blank=True)

    created_by = models.ForeignKey(User, related_name='created_tasks')
    modified_by = models.ForeignKey(User, related_name='modified_tasks')

    class Meta:
        ordering = ('-created', '-modified')

    def __unicode__(self):
        return self.task

Here is a screenshot of the final implementation:

Task Management System Dashboard

I have exposed this Task model using django-tastypie as a RESTful api.

On client side, I have used AngularJS for editing/adding tasks.

I need to group tasks by project and date for rendering them properly. I have used _.groupBy method of lodash.js for this.

I wanted to know if there is a better approach to implement same interface.

share|improve this question
1  
I think grouping on the client side is fine, given the list is limited. I am currently building stuff which lets you do some processing in the client itself. I see that performance for 1000 - 2000 entries is reasonable in that case. –  crodjer Sep 18 '13 at 6:46
    
I thought grouping of tasks in django-tastypie may be a pain. Further, API could have been complicated if I moved this to server side. Lodash has reasonable performance. Anyway, as per our use case, no. of tasks to be rendered on a page will be always less than 2000. –  psjinx Sep 18 '13 at 7:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.