democrasite.webiscite.api.serializers module

class democrasite.webiscite.api.serializers.BillSerializer(*args, **kwargs)

Bases: HyperlinkedModelSerializer

get_user_supports(bill: Bill) bool | None

Return whether the user supports the bill. If the user is not authenticated or has not voted on this bill, return None.

Parameters:

bill – The bill to check

Returns:

Whether the user supports the bill, or None if not applicable

class democrasite.webiscite.api.serializers.PullRequestSerializer(*args, **kwargs)

Bases: ModelSerializer