示例#1
0
    ContractTypeBase, ContractBase, ContractPartnerBase)

from lino_welfare.modlib.pcsw.choicelists import (
    ClientEvents, ObservedEvent, has_contracts_filter)


class ClientHasContract(ObservedEvent):
    text = _("Immersion training")

    def add_filter(self, qs, pv):
        period = (pv.start_date, pv.end_date)
        flt = has_contracts_filter('immersion_contract_set_by_client', period)
        qs = qs.filter(flt).distinct()
        return qs

ClientEvents.add_item_instance(ClientHasContract("immersion"))


class ContractType(ContractTypeBase):
    """Every *immersion training* has a mandatory field
    :attr:`Contract.type` which points to this.  The **immersion
    training type** defines certain properties of the immersion
    trainings that use it.

    .. attribute:: name

        Translatable description.

    .. attribute:: template

        See :attr:`lino_welfare.modlib.isip.mixins.ContractTypeBase.template`
示例#2
0
from .choicelists import Subsidizations

from lino_welfare.modlib.pcsw.choicelists import (
    ClientEvents, ObservedEvent, has_contracts_filter)


class ClientHasContract(ObservedEvent):
    text = _("Art61 job supplyment")

    def add_filter(self, qs, pv):
        period = (pv.start_date, pv.end_date)
        flt = has_contracts_filter('art61_contract_set_by_client', period)
        qs = qs.filter(flt).distinct()
        return qs

ClientEvents.add_item_instance(ClientHasContract("art61"))


class ContractType(ContractTypeBase, mixins.Referrable):

    """This is the homologue of :class:`isip.ContractType
    <lino_welfare.modlib.isip.models.ContractType>` (see there for
    general documentation).
    
    The demo database comes with these contract types:

    .. django2rst::

        rt.show('art61.ContractTypes')

    """
示例#3
0
        #     # flt |= Q(experience__start_date__gte=pv.start_date)
        #     qs = qs.filter(flt)
        # else:
        #     flt = Q(training__start_date__isnull=False)
        #     flt |= Q(study__start_date__isnull=False)
        #     flt |= Q(experience__start_date__isnull=False)
        #     qs = qs.filter(flt)

        # if pv.end_date:
        #     flt = Q(training__end_date__lte=pv.end_date)
        #     flt |= Q(study__end_date__lte=pv.end_date)
        #     flt |= Q(experience__end_date__lte=pv.end_date)
        #     qs = qs.filter(flt)
        return qs

ClientEvents.add_item_instance(ClientIsLearning("learning"))


LanguageKnowledgesByPerson.column_names = "language native spoken \
written spoken_passively written_passively *"


class Proof(mixins.BabelNamed):
    """A **proof** is some document which certifies that a given person
    has a given skill."""
    class Meta:
        verbose_name = _("Skill proof")
        verbose_name_plural = _("Skill proofs")


class Proofs(dd.Table):
示例#4
0

from lino_welfare.modlib.pcsw.choicelists import ClientEvents, ObservedEvent, has_contracts_filter


class ClientHasContract(ObservedEvent):
    text = _("Art60§7 job supplyment")

    def add_filter(self, qs, pv):
        period = (pv.start_date, pv.end_date)
        flt = has_contracts_filter("jobs_contract_set_by_client", period)
        qs = qs.filter(flt).distinct()
        return qs


ClientEvents.add_item_instance(ClientHasContract("jobs", "jobs"))


class Schedule(mixins.BabelNamed):

    """List of choices for `jobs.Contract.schedule` field."""

    class Meta:
        verbose_name = _("Work Schedule")
        verbose_name_plural = _("Work Schedules")


class Schedules(dd.Table):
    required_roles = dd.required(SocialStaff)
    model = "jobs.Schedule"
    order_by = ["name"]
示例#5
0
    ClientEvents, ObservedEvent, has_contracts_filter)

from lino_welfare.modlib.pcsw.roles import SocialStaff, SocialAgent
from lino_welfare.modlib.integ.roles import IntegrationAgent


class ClientHasContract(ObservedEvent):
    text = config.verbose_name

    def add_filter(self, qs, pv):
        period = (pv.start_date, pv.end_date)
        flt = has_contracts_filter('isip_contract_set_by_client', period)
        qs = qs.filter(flt).distinct()
        return qs

ClientEvents.add_item_instance(ClientHasContract("isip"))


COACHINGTYPE_ASD = 1
COACHINGTYPE_DSBE = 2


class ContractType(ContractTypeBase):
    """The type of an :class:`isip.Contract <Class>`.

    .. attribute:: needs_study_type

        Whether contracts of this type need their :attr:`study_type`
        field filled in.

    """