917 @unbind_method |
917 @unbind_method |
918 def require_group_compat(registered): |
918 def require_group_compat(registered): |
919 def plug_selector(cls, vreg): |
919 def plug_selector(cls, vreg): |
920 cls = registered(cls, vreg) |
920 cls = registered(cls, vreg) |
921 if getattr(cls, 'require_groups', None): |
921 if getattr(cls, 'require_groups', None): |
922 warn('use "use match_user_groups(group1, group2)" instead of using require_groups', |
922 warn('use "match_user_groups(group1, group2)" instead of using require_groups', |
923 DeprecationWarning) |
923 DeprecationWarning) |
924 cls.__selectors__ += (match_user_groups(cls.require_groups),) |
924 cls.__selectors__ += (match_user_groups(cls.require_groups),) |
925 return cls |
925 return cls |
926 return plug_selector |
926 return plug_selector |
927 |
927 |
928 @unbind_method |
928 @unbind_method |
929 def accepts_compat(registered): |
929 def accepts_compat(registered): |
930 def plug_selector(cls, vreg): |
930 def plug_selector(cls, vreg): |
931 cls = registered(cls, vreg) |
931 cls = registered(cls, vreg) |
932 if getattr(cls, 'accepts', None): |
932 if getattr(cls, 'accepts', None): |
933 warn('use "use match_user_groups(group1, group2)" instead of using require_groups', |
933 warn('use "match_user_groups(group1, group2)" instead of using require_groups', |
934 DeprecationWarning) |
934 DeprecationWarning) |
935 cls.__selectors__ += (implements(*cls.accepts),) |
935 cls.__selectors__ += (implements(*cls.accepts),) |
936 return cls |
936 return cls |
937 return plug_selector |
937 return plug_selector |
938 |
938 |
944 warn('use "use rql_condition(expression)" instead of using condition', |
944 warn('use "use rql_condition(expression)" instead of using condition', |
945 DeprecationWarning) |
945 DeprecationWarning) |
946 cls.__selectors__ += (rql_condition(cls.condition),) |
946 cls.__selectors__ += (rql_condition(cls.condition),) |
947 return cls |
947 return cls |
948 return plug_selector |
948 return plug_selector |
|
949 |
|
950 @unbind_method |
|
951 def has_relation_compat(registered): |
|
952 def plug_selector(cls, vreg): |
|
953 cls = registered(cls, vreg) |
|
954 if getattr(cls, 'type', None): |
|
955 warn('use relation_possible selector instead of using etype_rtype', |
|
956 DeprecationWarning) |
|
957 cls.__selectors__ += (relation_possible(cls.rtype), role(cls), |
|
958 getattr(cls, 'etype', None), |
|
959 action=getattr(cls, 'require_permission', 'read')) |
|
960 return cls |
|
961 return plug_selector |