美文网首页
08-Vue - trade adminx搭建

08-Vue - trade adminx搭建

作者: coderST | 来源:发表于2018-01-09 15:00 被阅读15次
    import xadmin
    from .models import ShoppingCart, OrderInfo, OrderGoods
    
    
    class ShoppingCartAdmin(object):
        list_display = ["user", "goods", "nums", ]
    
    
    class OrderInfoAdmin(object):
        list_display = ["user", "order_sn",  "trade_no", "pay_status", "post_script", "order_mount",
                        "order_mount", "pay_time", "add_time"]
    
        class OrderGoodsInline(object):
            model = OrderGoods
            exclude = ['add_time', ]
            extra = 1
            style = 'tab'
    
        inlines = [OrderGoodsInline, ]
    
    
    xadmin.site.register(ShoppingCart, ShoppingCartAdmin)
    xadmin.site.register(OrderInfo, OrderInfoAdmin)
    

    相关文章

      网友评论

          本文标题:08-Vue - trade adminx搭建

          本文链接:https://www.haomeiwen.com/subject/wszwnxtx.html