-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add model and form to create and edit exhibitors #9128
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
Open
Shivangi-ch
wants to merge
5
commits into
fossasia:dev-v3
Choose a base branch
from
Shivangi-ch:exhibitors_model_and_form
base: dev-v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c666c02
add event and related models
Shivangi-ch c277072
alter DiscountCode.code type
Shivangi-ch 8f3fc69
added model and form for exhibitors
Shivangi-ch 7b84b72
added event_id
Shivangi-ch 3ce5581
merged migration files + formatted code with ruff
Shivangi-ch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.0 on 2024-03-13 19:20 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('event_topics', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
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')), | ||
], | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django import forms | ||
from events.models import Exhibitors | ||
|
||
class ExhibitorForm(forms.ModelForm): | ||
class Meta: | ||
model = Exhibitor | ||
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'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
# Generated by Django 5.0 on 2024-03-13 19:20 | ||
|
||
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): | ||
|
||
initial = True | ||
|
||
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'), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.0 on 2024-03-13 19:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('events', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='discountcode', | ||
name='code', | ||
field=models.TextField(max_length=200, null=True), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 5.0 on 2024-03-18 11:27 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('events', '0002_alter_discountcode_code'), | ||
] | ||
|
||
operations = [ | ||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You
name
field is defined asnull=True
, soself.name
can beNone
. It is illegal for__str__
(must always be string).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I have added the suggested changes. Pls review.