Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ class Category(db.Model):
ConstraintFactory.non_empty_string('name'),
)

def to_json(self):
return {
'id': self.id,
'name': self.name,
'created_at': self.created_at,
}


class Subcategory(db.Model):
__tablename__ = 'subcategory'
Expand All @@ -102,13 +95,6 @@ class Subcategory(db.Model):
ConstraintFactory.non_empty_string('name'),
)

def to_json(self):
return {
'id': self.id,
'name': self.name,
'created_at': self.created_at,
}


class Product(db.Model):
__tablename__ = 'product'
Expand All @@ -121,11 +107,3 @@ class Product(db.Model):
__table_args__ = (
ConstraintFactory.non_empty_string('name'),
)

def to_json(self):
return {
'id': self.id,
'name': self.name,
'description': self.description,
'created_at': self.created_at,
}
2 changes: 1 addition & 1 deletion app/routes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
bp = Blueprint("Category", __name__)


@bp.route("")
@bp.route("/")
class CategoryCollection(MethodView):
init_every_request = False

Expand Down
2 changes: 1 addition & 1 deletion app/routes/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
bp = Blueprint("Product", __name__)


@bp.route("")
@bp.route("/")
class ProductCollection(MethodView):
init_every_request = False
_PER_PAGE = 10
Expand Down
2 changes: 1 addition & 1 deletion app/routes/subcategory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
bp = Blueprint("Subcategory", __name__)


@bp.route("")
@bp.route("/")
class SubcategoryCollection(MethodView):
init_every_request = False

Expand Down