forked from Kamva-Academy/Kamva-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:sepid-org/Manage-Content-Service in…
…to test-ci
- Loading branch information
Showing
39 changed files
with
588 additions
and
130 deletions.
There are no files selected for viewing
This file contains 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 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,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains 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 FileStorageConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'apps.file_storage' |
This file contains 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,22 @@ | ||
# Generated by Django 4.1.3 on 2024-04-18 17:31 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='File', | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)), | ||
('file', models.FileField(upload_to='files/')), | ||
], | ||
), | ||
] |
Empty file.
This file contains 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,11 @@ | ||
import uuid | ||
from django.db import models | ||
|
||
|
||
class File(models.Model): | ||
id = models.UUIDField(primary_key=True, unique=True, | ||
default=uuid.uuid4, editable=False) | ||
file = models.FileField(upload_to='files/') | ||
|
||
def __str__(self) -> str: | ||
return {self.name} |
This file contains 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,11 @@ | ||
from rest_framework import serializers | ||
|
||
from apps.file_storage.models import File | ||
|
||
|
||
class FileSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = File | ||
fields = ['id', 'file'] | ||
read_only_fields = ['id'] |
This file contains 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,11 @@ | ||
from rest_framework.routers import DefaultRouter | ||
|
||
from .views import FileViewSet | ||
|
||
router = DefaultRouter() | ||
|
||
router.register(r'file', FileViewSet, basename='file') | ||
|
||
urlpatterns = [] | ||
|
||
urlpatterns += router.urls |
This file contains 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,15 @@ | ||
|
||
from rest_framework.permissions import AllowAny | ||
from rest_framework import viewsets | ||
from rest_framework.parsers import MultiPartParser | ||
|
||
from apps.file_storage.models import File | ||
from apps.file_storage.serializers.file_serializer import FileSerializer | ||
|
||
|
||
class FileViewSet(viewsets.ModelViewSet): | ||
serializer_class = FileSerializer | ||
parser_classes = [MultiPartParser] | ||
queryset = File.objects.all() | ||
my_tags = ['file-storage'] | ||
permission_classes = [AllowAny] |
This file contains 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
11 changes: 11 additions & 0 deletions
11
apps/fsm/management/commands/convert_program_cover_page_to_url.py
This file contains 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,11 @@ | ||
from django.core.management.base import BaseCommand | ||
from apps.fsm.models import Event | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
def handle(self, *args, **options): | ||
for program in Event.objects.all(): | ||
if program.cover_page: | ||
program.cover_page2 = program.cover_page.url | ||
program.save() |
This file contains 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 4.1.3 on 2024-04-18 20:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0097_rename_game_iframe_alter_widget_widget_type'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='fsm', | ||
name='cover_page2', | ||
field=models.URLField(blank=True, null=True), | ||
), | ||
] |
This file contains 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,17 @@ | ||
# Generated by Django 4.1.3 on 2024-04-18 20:54 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0098_fsm_cover_page2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='fsm', | ||
name='cover_page', | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
apps/fsm/migrations/0100_rename_cover_page2_fsm_cover_page.py
This file contains 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 4.1.3 on 2024-04-18 20:54 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0099_remove_fsm_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='fsm', | ||
old_name='cover_page2', | ||
new_name='cover_page', | ||
), | ||
] |
This file contains 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 4.1.3 on 2024-04-18 21:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0100_rename_cover_page2_fsm_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='fsm', | ||
name='cover_page', | ||
field=models.URLField(default=''), | ||
), | ||
] |
This file contains 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 4.1.3 on 2024-04-18 21:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0101_alter_fsm_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='fsm', | ||
name='cover_page', | ||
field=models.URLField(), | ||
), | ||
] |
This file contains 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 4.1.3 on 2024-04-18 22:45 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0102_alter_fsm_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='fsm', | ||
name='is_visible', | ||
field=models.BooleanField(default=True), | ||
), | ||
] |
40 changes: 40 additions & 0 deletions
40
apps/fsm/migrations/0104_remove_article_party_remove_event_party_and_more.py
This file contains 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,40 @@ | ||
# Generated by Django 4.1.3 on 2024-04-21 13:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0103_fsm_is_visible'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='article', | ||
name='party', | ||
), | ||
migrations.RemoveField( | ||
model_name='event', | ||
name='party', | ||
), | ||
migrations.RemoveField( | ||
model_name='fsm', | ||
name='party', | ||
), | ||
migrations.AddField( | ||
model_name='article', | ||
name='website', | ||
field=models.CharField(blank=True, max_length=50, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='event', | ||
name='website', | ||
field=models.CharField(blank=True, max_length=50, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='fsm', | ||
name='website', | ||
field=models.CharField(blank=True, max_length=50, null=True), | ||
), | ||
] |
This file contains 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 4.1.3 on 2024-04-28 18:11 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0104_remove_article_party_remove_event_party_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='event', | ||
name='cover_page2', | ||
field=models.URLField(blank=True, null=True), | ||
), | ||
] |
This file contains 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,17 @@ | ||
# Generated by Django 4.1.3 on 2024-04-28 18:27 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0105_event_cover_page2'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='event', | ||
name='cover_page', | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
apps/fsm/migrations/0107_rename_cover_page2_event_cover_page.py
This file contains 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 4.1.3 on 2024-04-28 18:27 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0106_remove_event_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='event', | ||
old_name='cover_page2', | ||
new_name='cover_page', | ||
), | ||
] |
This file contains 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 4.1.3 on 2024-04-29 14:26 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0107_rename_cover_page2_event_cover_page'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='event', | ||
name='is_visible', | ||
field=models.BooleanField(default=True), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
apps/fsm/migrations/0109_remove_programcontactinfo_name_and_more.py
This file contains 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 4.1.3 on 2024-04-29 17:47 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fsm', '0108_event_is_visible'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='programcontactinfo', | ||
name='name', | ||
), | ||
migrations.AlterField( | ||
model_name='event', | ||
name='program_contact_info', | ||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='program', to='fsm.programcontactinfo'), | ||
), | ||
] |
Oops, something went wrong.