adhocracy_core.sheets.rate module¶
Rate sheet.
-
interface
IRate[source]¶ Extends:
adhocracy_core.interfaces.IPredicateSheet,adhocracy_core.interfaces.ISheetReferenceAutoUpdateMarkerMarker interface for the rate sheet.
-
interface
IRateable[source]¶ Extends:
adhocracy_core.interfaces.ISheet,adhocracy_core.interfaces.ISheetReferenceAutoUpdateMarkerMarker interface for resources that can be rated.
-
class
RateableRateValidator(context)[source]¶ Bases:
objectValidator for rates about IRateable.
The following values are allowed:
- 1: pro
- 0: neutral
- -1: contra
Initialize self.
-
interface
ILikeable[source]¶ Extends:
adhocracy_core.sheets.rate.IRateableIRateable subclass that restricts the set of allowed values.
-
class
LikeableRateValidator(context)[source]¶ Bases:
adhocracy_core.sheets.rate.RateableRateValidatorValidator for rates about ILikeable.
The following values are allowed:
- 1: like
- 0: neutral/no vote
Initialize self.
-
interface
ICanRate[source]¶ Extends:
adhocracy_core.interfaces.ISheetMarker interface for resources that can rate.
-
interface
RateSubjectReference[source]¶ Extends:
adhocracy_core.interfaces.SheetToSheetReference from rate to rater.
-
interface
RateObjectReference[source]¶ Extends:
adhocracy_core.interfaces.SheetToSheetReference from rate to rated resource.
-
class
RateSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaRate sheet data structure.
-
preparer= <colander.deferred object>¶
-
-
create_validate_subject(request: <InterfaceClass pyramid.interfaces.IRequest>) → <built-in function callable>[source]¶ Create validator to ensure value[‘subject’] is current user.
-
create_validate_is_unique(context, request: <InterfaceClass pyramid.interfaces.IRequest>) → <built-in function callable>[source]¶ Create validatator to ensure rate version is unique.
Older rate versions with the same subject and object may occur. If they belong to a different rate item an error is thrown.
-
create_validate_rate_value(registry: pyramid.registry.Registry) → <built-in function callable>[source]¶ Create validator to validate value[‘rate’].
Ask the validator registered for object whether rate is valid. In this way, IRateable subclasses can modify the range of allowed ratings by registering their own IRateValidator adapter.
-
class
CanRateSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaCanRate sheet data structure.
-
class
RateableSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaCommentable sheet data structure.
post_pool: Pool to post new
adhocracy_sample.resource.IRate.