-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
b809ae1
commit 9b4f1d2
Showing
553 changed files
with
107,542 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,9 @@ | |
# Beta 0.2 | ||
|
||
- 完善了数据库的设计 | ||
- 解决了一些bug | ||
- 解决了一些bug | ||
|
||
# v0.4 | ||
|
||
- 增加了部署到服务器的功能 | ||
- 解决了文件删除的bug |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from django.db.models.signals import post_init, post_save, pre_delete | ||
from django.dispatch.dispatcher import receiver | ||
import os | ||
from sitep.settings import MEDIA_ROOT | ||
from .models import Paper, Project, Summary | ||
|
||
|
||
@receiver(post_init, sender=Paper) | ||
def welcom_paper(instance, **kwargs): | ||
instance._file = instance.file | ||
|
||
|
||
@receiver(post_save, sender=Paper) | ||
def welcome_paper(instance, created, **kwargs): | ||
if not created and instance._file != instance.file: | ||
fname = os.path.join(MEDIA_ROOT, instance._file) | ||
if os.path.isfile(fname): | ||
os.remove(fname) | ||
instance._file = instance.file | ||
|
||
|
||
@receiver(post_init, sender=Project) | ||
def welcom_project(instance, **kwargs): | ||
instance._file = instance.file | ||
|
||
|
||
@receiver(post_save, sender=Project) | ||
def welcome_project(instance, created, **kwargs): | ||
if not created and instance._file != instance.file: | ||
fname = os.path.join(MEDIA_ROOT, instance._file) | ||
if os.path.isfile(fname): | ||
os.remove(fname) | ||
instance._file = instance.file | ||
|
||
|
||
@receiver(post_init, sender=Summary) | ||
def welcom_summary(instance, **kwargs): | ||
instance._file = instance.file | ||
|
||
|
||
@receiver(post_save, sender=Summary) | ||
def welcome_summary(instance, created, **kwargs): | ||
if not created and instance._file != instance.file: | ||
fname = os.path.join(MEDIA_ROOT, instance._file) | ||
if os.path.isfile(fname): | ||
os.remove(fname) | ||
instance._file = instance.file | ||
|
||
@receiver(pre_delete, sender=Paper) | ||
def filedelete_paper(sender, instance, **kwargs): | ||
instance.file.delete(False) | ||
|
||
@receiver(pre_delete, sender=Project) | ||
def filedelete_paper(sender, instance, **kwargs): | ||
instance.file.delete(False) | ||
|
||
@receiver(pre_delete, sender=Summary) | ||
def filedelete_paper(sender, instance, **kwargs): | ||
instance.file.delete(False) |
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,30 @@ | ||
# Generated by Django 2.2 on 2020-08-14 14:08 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0010_auto_20200812_1947'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Myfile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('file', models.FileField(blank=True, default=None, null=True, upload_to='paper', verbose_name='Attachment')), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Attachment', | ||
}, | ||
), | ||
migrations.AlterField( | ||
model_name='paper', | ||
name='file', | ||
field=models.OneToOneField(default=None, on_delete=django.db.models.deletion.CASCADE, to='app01.Myfile'), | ||
preserve_default=False, | ||
), | ||
] |
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,21 @@ | ||
# Generated by Django 2.2 on 2020-08-14 14:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0011_auto_20200814_2208'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='paper', | ||
name='file', | ||
field=models.FileField(blank=True, default=None, null=True, upload_to='paper', verbose_name='Attachment'), | ||
), | ||
migrations.DeleteModel( | ||
name='Myfile', | ||
), | ||
] |
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,27 @@ | ||
# Generated by Django 2.2 on 2020-08-14 23:16 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0012_auto_20200814_2219'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Myfile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('file', models.FileField(blank=True, default=None, null=True, upload_to='paper', verbose_name='Attachment')), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Attachment', | ||
}, | ||
), | ||
migrations.RemoveField( | ||
model_name='paper', | ||
name='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,20 @@ | ||
# Generated by Django 2.2 on 2020-08-14 23:18 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0013_auto_20200815_0716'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='paper', | ||
name='file', | ||
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='app01.Myfile'), | ||
preserve_default=False, | ||
), | ||
] |
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,24 @@ | ||
# Generated by Django 2.2 on 2020-08-14 23:23 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0014_paper_file'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='myfile', | ||
name='file', | ||
field=models.FileField(default=None, null=True, unique=True, upload_to='paper', verbose_name='Attachment'), | ||
), | ||
migrations.AlterField( | ||
model_name='paper', | ||
name='file', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.Myfile', to_field='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,21 @@ | ||
# Generated by Django 2.2 on 2020-08-14 23:35 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0015_auto_20200815_0723'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='paper', | ||
name='file', | ||
field=models.FileField(blank=True, default=None, null=True, upload_to='', verbose_name='Attachment'), | ||
), | ||
migrations.DeleteModel( | ||
name='Myfile', | ||
), | ||
] |
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 2.2 on 2020-08-14 23:48 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0016_auto_20200815_0735'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='paper', | ||
name='_file', | ||
field=models.CharField(blank=True, max_length=200), | ||
), | ||
] |
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 2.2 on 2020-08-15 01:14 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app01', '0017_paper__file'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='project', | ||
name='_file', | ||
field=models.CharField(blank=True, max_length=200), | ||
), | ||
migrations.AddField( | ||
model_name='summary', | ||
name='_file', | ||
field=models.CharField(blank=True, max_length=200), | ||
), | ||
] |
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0003_auto_20200812_1745.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0004_auto_20200812_1817.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0005_auto_20200812_1823.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0006_auto_20200812_1857.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0007_auto_20200812_1859.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0008_auto_20200812_1915.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0009_auto_20200812_1931.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
app01/migrations/__pycache__/0010_auto_20200812_1947.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+715 Bytes
app01/migrations/__pycache__/0012_auto_20200814_2219.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+854 Bytes
app01/migrations/__pycache__/0013_auto_20200815_0716.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+842 Bytes
app01/migrations/__pycache__/0015_auto_20200815_0723.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+717 Bytes
app01/migrations/__pycache__/0016_auto_20200815_0735.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+667 Bytes
app01/migrations/__pycache__/0018_auto_20200815_0914.cpython-38.pyc
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
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
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
Oops, something went wrong.