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

Events API #628 #760

Closed
wants to merge 2 commits into from
Closed
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
85 changes: 85 additions & 0 deletions backend/authentication/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Generated by Django 4.2.10 on 2024-03-06 01:55

import django.contrib.auth.models
import django.contrib.auth.validators
import django.contrib.postgres.fields
from django.db import migrations, models
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
('deletion_date', models.DateTimeField(blank=True, null=True, verbose_name='Deletion date')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('user_name', models.CharField(max_length=255)),
('name', models.CharField(blank=True, max_length=255)),
('password', models.CharField(max_length=255)),
('description', models.TextField(max_length=500)),
('verified', models.BooleanField(default=False)),
('verification_method', models.CharField(blank=True, max_length=30)),
('social_accounts', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, null=True, size=None)),
('total_flags', models.IntegerField(default=0)),
('private', models.BooleanField(default=False)),
('high_risk', models.BooleanField(default=False)),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Support',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='SupportEntityType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
],
),
migrations.CreateModel(
name='UserResource',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='UserTask',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='UserTopic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
]
90 changes: 90 additions & 0 deletions backend/authentication/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Generated by Django 4.2.10 on 2024-03-06 01:55

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


class Migration(migrations.Migration):

initial = True

dependencies = [
('content', '0002_initial'),
('entities', '0001_initial'),
('auth', '0012_alter_user_first_name_max_length'),
('authentication', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='usertopic',
name='topic_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.topic'),
),
migrations.AddField(
model_name='usertopic',
name='user_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='usertask',
name='task_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.task'),
),
migrations.AddField(
model_name='usertask',
name='user_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='userresource',
name='resource_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.resource'),
),
migrations.AddField(
model_name='userresource',
name='user_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='support',
name='supported_entity',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='supported', to='entities.organization'),
),
migrations.AddField(
model_name='support',
name='supported_type',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='supported', to='authentication.supportentitytype'),
),
migrations.AddField(
model_name='support',
name='supporter_entity',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='supporter', to='entities.organization'),
),
migrations.AddField(
model_name='support',
name='supporter_type',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='supporter', to='authentication.supportentitytype'),
),
migrations.AddField(
model_name='user',
name='groups',
field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups'),
),
migrations.AddField(
model_name='user',
name='user_icon',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='content.image'),
),
migrations.AddField(
model_name='user',
name='user_permissions',
field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions'),
),
migrations.AddField(
model_name='user',
name='verification_partner',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
]
1 change: 1 addition & 0 deletions backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.urls import include, path
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
Expand Down
87 changes: 87 additions & 0 deletions backend/content/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Generated by Django 4.2.10 on 2024-03-06 01:55

import django.contrib.postgres.fields
from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Faq',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('question', models.TextField(max_length=500)),
('answer', models.TextField(max_length=500)),
('last_updated', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Image',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('image_location', models.ImageField(upload_to='images/')),
('creation_date', models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='Resource',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('description', models.TextField(max_length=500)),
('topics', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None)),
('category', models.CharField(blank=True, max_length=255)),
('url', models.URLField(max_length=255)),
('total_flags', models.IntegerField(default=0)),
('private', models.BooleanField(default=True)),
('creation_date', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='ResourceTopic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='Task',
fields=[
('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
('deletion_date', models.DateTimeField(blank=True, null=True, verbose_name='Deletion date')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('description', models.TextField(max_length=500)),
('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, null=True, size=None)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Topic',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('active', models.BooleanField(default=True)),
('description', models.TextField(max_length=500)),
('creation_date', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(auto_now=True)),
('deprecation_date', models.DateTimeField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='TopicFormat',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
]
50 changes: 50 additions & 0 deletions backend/content/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Generated by Django 4.2.10 on 2024-03-06 01:55

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


class Migration(migrations.Migration):

initial = True

dependencies = [
('entities', '0001_initial'),
('events', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('content', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='topicformat',
name='format_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.format'),
),
migrations.AddField(
model_name='topicformat',
name='topic_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.topic'),
),
migrations.AddField(
model_name='resourcetopic',
name='resource_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.resource'),
),
migrations.AddField(
model_name='resourcetopic',
name='topic_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.topic'),
),
migrations.AddField(
model_name='resource',
name='created_by',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='faq',
name='org_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='entities.organization'),
),
]
48 changes: 48 additions & 0 deletions backend/content/migrations/0003_tag_resourcetag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 4.2.10 on 2024-03-13 18:32

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


class Migration(migrations.Migration):
dependencies = [
("content", "0002_initial"),
]

operations = [
migrations.CreateModel(
name="Tag",
fields=[
("id", models.IntegerField(primary_key=True, serialize=False)),
("text", models.CharField(max_length=255)),
("creation_date", models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name="ResourceTag",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"resource_id",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="content.resource",
),
),
(
"tag_id",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="content.tag"
),
),
],
),
]
Loading
Loading