3
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – crodjer
    Commented Sep 18, 2013 at 6:46
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Sep 18, 2013 at 7:27

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.