mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
6f6b126f22
* split up files and organize code * set up definition drawer and logic and add tagging * add change owner selection * definition description editing working * definition drawer graph and events table * remove graph logic for now * small fixes * property definition doesn't have an owner * minor tweaks * lots of small fixes * show tags on table, disable editing for posthog events, fix tags autocomplete * fix font sizes and alignment * allow event limiting and hide behind feature flag again * linter things * test fix * lint * clean up events limit * limitOffsetPagination in events * ignore type Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
27 lines
881 B
Python
27 lines
881 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",
|
|
)
|
|
read_only_fields = ["id", "name", "is_numerical", "query_usage_30_day"]
|
|
|
|
def update(self, event_definition: EnterprisePropertyDefinition, validated_data):
|
|
validated_data["updated_by"] = self.context["request"].user
|
|
return super().update(event_definition, validated_data)
|