示例#1
0
    def save_models(self):
        # 保存数据对象
        obj = self.new_obj
        obj.save()

        # 补充自定义行为
        from celery_tasks.htmls.tasks import generate_static_sku_detail_html
        generate_static_sku_detail_html.delay(obj.sku.id)
示例#2
0
    def delete_model(self):
        # 删除数据对象
        obj = self.obj
        sku_id = obj.sku.id
        obj.delete()

        # 补充自定义行为
        from celery_tasks.htmls.tasks import generate_static_sku_detail_html
        generate_static_sku_detail_html.delay(sku_id)
示例#3
0
    def save_model(self, request, obj, form, change):
        obj.save()
        from celery_tasks.htmls.tasks import generate_static_sku_detail_html
        generate_static_sku_detail_html.delay(obj.sku.id)

        # 设置SKU默认图片
        sku = obj.sku
        if not sku.default_image_url:
            sku.default_image_url = obj.image.url
            sku.save()
示例#4
0
 def save_model(self, request, obj, form, change):
     obj.save()
     from celery_tasks.htmls.tasks import generate_static_sku_detail_html
     generate_static_sku_detail_html.delay(obj.id)
示例#5
0
 def delete_model(self, request, obj):
     sku_id = obj.sku.id
     obj.delete()
     from celery_tasks.htmls.tasks import generate_static_sku_detail_html
     generate_static_sku_detail_html.delay(sku_id)