Исправлено отображение табов при разных темах, добавлена возможность скачивать файлы из базы Алексея
This commit is contained in:
1 parent
e0e0c046ba
commit
8d9ae209cc
8 files changed
+71
-23
No files matched your search
@@ -11,7 +11,18 @@ class DictEmployeeAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
# class DictEmployeeAdmin(admin.ModelAdmin):
|
||||
class IlineComitteeFiles(admin.StackedInline):
|
||||
model = Committee1Files
|
||||
extra = 0
|
||||
|
||||
class InlineComiteePeople(admin.StackedInline):
|
||||
model = Committee2
|
||||
extra = 0
|
||||
|
||||
class Committee1Admin(admin.ModelAdmin):
|
||||
# list_display = ('name', 'num_start', 'date_start', 'num_finish', 'date_finish')
|
||||
inlines = [IlineComitteeFiles, InlineComiteePeople]
|
||||
|
||||
|
||||
|
||||
admin.site.register(Committee1, Committee1Admin)
|
||||
admin.site.register(DictEmployee,DictEmployeeAdmin)
|
||||
@@ -23,16 +23,22 @@ class Committee1(models.Model):
|
||||
db_table = 'committee1'
|
||||
db_table_comment = '╤яшёюъ ъюьшёёшщ'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class Committee1Files(models.Model):
|
||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш')
|
||||
file_name = models.CharField(max_length=1024, db_comment='╚ь Їрщыр')
|
||||
file_name = models.FileField(upload_to='comitee_files')
|
||||
is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'committee1_files'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.file_name)
|
||||
|
||||
|
||||
class Committee2(models.Model):
|
||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╙эшъры№э√щ эюьхЁ ъюьшёёшш')
|
||||
@@ -45,6 +51,9 @@ class Committee2(models.Model):
|
||||
db_table = 'committee2'
|
||||
db_table_comment = '╤юёЄрт ъюьшёёшщ'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.id_dict_committee_position.name)
|
||||
|
||||
|
||||
class DictCommitteeExpert(models.Model):
|
||||
fio = models.CharField(max_length=250, blank=True, null=True, db_comment='╘╚╬ ¤ъёяхЁЄр')
|
||||
@@ -54,6 +63,9 @@ class DictCommitteeExpert(models.Model):
|
||||
managed = False
|
||||
db_table = 'dict_committee_expert'
|
||||
db_table_comment = '╤яЁртюўэшъ эхчртшёшь√ї ¤ъёяхЁЄют'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.fio)
|
||||
|
||||
|
||||
class DictCommitteeOrderAddon(models.Model):
|
||||
@@ -79,6 +91,9 @@ class DictCommitteePosition(models.Model):
|
||||
db_table = 'dict_committee_position'
|
||||
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ ъюьшёёшщ'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name_short)
|
||||
|
||||
|
||||
class DictCommitteeType(models.Model):
|
||||
name = models.CharField(max_length=100, blank=True, null=True, db_comment='═ршьхэютрэшх тшфр ъюьшёёшш')
|
||||
@@ -88,6 +103,9 @@ class DictCommitteeType(models.Model):
|
||||
db_table = 'dict_committee_type'
|
||||
db_table_comment = '╤яЁртюўэшъ тшфют ъюьшёёшщ'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class DictCompetences(models.Model):
|
||||
id_dict_competences_type = models.ForeignKey('DictCompetencesType', models.DO_NOTHING, db_column='id_dict_competences_type', db_comment='шфхэЄшЇшърЄюЁ уЁєяя√ ъюьяхЄхэЎшш')
|
||||
|
||||
@@ -38,7 +38,7 @@ class Committee1FilesSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Committee1Files
|
||||
exclude=['id_committee1']
|
||||
fields = '__all__'
|
||||
|
||||
class Committee1Serializer(serializers.ModelSerializer):
|
||||
typs = serializers.CharField(source='id_dict_committee_type.name')
|
||||
|
||||
Reference in new issue
Block a user