did Comment, Text, and ProcessingInstruction to follow the DOM Standard and derive from CharacterData.
  • Re-did DocumentType to follow the DOM Standard and be much simpler, notably removing notations, entities, and default attributes.
  • Fixed a variety of accessors on Node, Element, Attr, and Document; some were removed that were nonstandard (especially setters); others were updated to reflect the spec; etc.
  • Re-did name/qname validation, which is done by various APIs, to work with the xml-name-validator package and some centralized algorithms.
  • Made the XML parser at least somewhat aware of processing instructions.
  • Cleaned up doctype parsing and association between doctypes and documents. More exotic doctypes should parse better now.
  • document.contentType now is generally inferred from the parsing mode of the document.
  • Moved some properties to Document.prototype and Window.prototype instead of setting them as own properties during the document/window creation. This should improve memory usage (as well as spec compliance).
  • 2.0.0

    This release is largely a refactoring release to remove the defunct concept of "levels" from jsdom, in favor of the living standard model that browsers follow. Although the code is still organized that way, that's now noted as a historical artifact. The public API changes while doing so were fairly minimal, but this sets the stage for a cleaner jsdom code structure going forward.

    1.5.0

    1.4.1

    1.4.0

    1.3.2

    1.3.1

    1.3.0

    1.2.3

    1.2.2

    1.2.1

    1.2.0

    1.1.0

    1.0.3

    1.0.2

    1.0.1

    1.0.0

    For a consolidated list of changes from 0.11.1 to 1.0.0, see this wiki page.

    1.0.0-pre.7

    1.0.0-pre.6

    1.0.0-pre.5

    1.0.0-pre.4

    1.0.0-pre.3

    1.0.0-pre.2

    1.0.0-pre.1

    This is a prerelease of jsdom's first major version. It incorporates several great additions, as well as a general cleanup of the API surface, which make it more backward-incompatible than usual. Starting with the 1.0.0 release, we will be following semantic versioning, so that you can depend on stability within major version ranges. But we still have a few more issues before we can get there, so I don't want to do 1.0.0 quite yet.

    This release owes a special thanks to @Sebmaster, for his amazing work taking on some of the hardest problems in jsdom and solving them with gusto.

    Major changes

    Removed jsdom APIs

    Changed jsdom APIs

    Removed non-standard DOM APIs

    Other fixes

    0.11.1

    0.11.0

    0.10.6

    0.10.5

    0.10.4

    0.10.3

    0.10.2

    0.10.1

    0.10.0

    0.9.0

    0.8.11

    0.8.10

    0.8.9

    0.8.8

    0.8.7

    0.8.6

    0.8.5

    0.8.4

    0.8.3

    0.8.2

    0.8.1 (hotfix)

    0.8.0

    0.7.0

    0.6.5

    0.6.4

    0.6.3

    0.6.2

    0.6.1

    0.6.0

    Integrated a new HTML parser, htmlparser2, from fb55. This is an actively maintained and much less buggy parser, fixing many of our parsing issues, including:

    0.5.7

    0.5.6

    0.5.5

    0.5.4

    This release, and all future releases, require at least Node.js 0.8.

    0.5.3

    This release is compatible with Node.js 0.6, whereas all future releases will require at least Node.js 0.8.

    0.5.2

    0.5.1

    0.5.0

    0.4.2

    0.4.1 (hotfix)

    0.4.0

    0.3.4

    0.3.3

    0.3.2

    0.3.1 (hotfix)

    0.3.0

    0.2.19

    0.2.18

    0.2.17 (hotfix)

    0.2.16

    0.2.15

    0.2.14

    0.2.13

    0.2.12

    0.2.11

    0.2.10

    0.2.9

    0.2.8 (hotfix)

    0.2.7 (hotfix)

    0.2.6

    0.2.5

    0.2.4

    0.2.3

    0.2.2

    0.2.1

    kodo - Gogs: Go Git Service

    No Description

    admin.py 6.5KB

      # -*- coding: utf-8 -*- from django.conf import settings from django.contrib import admin from django_admin import DeleteModelAdmin from account.models import UserInfo from member.models import (GoodsInfo, GoodsOrderInfo, MemberActivityContributionInfo, MemberActivityContributionWelfareInfo, MemberActivityContributionWelfareUnlockingInfo, MemberActivityGroupShareInfo, MemberActivityInfo, MemberActivitySigninInfo, MemberActivitySignupInfo, RightInfo, ShotTypeInfo) from pre.custom_message import sendwxasubscribemessage from utils.redis.rshot import update_member_shot_data class GoodsInfoAdmin(admin.ModelAdmin): list_display = ('good_id', 'good_type', 'title', 'value', 'left_num', 'coupon_id', 'image', 'is_slider', 'slider_image', 'integral', 'fee', 'minlevel', 'only_for_member', 'only_once', 'position', 'is_upload_qiniu', 'status', 'created_at', 'updated_at') list_filter = ('good_type', 'is_slider', 'only_for_member', 'only_once', 'is_upload_qiniu', 'status') class GoodsOrderInfoAdmin(admin.ModelAdmin): list_display = ('order_id', 'user_id', 'good_id', 'good_type', 'title', 'name', 'phone', 'address', 'tracking_number', 'send_template_message_res', 'has_send_template_message', 'integral', 'status', 'created_at', 'updated_at') list_filter = ('good_type', 'status') def save_model(self, request, obj, form, change): obj.save() if obj.good_type != GoodsInfo.PHYSICAL or not obj.tracking_number or obj.has_send_template_message: return obj.has_send_template_message = True obj.save() # 校验用户是否存在 try: user = UserInfo.objects.get(user_id=obj.user_id) except UserInfo.DoesNotExist: return # TODO: 立即推送模版消息,兑换成功,快递已发送(商品,快递单号,扣除的积分) data = { "thing6": { "value": obj.title, "color": "#173177" }, "character_string7": { "value": obj.tracking_number, "color": "#173177" }, "number2": { "value": obj.integral, "color": "#173177" }, "thing5": { "value": u"您的礼品正在快马加鞭赶来,请耐心等待呦~", "color": "#173177" }, } sendwxasubscribemessage(openid=user.openid_miniapp, template_id=settings.TEMPLATE_ID_TRACKING, data=data, miniprogram_state=None, lang=None, page=None) class RightInfoAdmin(admin.ModelAdmin): list_display = ('right_id', 'right_type', 'icon', 'title', 'subtitle', 'detail', 'level1', 'level2', 'level3', 'level4', 'level5', 'minlevel', 'position', 'is_send_coupon', 'coupon_num', 'coupon_level1_id', 'coupon_level2_id', 'coupon_level3_id', 'status', 'created_at', 'updated_at') list_filter = ('right_type', 'is_send_coupon', 'is_continue_send_coupon', 'status') class ShotTypeInfoAdmin(DeleteModelAdmin, admin.ModelAdmin): list_display = ('shot_type_id', 'shot_type_name', 'position', 'status', 'created_at', 'updated_at') def save_model(self, request, obj, form, change): obj.save() update_member_shot_data() def delete_model(self, request, obj): obj.delete() update_member_shot_data() class MemberActivityInfoAdmin(admin.ModelAdmin): list_display = ('activity_id', 'activity_type', 'title', 'subtitle', 'date', 'start_date', 'end_date', 'start_display_date', 'end_display_date', 'city', 'location', 'lat', 'lon', 'is_slider', 'slider_image', 'cover', 'limit_image_num', 'share_img_link', 'share_h5_link', 'is_signup', 'activity_state', 'position', 'is_upload_qiniu', 'status', 'created_at', 'updated_at') list_filter = ('activity_type', 'is_slider', 'is_signup', 'activity_state', 'is_upload_qiniu', 'status') class MemberActivitySignupInfoAdmin(admin.ModelAdmin): list_display = ('signup_id', 'activity_id', 'title', 'name', 'phone', 'status', 'created_at', 'updated_at') class MemberActivitySignupInfoAdmin(admin.ModelAdmin): list_display = ('signup_id', 'user_id', 'activity_id', 'title', 'name', 'phone', 'status', 'created_at', 'updated_at') class MemberActivitySigninInfoAdmin(admin.ModelAdmin): list_display = ('signin_id', 'user_id', 'activity_id', 'title', 'status', 'created_at', 'updated_at') class MemberActivityGroupShareInfoAdmin(admin.ModelAdmin): list_display = ('group_share_id', 'activity_id', 'share_user_id', 'click_user_id', 'open_gid', 'title', 'is_integral', 'integral', 'status', 'created_at', 'updated_at') list_filter = ('is_integral', 'status') class MemberActivityContributionInfoAdmin(admin.ModelAdmin): list_display = ('contribution_id', 'user_id', 'activity_id', 'content_type', 'title', 'content', 'user_name', 'user_avatar', 'images', 'video_url', 'audit_status', 'is_selected', 'status', 'created_at', 'updated_at') list_filter = ('activity_id', 'content_type', 'audit_status', 'is_selected', 'status') class MemberActivityContributionWelfareInfoAdmin(admin.ModelAdmin): list_display = ('welfare_id', 'activity_id', 'welfare_type', 'welfare_title', 'welfare_detail', 'welfare_value', 'welfare_image', 'status', 'created_at', 'updated_at') list_filter = ('activity_id', 'welfare_type', 'status') class MemberActivityContributionWelfareUnlockingInfoAdmin(admin.ModelAdmin): list_display = ('unlocking_id', 'admin_id', 'user_id', 'activity_id', 'contribution_id', 'welfare_id', 'welfare_type', 'welfare_value', 'name', 'phone', 'address', 'tracking_number', 'is_handled', 'status', 'created_at', 'updated_at') list_filter = ('admin_id', 'activity_id', 'welfare_id', 'is_handled', 'status') admin.site.register(GoodsInfo, GoodsInfoAdmin) admin.site.register(GoodsOrderInfo, GoodsOrderInfoAdmin) admin.site.register(RightInfo, RightInfoAdmin) admin.site.register(ShotTypeInfo, ShotTypeInfoAdmin) admin.site.register(MemberActivityInfo, MemberActivityInfoAdmin) admin.site.register(MemberActivitySignupInfo, MemberActivitySignupInfoAdmin) admin.site.register(MemberActivitySigninInfo, MemberActivitySigninInfoAdmin) admin.site.register(MemberActivityGroupShareInfo, MemberActivityGroupShareInfoAdmin) admin.site.register(MemberActivityContributionInfo, MemberActivityContributionInfoAdmin) admin.site.register(MemberActivityContributionWelfareInfo, MemberActivityContributionWelfareInfoAdmin) admin.site.register(MemberActivityContributionWelfareUnlockingInfo, MemberActivityContributionWelfareUnlockingInfoAdmin)