Serializers

firm_info.serializers.serialize_firm_info(queryset)[source]

Serializes the firm information from a queryset.

Parameters:

queryset – The queryset containing the firm information.

Returns:

the serialized firm information with the following keys:

  • ”email”: The email address of the firm.

  • ”phone”: The phone number of the firm.

  • ”full_address”: The formatted full address of the firm.

  • ”address”: The address of the firm.

  • ”postal_code”: The postal code of the firm.

  • ”city”: The city of the firm.

  • ”country”: The country of the firm.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_social(queryset)[source]

Serializes the firm social media information from a queryset.

Parameters:

queryset – The queryset containing the firm social media information.

Returns:

The serialized firm social media information with the social media names as keys and their corresponding URLs as values.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_description(queryset)[source]

Serializes the firm description from a queryset.

Parameters:

queryset – The queryset containing the firm description.

Returns:

The serialized firm description with the following keys:

  • ”baseline”: The baseline of the firm.

  • ”short_description”: The short description of the firm.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_social_sharing(obj)[source]

Serialize Firm social networks sharing URLs.

Parameters:

obj (QuerySet) – The SocialSharing queryset.

Returns:

The serialized data with the following keys:

  • og_image (SmartMediaField): The OG image for social media sharing.

  • og_description (TextField): The OG description for social media sharing.

  • og_twitter_site (CharField): The OG Twitter site for social media sharing.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_apps_banner(obj)[source]

Serializes an instance of the AppsBanner model into a dictionary.

Parameters:

obj – The AppsBanner object to be serialized.

Returns:

The serialized data with the following keys:

  • ”title”: The title of the AppsBanner.

  • ”description”: The description of the AppsBanner.

  • ”image”: The image associated with the AppsBanner.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_logos(obj)[source]

Serializes logo information from a FirmContact instance.

Parameters:

firm_instance (FirmContact) – An instance of FirmContact containing logos.

Returns:

A dictionary with logo details suitable for rendering in templates.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.

firm_info.serializers.serialize_firm_complete_info(queryset)[source]

Serializes complete firm information from a FirmContact instance.

Parameters:

firm_instance (FirmContact) – An instance of FirmContact.

Returns:

The serialized complete firm information, including logos and descriptions.

Return type:

dict

Raises:

SerializeFirmError – Raised when an error occurs during serialization.