Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model and form to create and edit exhibitors #9128

Open
wants to merge 5 commits into
base: dev-v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions event_topics/migrations/0001_initial.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 5.0 on 2024-04-14 17:52

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

replaces = [('event_topics', '0001_initial'), ('event_topics', '0002_eventsubtopic')]

dependencies = [
]

operations = [
migrations.CreateModel(
name='EventTopic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=200, null=True)),
('slug', models.CharField(max_length=200)),
('system_image_url', models.URLField(blank=True, null=True)),
('deleted_at', models.DateTimeField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='EventSubTopic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, null=True)),
('slug', models.CharField(max_length=200, null=True)),
('event_topic_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='event_topics.eventtopic')),
],
),
]
11 changes: 10 additions & 1 deletion event_topics/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ class EventTopic(models.Model):
deleted_at = models.DateTimeField(null=True, blank=True)

def __str__(self):
return self.name
return f"{self.name}"


class EventSubTopic(models.Model):
name = models.CharField(max_length=200, null=True)
slug = models.CharField(max_length=200, null=True)
event_topic_id = models.ForeignKey(EventTopic, on_delete=models.CASCADE, null=True)

def __str__(self):
return f"{self.name}"
Empty file added events/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions events/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin
from .models import Event, EventType, DiscountCode, Group, Exhibitors

admin.site.register(Event)
admin.site.register(EventType)
admin.site.register(DiscountCode)
admin.site.register(Group)
admin.site.register(Exhibitors)
6 changes: 6 additions & 0 deletions events/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class EventsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "events"
21 changes: 21 additions & 0 deletions events/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django import forms
from events.models import Exhibitors


class ExhibitorForm(forms.ModelForm):
class Meta:
model = Exhibitors
fields = [
"name",
"description",
"url",
"position",
"event_id" "logo_url",
"banner_url",
"video_url",
"slides_url",
"contact_email",
"contact_link",
"enable_video_room",
"thumbnail_image_url",
]
192 changes: 192 additions & 0 deletions events/migrations/0001_initial_squashed_0003_exhibitors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Generated by Django 5.0 on 2024-04-14 17:58

import django.contrib.postgres.fields.citext
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

replaces = [('events', '0001_initial'), ('events', '0002_alter_discountcode_code'), ('events', '0003_exhibitors')]

dependencies = [
('event_topics', '0002_eventsubtopic'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='EventType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, null=True)),
('slug', models.CharField(max_length=200, null=True)),
('deleted_at', models.DateTimeField(null=True)),
],
),
migrations.CreateModel(
name='DiscountCode',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', django.contrib.postgres.fields.citext.CITextField(max_length=200, null=True)),
('value', models.FloatField(null=True)),
('type', models.CharField(max_length=200, null=True)),
('is_active', models.BooleanField(null=True)),
('tickets_number', models.IntegerField(null=True)),
('min_quantity', models.IntegerField(null=True)),
('max_quantity', models.IntegerField(null=True)),
('valid_from', models.DateTimeField(null=True)),
('valid_till', models.DateTimeField(null=True)),
('created_at', models.DateTimeField(null=True)),
('used_for', models.CharField(max_length=200, null=True)),
('discount_url', models.CharField(max_length=200, null=True)),
('deleted_at', models.DateTimeField(null=True)),
('marketer_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Event',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('identifier', models.CharField(max_length=8)),
('name', models.CharField(max_length=255)),
('external_event_url', models.URLField(blank=True, null=True)),
('logo_url', models.URLField(blank=True, null=True)),
('starts_at', models.DateTimeField()),
('ends_at', models.DateTimeField()),
('timezone', models.CharField(default='UTC', max_length=50)),
('online', models.BooleanField(default=False)),
('latitude', models.FloatField(blank=True, null=True)),
('longitude', models.FloatField(blank=True, null=True)),
('location_name', models.CharField(blank=True, max_length=255, null=True)),
('searchable_location_name', models.CharField(blank=True, max_length=255, null=True)),
('public_stream_link', models.CharField(blank=True, max_length=255, null=True)),
('stream_loop', models.BooleanField(default=False)),
('stream_autoplay', models.BooleanField(default=False)),
('is_featured', models.BooleanField(default=False)),
('is_promoted', models.BooleanField(default=False)),
('is_demoted', models.BooleanField(default=False)),
('is_chat_enabled', models.BooleanField(default=False)),
('is_videoroom_enabled', models.BooleanField(default=False)),
('is_document_enabled', models.BooleanField(default=False)),
('document_links', models.JSONField(blank=True, null=True)),
('chat_room_id', models.CharField(blank=True, max_length=255, null=True)),
('description', models.TextField(blank=True, null=True)),
('after_order_message', models.TextField(blank=True, null=True)),
('original_image_url', models.URLField(blank=True, null=True)),
('thumbnail_image_url', models.URLField(blank=True, null=True)),
('large_image_url', models.URLField(blank=True, null=True)),
('show_remaining_tickets', models.BooleanField(default=False)),
('icon_image_url', models.URLField(blank=True, null=True)),
('owner_name', models.CharField(blank=True, max_length=255, null=True)),
('is_map_shown', models.BooleanField(default=False)),
('is_oneclick_signup_enabled', models.BooleanField(default=False)),
('has_owner_info', models.BooleanField(default=False)),
('owner_description', models.CharField(blank=True, max_length=255, null=True)),
('is_sessions_speakers_enabled', models.BooleanField(default=False)),
('is_cfs_enabled', models.BooleanField(default=False)),
('privacy', models.CharField(default='public', max_length=10)),
('state', models.CharField(default='draft', max_length=10)),
('is_announced', models.BooleanField(default=False)),
('ticket_url', models.CharField(blank=True, max_length=255, null=True)),
('code_of_conduct', models.CharField(blank=True, max_length=255, null=True)),
('schedule_published_on', models.DateTimeField(blank=True, null=True)),
('is_ticketing_enabled', models.BooleanField(default=False)),
('is_donation_enabled', models.BooleanField(default=False)),
('is_ticket_form_enabled', models.BooleanField(default=True)),
('is_badges_enabled', models.BooleanField(default=False)),
('payment_country', models.CharField(blank=True, max_length=100, null=True)),
('payment_currency', models.CharField(blank=True, max_length=100, null=True)),
('paypal_email', models.CharField(blank=True, max_length=255, null=True)),
('is_tax_enabled', models.BooleanField(default=False)),
('is_billing_info_mandatory', models.BooleanField(default=False)),
('can_pay_by_paypal', models.BooleanField(default=False)),
('can_pay_by_stripe', models.BooleanField(default=False)),
('can_pay_by_cheque', models.BooleanField(default=False)),
('can_pay_by_bank', models.BooleanField(default=False)),
('can_pay_by_invoice', models.BooleanField(default=False)),
('can_pay_by_onsite', models.BooleanField(default=False)),
('can_pay_by_omise', models.BooleanField(default=False)),
('can_pay_by_alipay', models.BooleanField(default=False)),
('can_pay_by_paytm', models.BooleanField(default=False)),
('cheque_details', models.CharField(blank=True, max_length=255, null=True)),
('bank_details', models.CharField(blank=True, max_length=255, null=True)),
('onsite_details', models.CharField(blank=True, max_length=255, null=True)),
('invoice_details', models.CharField(blank=True, max_length=255, null=True)),
('created_at', models.DateTimeField(null=True)),
('pentabarf_url', models.CharField(blank=True, max_length=255, null=True)),
('ical_url', models.CharField(blank=True, max_length=255, null=True)),
('xcal_url', models.CharField(blank=True, max_length=255, null=True)),
('is_sponsors_enabled', models.BooleanField(default=False)),
('refund_policy', models.CharField(blank=True, max_length=255, null=True)),
('is_stripe_linked', models.BooleanField(default=False)),
('completed_order_sales', models.IntegerField(default=0)),
('placed_order_sales', models.IntegerField(default=0)),
('pending_order_sales', models.IntegerField(default=0)),
('completed_order_tickets', models.IntegerField(default=0)),
('placed_order_tickets', models.IntegerField(default=0)),
('pending_order_tickets', models.IntegerField(default=0)),
('discount_code_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='events.discountcode')),
('event_sub_topic_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='event_topics.eventsubtopic')),
('event_topic_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='event_topics.eventtopic')),
('event_type_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='events.eventtype')),
],
),
migrations.AddField(
model_name='discountcode',
name='event_id',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='events.event'),
),
migrations.CreateModel(
name='Group',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, null=True)),
('created_at', models.DateTimeField(null=True)),
('modified_at', models.DateTimeField(null=True)),
('social_links', models.JSONField(null=True)),
('about', models.TextField(null=True)),
('banner_url', models.CharField(max_length=200, null=True)),
('logo_url', models.CharField(max_length=200, null=True)),
('deleted_at', models.DateTimeField(null=True)),
('follower_count', models.IntegerField(default=0)),
('thumbnail_image_url', models.URLField(blank=True, null=True)),
('is_promoted', models.BooleanField(default=False)),
('user_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='event',
name='group_id',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='events.group'),
),
migrations.AlterField(
model_name='discountcode',
name='code',
field=models.TextField(max_length=200, null=True),
),
migrations.CreateModel(
name='Exhibitors',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=200, null=True)),
('description', models.CharField(blank=True, max_length=200, null=True)),
('url', models.CharField(blank=True, max_length=200, null=True)),
('position', models.IntegerField(default=0)),
('logo_url', models.CharField(blank=True, max_length=200, null=True)),
('banner_url', models.CharField(blank=True, max_length=200, null=True)),
('video_url', models.CharField(blank=True, max_length=200, null=True)),
('slides_url', models.URLField(blank=True, null=True)),
('social_links', models.JSONField(blank=True, null=True)),
('status', models.CharField(blank=True, default='pending', max_length=2147483647, null=True)),
('contact_email', models.EmailField(blank=True, max_length=254, null=True)),
('contact_link', models.URLField(blank=True, null=True)),
('enable_video_room', models.BooleanField(default=False)),
('thumbnail_image_url', models.URLField(blank=True, null=True)),
('event', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='events.event')),
],
),
]
Empty file added events/migrations/__init__.py
Empty file.
Loading