0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/ee/api/ee_property_definition.py
Paul D'Ambra 5f7d3c566d
Deprecates property_type_format (#8292)
* remove property_type_format concept

* remove nulls from tests

* deprecate not remove (and see what tests fail)

* plugin server tests care about property_type_format

* fix tests
2022-02-01 14:08:55 +00:00

29 lines
964 B
Python

from rest_framework import serializers
from ee.models.property_definition import EnterprisePropertyDefinition
from posthog.api.shared import UserBasicSerializer
class EnterprisePropertyDefinitionSerializer(serializers.ModelSerializer):
updated_by = UserBasicSerializer(read_only=True)
class Meta:
model = EnterprisePropertyDefinition
fields = (
"id",
"name",
"description",
"tags",
"is_numerical",
"updated_at",
"updated_by",
"query_usage_30_day",
"is_event_property",
"property_type",
)
read_only_fields = ["id", "name", "is_numerical", "query_usage_30_day", "is_event_property"]
def update(self, event_definition: EnterprisePropertyDefinition, validated_data):
validated_data["updated_by"] = self.context["request"].user
return super().update(event_definition, validated_data)