rw-moore / SciLO

GNU General Public License v3.0
0 stars 0 forks source link

Feat: tag model and its API #23

Closed haotianzhu closed 5 years ago

haotianzhu commented 5 years ago

Check List

Comment

Put 'closes #.' in your comment to auto-close the issue that your PR fixes (if such).

haotianzhu commented 5 years ago

API: GET /tags POST /tags PATCH /tags/:id delete /tags/:id GET /tags/:id/questions Tag has a unique field name. I keep id in case that you want to allow special characters for tag's name. The id is only for URL, you don't need to worry about id at request's body.

haotianzhu commented 5 years ago

For reviewing purpose: This is the TAG model

class Tag(models.Model):
    '''
    name: the name of tag
    '''

    class Meta:
        app_label = 'polls'

    name = models.CharField(unique=True, max_length=20, null=False, blank=False)

    def __str__(self):
        return self.name

API Part, click this

TianqiCS commented 5 years ago

related: #26