updated(event): added link field in event
This commit is contained in:
@@ -144,6 +144,7 @@ class EventDetailSerializer(serializers.ModelSerializer):
|
||||
"key_guest",
|
||||
"coupon_code",
|
||||
"coupon_description",
|
||||
"link",
|
||||
"age_group",
|
||||
"images",
|
||||
"is_favorited",
|
||||
@@ -222,6 +223,7 @@ class CreateEventSerializer(serializers.ModelSerializer):
|
||||
"tags",
|
||||
"coupon_code",
|
||||
"coupon_description",
|
||||
"link"
|
||||
]
|
||||
|
||||
def validate_key_guest(self, value):
|
||||
|
||||
18
manage_events/migrations/0018_event_link.py
Normal file
18
manage_events/migrations/0018_event_link.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.2 on 2024-12-24 11:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manage_events', '0017_venue_postcode'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='event',
|
||||
name='link',
|
||||
field=models.URLField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
]
|
||||
@@ -125,6 +125,7 @@ class Event(BaseModel):
|
||||
social_media_shares_count = models.IntegerField(default=0)
|
||||
coupon_code = models.CharField(max_length=255, blank=True, null=True)
|
||||
coupon_description = models.TextField(blank=True, null=True)
|
||||
link = models.URLField(max_length=255, blank=True, null=True)
|
||||
|
||||
def increment_shares(self):
|
||||
self.social_media_shares_count += 1
|
||||
|
||||
Reference in New Issue
Block a user