Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Tag Model, Schemas, and Decorators #3

Open
5 tasks done
Tracked by #4
bryanwong8 opened this issue May 9, 2020 · 0 comments · Fixed by #29
Open
5 tasks done
Tracked by #4

Implement Tag Model, Schemas, and Decorators #3

bryanwong8 opened this issue May 9, 2020 · 0 comments · Fixed by #29
Assignees
Labels
backend backend feature staging This issues is in the staging branch
Milestone

Comments

@bryanwong8
Copy link
Contributor

bryanwong8 commented May 9, 2020

Is your feature request related to a problem? Please describe.
Tag model is needed to create Tag objects. Need to create Tag Schemas for serialization and validation. Also need to create decorators to not allow users to access a non-existing Tag.

Describe the solution you'd like
Create Decorators and Schemas for the Tag model.

Routes/functions to implement/change

  • Create the tag_exists decorator
  • Create the TagFormSchema, TagSchema and TagsSchema.

Additional context

  • Create the Tag model in models.py with the following fields:
  • name: text (nullable=False)
  • summary: text (nullable=False)
  • submission_guideline: text (nullable=False)
  • about: text (nullable=False)
  • emoji: text (nullable=False)
  • users: many to many relationship. Allow Users and Tags to connected to each other
  • The tag_exists decorator should take the query id from the route and query for the Tag. If the Tag exists return the args and kwargs. If not return a 404 message saying that "Tag does not exist".
  • Create the TagFormSchema class to contain the following fields:
  • name (required)
  • summary (required)
  • submission_guidelines (required)
  • about (required)
  • Create the TagSchema that has the following fields:
    • id
  • You can create the TagsSchema by using the TagSchema, but set it to return many models instead.
@bryanwong8 bryanwong8 added this to the Week 1 milestone May 9, 2020
@bryanwong8 bryanwong8 mentioned this issue May 9, 2020
6 tasks
@bryanwong8 bryanwong8 added the backend backend feature label May 11, 2020
@grchng grchng mentioned this issue May 16, 2020
@grchng grchng linked a pull request May 16, 2020 that will close this issue
@grchng grchng closed this as completed May 16, 2020
@bryanwong8 bryanwong8 reopened this May 17, 2020
@bryanwong8 bryanwong8 added the staging This issues is in the staging branch label May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend backend feature staging This issues is in the staging branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants