开发者

How to develop a backend for a scrum-like board

开发者 https://www.devze.com 2023-03-31 14:22 出处:网络
Currently I\'m developing a debate module (much like a scrum/kanban board) for a GPL application (e-cidadania) and I don\'t have any experience with complex backends. I have developed a basic frontend

Currently I'm developing a debate module (much like a scrum/kanban board) for a GPL application (e-cidadania) and I don't have any experience with complex backends. I have developed a basic frontend for it, but now I don't know what approach I should use for the ajax and django backe开发者_开发问答nds to save and manipulate the table and notes.

The table can be N rows and N columns, every row and column has a name and position inside the table. Every note has also a position, text and comments (managed with the django comments framework).

I thought to store the parent element of every note (so I can place it later) and store the name of the rows and columns like CSV strings. Is that a good approach?

A screenshot of the current frontend: http: //ur1. ca/4zn4h

Update: I almost forgot, the frontend has been done with jQuery Sortables (so the user can move the note around as he likes) and CSS3.


You just need to model your domain (that is, debates that look like scrum boards) within Django. Think about it in plain English first, like this:

The has debates. These consist of criteria, organised in rows and columns in a specific order. This creates cells, which can have notes inside them.

Then you can set to work translating this into model classes. Don't worry too much about the fields they contain, the most important bit is the relationships (so the ForeignKey bits):

class Debate(models.Model):

    title = ...

class Column(models.Model):

    title = ...
    order = ...
    board = models.ForeignKey(ScrumBoard, related_name='columns')

class Row(models.Model):

    title = ...
    order = ...
    board = models.ForeignKey(ScrumBoard, related_name='rows')

class Cell(models.Model):

    column = models.ForeignKey(Column)
    row = models.ForeignKey(Row)

class Note(models.Model)

    text = ...
    cell = models.ForeignKey(Cell)

That might be overly complex for what you need, though. I'm not an expert in the problem you're trying to solve? My suggestion, Django is quick – so start hacking, and give it a go, and if it's all wrong then you can go back a few steps, clean out your database and try again.

You might find it useful to play with South, which does database migrations for when you do things like add/remove/edit fields in your models.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号