a ŸÛîb¾ã@sxddlmZddlmZddlmZmZmZmZddlmZddl m Z ddl Z ddl m Z dd„Zd d „Zd d „ZdS) é)Úrender)ÚCustomerÚMerchantÚOrderÚDelivery)ÚMax)ÚtimezoneN)Ú randrangecCs^tj ¡ tdƒ¡d}td|ƒ}tjjtdtj ¡ tdƒ¡dƒd}d|i}t|d|ƒS)NÚidÚid__maxé©r Úcustomerz authuser.html)rÚobjectsÚallÚ aggregaterr Úgetr)ÚrequestZ max_cust_idZcust_idrÚcontext©rúL/Users/birayaha/musical-bassoon/logistics_app/django_app/logistics/orders.pyÚauthuser s  (ÿrc Cs¤t ¡}t ¡}t ¡}t ¡}tjjtdtj ¡  t dƒ¡dƒdj }t jjtdt j ¡  t dƒ¡dƒdj }t ||||||d}| ¡d|i}t|d|ƒS)Nr r r r )ÚuuidÚ created_atÚ updated_atÚproductÚ customer_idÚ merchant_idÚorderúorder_detail.html)rÚuuid1rÚnowrrrr rrrr rrÚsaver) rZ order_uuidZorder_created_atZorder_updated_atZ order_productZorder_merchant_idZorder_customer_idÚ order_objrrrrÚinserts**ÿr$cCs4tjj|d}t ¡|_| ¡d|i}t|d|ƒS)N)rrr)rrrrr!rr"r)rrr#rrrrÚupdate"s  ÿr%)Údjango.shortcutsrZlogistics.modelsrrrrÚdjango.db.modelsrÚ django.utilsrrÚrandomr rr$r%rrrrÚs