caselawclient.models.identifiers.press_summary_ncn

 1from caselawclient.types import DocumentIdentifierSlug
 2
 3from .neutral_citation import NeutralCitationNumber, NeutralCitationNumberSchema
 4
 5
 6class PressSummaryRelatedNCNIdentifierSchema(NeutralCitationNumberSchema):
 7    """
 8    Identifier schema for relating a Press Summary to a Judgment with a given NCN
 9    """
10
11    name = "Press Summary relates to NCN"
12    namespace = "uksummaryofncn"
13    human_readable = True
14    base_score_multiplier = 0.8
15
16    document_types = ["PressSummary"]
17
18    @classmethod
19    def compile_identifier_url_slug(cls, value: str) -> DocumentIdentifierSlug:
20        return DocumentIdentifierSlug(super().compile_identifier_url_slug(value) + "/press-summary")
21
22
23class PressSummaryRelatedNCNIdentifier(NeutralCitationNumber):
24    schema = PressSummaryRelatedNCNIdentifierSchema
class PressSummaryRelatedNCNIdentifierSchema(caselawclient.models.identifiers.neutral_citation.NeutralCitationNumberSchema):
 7class PressSummaryRelatedNCNIdentifierSchema(NeutralCitationNumberSchema):
 8    """
 9    Identifier schema for relating a Press Summary to a Judgment with a given NCN
10    """
11
12    name = "Press Summary relates to NCN"
13    namespace = "uksummaryofncn"
14    human_readable = True
15    base_score_multiplier = 0.8
16
17    document_types = ["PressSummary"]
18
19    @classmethod
20    def compile_identifier_url_slug(cls, value: str) -> DocumentIdentifierSlug:
21        return DocumentIdentifierSlug(super().compile_identifier_url_slug(value) + "/press-summary")

Identifier schema for relating a Press Summary to a Judgment with a given NCN

name = 'Press Summary relates to NCN'
namespace = 'uksummaryofncn'
human_readable = True

Should this identifier type be considered for display as a 'human readable' identifier?

base_score_multiplier = 0.8

A multiplier used to adjust the relative ranking of this identifier when calculating preferred identifiers.

document_types = ['PressSummary']

If present, a list of the names of document classes which can have this identifier.

If None, this identifier is valid for all document types.

@classmethod
def compile_identifier_url_slug(cls, value: str) -> caselawclient.types.DocumentIdentifierSlug:
19    @classmethod
20    def compile_identifier_url_slug(cls, value: str) -> DocumentIdentifierSlug:
21        return DocumentIdentifierSlug(super().compile_identifier_url_slug(value) + "/press-summary")

Convert an identifier into a precompiled URL slug.

class PressSummaryRelatedNCNIdentifier(caselawclient.models.identifiers.neutral_citation.NeutralCitationNumber):
24class PressSummaryRelatedNCNIdentifier(NeutralCitationNumber):
25    schema = PressSummaryRelatedNCNIdentifierSchema

A base class for subclasses representing a concrete identifier.