Ejemplo n.º 1
0
class LegacyGetUserUserSerializer(serializers.ModelSerializer):
    profile = GetUserUserProfileSerializer(many=False)
    followers_count = FollowersCountField()
    following_count = FollowingCountField()
    posts_count = UserPostsCountField()
    is_following = IsFollowingField()
    is_followed = IsFollowedField()
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField()
    is_connected = IsConnectedField()
    is_fully_connected = IsFullyConnectedField()
    connected_circles = ConnectedCirclesField(circle_serializer=GetUserUserCircleSerializer)
    follow_lists = FollowListsField(list_serializer=GetUserUserListSerializer)
    is_pending_connection_confirmation = IsPendingConnectionConfirmation()
    is_reported = IsUserReportedField()

    class Meta:
        model = User
        fields = (
            'id',
            'username',
            'profile',
            'followers_count',
            'following_count',
            'posts_count',
            'is_following',
            'is_followed',
            'are_new_post_notifications_enabled',
            'is_connected',
            'is_reported',
            'is_fully_connected',
            'connected_circles',
            'follow_lists',
            'date_joined',
            'is_pending_connection_confirmation'
        )
Ejemplo n.º 2
0
class SubscribeToUserNewPostNotificationsUserSerializer(serializers.ModelSerializer):
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField()

    class Meta:
        model = User
        fields = (
            'id',
            'are_new_post_notifications_enabled',
        )
Ejemplo n.º 3
0
class GetCommunityMembersMemberSerializer(serializers.ModelSerializer):
    profile = GetCommunityMembersMemberProfileSerializer(many=False)
    is_following = IsFollowingField()
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField(
    )
    is_connected = IsConnectedField()
    is_followed = IsFollowedField()

    class Meta:
        model = User
        fields = ('id', 'is_following', 'is_followed',
                  'are_new_post_notifications_enabled', 'is_connected',
                  'username', 'profile')
Ejemplo n.º 4
0
class GetBlockedUserSerializer(serializers.ModelSerializer):
    is_blocked = IsBlockedField()
    is_following = IsFollowingField()
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField()
    is_connected = IsConnectedField()
    is_fully_connected = IsFullyConnectedField()

    class Meta:
        model = User
        fields = (
            'id',
            'is_blocked',
            'is_following',
            'are_new_post_notifications_enabled',
            'is_connected',
            'is_fully_connected'
        )
Ejemplo n.º 5
0
class LinkedUsersUserSerializer(serializers.ModelSerializer):
    profile = LinkedUsersUserProfileSerializer(many=False)
    is_following = IsFollowingField()
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField(
    )
    is_connected = IsConnectedField()
    communities_memberships = CommunitiesMembershipsField(
        community_membership_serializer=
        GetLinkedUsersUserCommunityMembershipSerializer)
    communities_invites = CommunitiesInvitesField(
        community_invite_serializer=GetLinkedUsersUserCommunityInviteSerializer
    )

    class Meta:
        model = User
        fields = ('id', 'profile', 'username', 'is_following',
                  'are_new_post_notifications_enabled', 'is_connected',
                  'communities_invites', 'communities_memberships')
Ejemplo n.º 6
0
class ConnectionUserSerializer(serializers.ModelSerializer):
    profile = ConnectionUserProfileSerializer(many=False)
    is_connected = IsConnectedField()
    is_following = IsFollowingField()
    are_new_post_notifications_enabled = AreNewPostNotificationsEnabledForUserField()
    connected_circles = ConnectedCirclesField(circle_serializer=ConnectionUserCircleSerializer)
    is_pending_connection_confirmation = IsPendingConnectionConfirmation()
    is_fully_connected = IsFullyConnectedField()

    class Meta:
        model = User
        fields = (
            'id',
            'username',
            'profile',
            'is_connected',
            'is_fully_connected',
            'is_following',
            'are_new_post_notifications_enabled',
            'connected_circles',
            'is_pending_connection_confirmation'
        )