membership / change db structure

This commit is contained in:
2025-05-30 13:04:54 +03:00
parent 296457ee99
commit dc09349cb6
9 changed files with 225 additions and 94 deletions

View File

@@ -227,10 +227,10 @@ class PricingSerializer(serializers.ModelSerializer):
class Meta:
model = Pricing
fields = ['plan', 'price', 'features', 'isPopular']
fields = ['plan', 'price', 'features', 'isPopular', 'duration', 'duration_hours']
def get_features(self, obj):
return list(obj.membershipfeatures_set.values_list('feature', flat=True))
return list(obj.features.values_list('name', flat=True))
def to_representation(self, instance):
# преобразуем данные перед отправкой на фронтенд