File tree Expand file tree Collapse file tree 4 files changed +3
-25
lines changed Expand file tree Collapse file tree 4 files changed +3
-25
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,6 @@ class Category(db.Model):
8282 ConstraintFactory .non_empty_string ('name' ),
8383 )
8484
85- def to_json (self ):
86- return {
87- 'id' : self .id ,
88- 'name' : self .name ,
89- 'created_at' : self .created_at ,
90- }
91-
9285
9386class Subcategory (db .Model ):
9487 __tablename__ = 'subcategory'
@@ -102,13 +95,6 @@ class Subcategory(db.Model):
10295 ConstraintFactory .non_empty_string ('name' ),
10396 )
10497
105- def to_json (self ):
106- return {
107- 'id' : self .id ,
108- 'name' : self .name ,
109- 'created_at' : self .created_at ,
110- }
111-
11298
11399class Product (db .Model ):
114100 __tablename__ = 'product'
@@ -121,11 +107,3 @@ class Product(db.Model):
121107 __table_args__ = (
122108 ConstraintFactory .non_empty_string ('name' ),
123109 )
124-
125- def to_json (self ):
126- return {
127- 'id' : self .id ,
128- 'name' : self .name ,
129- 'description' : self .description ,
130- 'created_at' : self .created_at ,
131- }
Original file line number Diff line number Diff line change 2525bp = Blueprint ("Category" , __name__ )
2626
2727
28- @bp .route ("" )
28+ @bp .route ("/ " )
2929class CategoryCollection (MethodView ):
3030 init_every_request = False
3131
Original file line number Diff line number Diff line change 2424bp = Blueprint ("Product" , __name__ )
2525
2626
27- @bp .route ("" )
27+ @bp .route ("/ " )
2828class ProductCollection (MethodView ):
2929 init_every_request = False
3030 _PER_PAGE = 10
Original file line number Diff line number Diff line change 2626bp = Blueprint ("Subcategory" , __name__ )
2727
2828
29- @bp .route ("" )
29+ @bp .route ("/ " )
3030class SubcategoryCollection (MethodView ):
3131 init_every_request = False
3232
You can’t perform that action at this time.
0 commit comments