Closed haotianzhu closed 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.
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
related: #26
Check List
[x] Fix #. (write the relative issue number)
[x] Branch is up to date with master
[x] Now it's a good time for reviewing
[x] Branch should have prefix either "feature/" or "fix/"
Comment
Put 'closes #.' in your comment to auto-close the issue that your PR fixes (if such).