Beispiel #1
0
class JoblistingDetailedSerializer(BasisModelSerializer):
    workplaces = WorkplaceSerializer(many=True)
    company = CompanyField(queryset=Company.objects.all())
    responsible = CompanyContactField(queryset=CompanyContact.objects.all())
    text = ContentSerializerField()

    class Meta:
        model = Joblisting
        fields = (
            "id",
            "title",
            "text",
            "company",
            "responsible",
            "contact_mail",
            "description",
            "deadline",
            "job_type",
            "workplaces",
            "visible_from",
            "visible_to",
            "from_year",
            "to_year",
            "application_url",
            "youtube_url",
            "created_at",
        )
Beispiel #2
0
class EventReadDetailedSerializer(TagSerializerMixin, BasisModelSerializer):
    comments = CommentSerializer(read_only=True, many=True)
    comment_target = CharField(read_only=True)
    cover = ImageField(required=False, options={'height': 500})
    company = CompanyField(queryset=Company.objects.all())
    responsible_group = AbakusGroupField(queryset=AbakusGroup.objects.all(),
                                         required=False,
                                         allow_null=True)
    pools = PoolReadSerializer(many=True)
    active_capacity = serializers.ReadOnlyField()
    text = ContentSerializerField()
    created_by = PublicUserSerializer()

    class Meta:
        model = Event
        fields = ('id', 'title', 'description', 'cover', 'text', 'event_type',
                  'location', 'comments', 'comment_target', 'start_time',
                  'end_time', 'merge_time', 'pools', 'unregistration_deadline',
                  'company', 'responsible_group', 'active_capacity',
                  'feedback_description', 'feedback_required', 'is_priced',
                  'price_member', 'price_guest', 'use_stripe',
                  'payment_due_date', 'use_captcha',
                  'waiting_registration_count', 'tags', 'is_merged',
                  'heed_penalties', 'created_by', 'is_abakom_only',
                  'registration_count', 'survey')
        read_only = True
Beispiel #3
0
class EventReadSerializer(TagSerializerMixin, BasisModelSerializer):
    company = CompanyField(queryset=Company.objects.all())
    cover = ImageField(required=False, options={"height": 500})
    thumbnail = ImageField(
        source="cover",
        required=False,
        options={
            "height": 500,
            "width": 500,
            "smart": True
        },
    )

    class Meta:
        model = Event
        fields = (
            "id",
            "title",
            "description",
            "cover",
            "event_type",
            "location",
            "start_time",
            "thumbnail",
            "total_capacity",
            "company",
            "registration_count",
            "tags",
        )
        read_only = True
Beispiel #4
0
class EventReadDetailedSerializer(TagSerializerMixin, BasisModelSerializer):
    comments = CommentSerializer(read_only=True, many=True)
    content_target = CharField(read_only=True)
    cover = ImageField(required=False, options={"height": 500})
    company = CompanyField(queryset=Company.objects.all())
    responsible_group = AbakusGroupField(queryset=AbakusGroup.objects.all(),
                                         required=False,
                                         allow_null=True)
    pools = PoolReadSerializer(many=True)
    active_capacity = serializers.ReadOnlyField()
    text = ContentSerializerField()
    created_by = PublicUserSerializer()

    registration_close_time = serializers.DateTimeField(read_only=True)

    class Meta:
        model = Event
        fields = (
            "id",
            "title",
            "description",
            "cover",
            "text",
            "event_type",
            "event_status_type",
            "location",
            "comments",
            "content_target",
            "start_time",
            "end_time",
            "merge_time",
            "pools",
            "registration_close_time",
            "registration_deadline_hours",
            "unregistration_deadline",
            "company",
            "responsible_group",
            "active_capacity",
            "feedback_description",
            "feedback_required",
            "is_priced",
            "price_member",
            "price_guest",
            "use_stripe",
            "payment_due_date",
            "use_captcha",
            "waiting_registration_count",
            "tags",
            "is_merged",
            "heed_penalties",
            "created_by",
            "is_abakom_only",
            "registration_count",
            "survey",
            "use_consent",
            "youtube_url",
        )
        read_only = True
Beispiel #5
0
class JoblistingSerializer(BasisModelSerializer):
    workplaces = WorkplaceSerializer(many=True)
    company = CompanyField(queryset=Company.objects.all())

    class Meta:
        model = Joblisting
        fields = (
            'id', 'title', 'company', 'deadline', 'job_type', 'workplaces', 'from_year', 'to_year'
        )
Beispiel #6
0
class JoblistingDetailedSerializer(BasisModelSerializer):
    workplaces = WorkplaceSerializer(many=True)
    company = CompanyField(queryset=Company.objects.all())
    responsible = CompanyContactField(queryset=CompanyContact.objects.all())
    text = ContentSerializerField()

    class Meta:
        model = Joblisting
        fields = (
            'id', 'title', 'text', 'company', 'responsible', 'contact_mail', 'description',
            'deadline', 'job_type', 'workplaces', 'visible_from', 'visible_to', 'from_year',
            'to_year', 'application_url'
        )
Beispiel #7
0
class JoblistingSerializer(BasisModelSerializer):
    workplaces = WorkplaceSerializer(many=True)
    company = CompanyField(queryset=Company.objects.all())

    class Meta:
        model = Joblisting
        fields = (
            "id",
            "title",
            "company",
            "deadline",
            "job_type",
            "workplaces",
            "from_year",
            "to_year",
        )
Beispiel #8
0
class EventReadSerializer(TagSerializerMixin, BasisModelSerializer):
    company = CompanyField(queryset=Company.objects.all())
    cover = ImageField(required=False, options={'height': 500})
    thumbnail = ImageField(source='cover',
                           required=False,
                           options={
                               'height': 500,
                               'width': 500,
                               'smart': True
                           })

    class Meta:
        model = Event
        fields = ('id', 'title', 'description', 'cover', 'event_type',
                  'location', 'start_time', 'thumbnail', 'total_capacity',
                  'company', 'registration_count', 'tags')
        read_only = True