@@ -31,30 +31,30 @@ def render(self, form_data):
3131 }
3232 for category in self .event .categories .all ()
3333 ],
34- 'items ' : [
34+ 'products ' : [
3535 {
36- 'id' : item .id ,
37- 'name' : str (item .name ),
38- 'internal_name' : str (item .internal_name ),
39- 'category' : item .category_id ,
40- 'price' : item .default_price ,
41- 'tax_rate' : item .tax_rule .rate if item .tax_rule else Decimal ('0.00' ),
42- 'tax_name' : str (item .tax_rule .name ) if item .tax_rule else None ,
43- 'admission' : item .admission ,
44- 'active' : item .active ,
36+ 'id' : product .id ,
37+ 'name' : str (product .name ),
38+ 'internal_name' : str (product .internal_name ),
39+ 'category' : product .category_id ,
40+ 'price' : product .default_price ,
41+ 'tax_rate' : product .tax_rule .rate if product .tax_rule else Decimal ('0.00' ),
42+ 'tax_name' : str (product .tax_rule .name ) if product .tax_rule else None ,
43+ 'admission' : product .admission ,
44+ 'active' : product .active ,
4545 'variations' : [
4646 {
4747 'id' : variation .id ,
4848 'active' : variation .active ,
4949 'price' : variation .default_price
5050 if variation .default_price is not None
51- else item .default_price ,
51+ else product .default_price ,
5252 'name' : str (variation ),
5353 }
54- for variation in item .variations .all ()
54+ for variation in product .variations .all ()
5555 ],
5656 }
57- for item in self .event .items .select_related ('tax_rule' ).prefetch_related ('variations' )
57+ for product in self .event .products .select_related ('tax_rule' ).prefetch_related ('variations' )
5858 ],
5959 'questions' : [
6060 {
@@ -83,7 +83,7 @@ def render(self, form_data):
8383 'positions' : [
8484 {
8585 'id' : position .id ,
86- 'item ' : position .item_id ,
86+ 'product ' : position .product_id ,
8787 'variation' : position .variation_id ,
8888 'price' : position .price ,
8989 'attendee_name' : position .attendee_name ,
@@ -107,10 +107,10 @@ def render(self, form_data):
107107 {
108108 'id' : quota .id ,
109109 'size' : quota .size ,
110- 'items ' : [item .id for item in quota .items .all ()],
110+ 'products ' : [product .id for product in quota .products .all ()],
111111 'variations' : [variation .id for variation in quota .variations .all ()],
112112 }
113- for quota in self .event .quotas .all ().prefetch_related ('items ' , 'variations' )
113+ for quota in self .event .quotas .all ().prefetch_related ('products ' , 'variations' )
114114 ],
115115 }
116116 }
0 commit comments