-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
210 additions
and
39 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
from django.contrib import admin | ||
from .models import Image | ||
from .models import * | ||
|
||
# Register your models here. | ||
|
||
admin.site.register(Image) | ||
admin.site.register(Apply_Image) | ||
admin.site.register(Introduce_Image) | ||
admin.site.register(Login_Image) | ||
admin.site.register(Main_Image) | ||
admin.site.register(NotAllow_Image) | ||
admin.site.register(Result_Image) |
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.5 on 2024-02-17 15:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('image', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='image', | ||
name='image', | ||
field=models.ImageField(upload_to='media'), | ||
), | ||
] |
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,16 @@ | ||
# Generated by Django 4.1.5 on 2024-02-17 15:58 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('image', '0002_alter_image_image'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='Image', | ||
), | ||
] |
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,69 @@ | ||
# Generated by Django 4.1.5 on 2024-02-17 16:40 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('image', '0003_delete_image'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Apply_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/Apply')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Introduce_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/Introduce')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Login_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/Login')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Main_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/Main')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='NotAllow_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/NotAllow')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Result_Image', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=50)), | ||
('image', models.ImageField(upload_to='media/Result')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=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
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
from rest_framework import serializers | ||
from .models import Image | ||
from .models import * | ||
from django.apps import apps | ||
|
||
|
||
class ImageSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Image | ||
model = None | ||
fields = ["id", "title", "image", "uploaded_at"] | ||
|
||
def __init__(self, *args, **kwargs): | ||
model_name = kwargs.pop("model_name", None) | ||
if model_name: | ||
self.Meta.model = apps.get_model("image", model_name) | ||
super().__init__(*args, **kwargs) |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from django.urls import path | ||
from .views import ImageUploadView | ||
from image.views import * | ||
# from django.urls import path | ||
# from .views import ImageUploadView | ||
# from image.views import * | ||
|
||
urlpatterns = [ | ||
path("image_test/", ImageUploadView.as_view(), name="image-upload"), | ||
] | ||
# urlpatterns = [ | ||
# path("image_test/", ImageUploadView.as_view(), name="image-upload"), | ||
# ] |
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