Merge branch 'razrab'

This commit is contained in:
iriska-gri committed 2023-11-10 12:50:17 +03:00
commit dd02f13ac9
14 files changed
+291 -123

No files matched your search

+1
View File
@@ -65,6 +65,7 @@ class CustomAuth(ModelBackend):
# try: # try:
user = DictEmployee.objects.using('user_directory').get(login=username) user = DictEmployee.objects.using('user_directory').get(login=username)
# print(user)
if user.deleted!=1: if user.deleted!=1:
homeuser, created = User.objects.get_or_create(username=username) homeuser, created = User.objects.get_or_create(username=username)
-1
View File
@@ -1,4 +1,3 @@
from rest_framework import serializers from rest_framework import serializers
from django.contrib.auth import authenticate from django.contrib.auth import authenticate
from .models import User from .models import User
+2 -1
View File
@@ -13,6 +13,7 @@ urlpatterns = [
path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path('token/verify/', TokenVerifyView.as_view(), name='token_access'), path('token/verify/', TokenVerifyView.as_view(), name='token_access'),
path('getuser/', getuserAPIView.as_view(), name='getuserAPIView'), path('getuser/', getuserAPIView.as_view(), name='getuserAPIView', ),
] ]
+10 -1
View File
@@ -5,6 +5,8 @@ from rest_framework.views import APIView
from .renderers import UserJSONRenderer from .renderers import UserJSONRenderer
from userauth.models import * from userauth.models import *
from .models import * from .models import *
from .serializers import *
import pandas as pd
# from .serializers import RegistrationSerializer # from .serializers import RegistrationSerializer
# class RegistrationAPIView(APIView): # class RegistrationAPIView(APIView):
@@ -39,12 +41,19 @@ class getuserAPIView(APIView):
def get(self, request): def get(self, request):
userlogin = request.query_params.get('userlogin') userlogin = request.query_params.get('userlogin')
queryset = model_to_dict(DictEmployee.objects.using('user_directory').get(login=userlogin)) queryset = model_to_dict(DictEmployee.objects.using('user_directory').get(login=userlogin))
# queryset['responsible'] = [model_to_dict(x) for x in OrderResponsibilityEmployee.objects.using('user_directory').raw("SELECT * FROM order_responsibility_employee")] # com = Committee2.objects.using('user_directory').values('id_dict_employee')
# emp = DictEmployee.objects.using('user_directory').values('login', 'id')
# dfcom = pd.DataFrame.from_records(com)
# dfemp = pd.DataFrame.from_records(emp)
# h = dfcom.merge(dfemp, how="left", left_on="id_dict_employee", right_on="id")
# print(h, '====================================================================')
return Response(queryset) return Response(queryset)
BIN
View File
Binary file not shown.
+12
View File
@@ -26,6 +26,7 @@
"roboto-fontface": "*", "roboto-fontface": "*",
"v-tooltip": "^2.1.3", "v-tooltip": "^2.1.3",
"vue": "^3.2.0", "vue": "^3.2.0",
"vue-cal": "^4.8.1",
"vue-chartjs": "^5.2.0", "vue-chartjs": "^5.2.0",
"vue-jwt-decode": "^0.1.0", "vue-jwt-decode": "^0.1.0",
"vue-router": "^4.0.0", "vue-router": "^4.0.0",
@@ -21546,6 +21547,17 @@
"@vue/shared": "3.3.4" "@vue/shared": "3.3.4"
} }
}, },
"node_modules/vue-cal": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/vue-cal/-/vue-cal-4.8.1.tgz",
"integrity": "sha512-qe0jSDmbzdKF3/MSTPcHSJMOovav4MwmXtgs1n7jkI345zAtfErQVv4uFEVXg1rD62sBi1qWflYRUKy1mzQapg==",
"funding": {
"url": "https://github.com/sponsors/antoniandre"
},
"peerDependencies": {
"vue": "^2.6.14 || ^3.2.0"
}
},
"node_modules/vue-chartjs": { "node_modules/vue-chartjs": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-5.2.0.tgz", "resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-5.2.0.tgz",
+1
View File
@@ -28,6 +28,7 @@
"roboto-fontface": "*", "roboto-fontface": "*",
"v-tooltip": "^2.1.3", "v-tooltip": "^2.1.3",
"vue": "^3.2.0", "vue": "^3.2.0",
"vue-cal": "^4.8.1",
"vue-chartjs": "^5.2.0", "vue-chartjs": "^5.2.0",
"vue-jwt-decode": "^0.1.0", "vue-jwt-decode": "^0.1.0",
"vue-router": "^4.0.0", "vue-router": "^4.0.0",
@@ -70,21 +70,7 @@ export default {
} }
, ,
// eventRender: function(eventObj, $el) {
// $el.popover({
// title: eventObj.title,
// content: eventObj.description,
// trigger: 'hover',
// placement: 'top',
// container: 'body'
// });
// },
// eventDidMount: function(info) {
// console.log(info.event.extendedProps);
// {description: "Lecture", department: "BioChemistry"}
// },
aspectRatio: 1, aspectRatio: 1,
multiMonthMaxColumns: 2, multiMonthMaxColumns: 2,
displayEventEnd: true, displayEventEnd: true,
@@ -0,0 +1,109 @@
<template>
<v-row>
<v-col>
<vue-cal
locale="ru"
xsmall
:time="false"
hide-view-selector
active-view="month"
:disable-views="['years', 'year', 'week', 'day']"
@cell-focus="selectedDate = $event"
class="vuecal--blue-theme vuecal--rounded-theme"
>
<template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon>
</template>
<template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
</vue-cal>
</v-col>
<v-col>
<vue-cal
locale="ru"
xsmall
:time="false"
hide-view-selector
active-view="day"
:disable-views="['years', 'year', 'month', 'week']"
:selected-date="selectedDate"
class="vuecal--blue-theme"
>
<template #arrow-prev>
<v-icon icon="mdi-menu-left"></v-icon>
</template>
<template #arrow-next>
<v-icon icon="mdi-menu-right"></v-icon>
</template>
</vue-cal>
</v-col>
</v-row>
</template>
<script>
import VueCal from 'vue-cal'
import 'vue-cal/dist/vuecal.css'
import { ref, onMounted } from 'vue'
export default {
components: { VueCal },
setup() {
const selectedDate = ref(null)
const events = [
{
start: '2023-11-20 14:00',
end: '2023-11-20 18:00',
title: 'Need to go shopping',
icon: 'shopping_cart', // Custom attribute.
content: 'Click to see my shopping list',
contentFull: 'My shopping list is rather long:<br><ul><li>Avocados</li><li>Tomatoes</li><li>Potatoes</li><li>Mangoes</li></ul>', // Custom attribute.
class: 'leisure'
},
{
start: '2023-10-10 14:00',
end: '2023-10-20 14:00',
title: 'Golf with John',
icon: 'golf_course', // Custom attribute.
content: 'Do I need to tell how many holes?',
contentFull: 'Okay.<br>It will be a 18 hole golf course.', // Custom attribute.
class: 'sport'
}
]
return { events, selectedDate }
}
}
</script>
<style>
.vuecal__cell-events-count {
width: 18px;
height: 2px;
color: transparent;
}
/* Dot indicator */
.vuecal__cell-events-count {
width: 4px;
min-width: 0;
height: 4px;
padding: 0;
color: transparent;
}
/* Cell background indicator */
.vuecal__cell--has-events {background-color: #fffacd;}
.vuecal__cell-events-count {display: none;}
</style>
+2 -2
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="bg-yellow flex-column h-100"> <div class="flex-column h-100">
<v-card <v-card
:ref="i" :ref="i"
@@ -13,7 +13,7 @@
</v-card-title> </v-card-title>
<v-img <v-img
:src="`${burl}${x.link}`" :src="`${burl}${x.link}`"
height="164px" height="185px"
cover cover
width="92%" width="92%"
class="mx-auto" class="mx-auto"
+20 -13
View File
@@ -12,13 +12,11 @@
<v-col class="pr-0 pt-0 flex-column"> <v-col class="pr-0 pt-0 flex-column">
<v-card class="h-100 bg-transparent pa-2 d-flex flex-column"> <v-card class="h-100 bg-transparent pa-2 d-flex flex-column">
<v-row class="d-flex"> <v-row class="d-flex">
<v-col> <v-col class="flex-column d-flex">
<Calendar-full/> <!-- <Calendar-full/>
</v-col> </v-col>
<v-col> <v-col> -->
<Calendar-full <event-calendar/>
:initial="'listYear'"
/>
</v-col> </v-col>
</v-row> </v-row>
</v-card> </v-card>
@@ -26,10 +24,10 @@
</v-row> </v-row>
</v-col> </v-col>
<v-col class="flex-column d-flex ma-3"> <v-col class="flex-column d-flex ma-3">
<v-row class="bg-red"> <v-row >
<v-col class="flex-grow-0"> <digital-letna/></v-col> <v-col class="flex-grow-0 pa-0 pb-3"> <digital-letna/></v-col>
<v-col class="flex-column d-flex h-100"> <v-col class="flex-column d-flex pr-0 pt-0 pb-0">
<v-card class="overflow-auto d-flex h-100 flex-column"> <v-card class=" flex-column pik overflow-auto">
<News-list-home /> <News-list-home />
@@ -37,8 +35,9 @@
</v-col> </v-col>
</v-row> </v-row>
<v-row class="bg-yellow flex-grow-0"> <v-row class=" flex-grow-0">
<v-col class="pa-0"> <v-col class="pa-0">
<v-card class=" flex-colmn">
<v-btn-toggle <v-btn-toggle
v-model="toggle" v-model="toggle"
divided divided
@@ -62,7 +61,9 @@
</v-btn-toggle> </v-btn-toggle>
</v-card>
</v-col> </v-col>
</v-row> </v-row>
@@ -155,6 +156,9 @@
import LoadRound from '@/components/load-round.vue' import LoadRound from '@/components/load-round.vue'
import DigitalLetna from '@/components/digital-letna.vue' import DigitalLetna from '@/components/digital-letna.vue'
import { axiosApiInstance } from '@/utils/axios-api' import { axiosApiInstance } from '@/utils/axios-api'
import EventCalendar from '@/components/UI/event-calendar.vue'
export default { export default {
components: { components: {
@@ -164,7 +168,9 @@
CalendarFull, CalendarFull,
NewsListHome, NewsListHome,
LoadRound, LoadRound,
DigitalLetna DigitalLetna,
EventCalendar
}, },
@@ -173,6 +179,7 @@
const appStore = useAppStore() const appStore = useAppStore()
const favorit = ref([]) const favorit = ref([])
const toggle = ref(null) const toggle = ref(null)
pagecounter() pagecounter()
const accountStore = useAccountStore() const accountStore = useAccountStore()
onMounted(() => { onMounted(() => {
@@ -215,7 +222,7 @@
} }
.pik { .pik {
height: 97%; height: 85.3vh;
} }
.hicard { .hicard {
+127 -87
View File
@@ -9,26 +9,25 @@ from django.db import models
class Committee1(models.Model): class Committee1(models.Model):
name = models.CharField(max_length=1000, blank=True, null=True, db_comment='═ршьхэютрэшх ъюьшёёшш')
name = models.CharField(max_length=1000, blank=True, null=True) num_start = models.CharField(max_length=100, blank=True, null=True, db_comment='═юьхЁ яЁшърчр ю ёючфрэшш ъюьшёёшш')
num_start = models.CharField(max_length=100, blank=True, null=True) date_start = models.DateField(blank=True, null=True, db_comment='─рЄр яЁшърчр ю ёючфрэшш ъюьшёёшш')
date_start = models.DateField(blank=True, null=True) num_finish = models.CharField(max_length=100, blank=True, null=True, db_comment='═юьхЁ яЁшърчр юс єяЁрчфэхэшш ъюьшёёшш')
num_finish = models.CharField(max_length=100, blank=True, null=True) date_finish = models.DateField(blank=True, null=True, db_comment='─рЄр єяЁрчфэхэш  ъюьшёёшш')
date_finish = models.DateField(blank=True, null=True) comment = models.CharField(max_length=4000, blank=True, null=True, db_comment='╧Ёшьхўрэшх')
comment = models.CharField(max_length=4000, blank=True, null=True) id_dict_committee_type = models.ForeignKey('DictCommitteeType', models.DO_NOTHING, db_column='id_dict_committee_type', db_comment='╙эшъры№э√щ эюьхЁ тшфр ъюьшёёшш')
id_dict_committee_type = models.IntegerField() id_master = models.ForeignKey('self', models.DO_NOTHING, db_column='id_master', blank=True, null=True, db_comment='╙═ т√°хёЄю ∙хщ ъюьшёёшш')
id_master = models.IntegerField(blank=True, null=True)
class Meta: class Meta:
managed = False managed = False
db_table = 'committee1' db_table = 'committee1'
db_table_comment = '╤яшёюъ ъюьшёёшщ'
class Committee1Files(models.Model): class Committee1Files(models.Model):
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш')
id_committee1 = models.IntegerField() file_name = models.CharField(max_length=1024, db_comment='╚ь  Їрщыр')
file_name = models.CharField(max_length=1024) is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
is_actual = models.TextField() # This field type is a guess.
class Meta: class Meta:
managed = False managed = False
@@ -36,176 +35,217 @@ class Committee1Files(models.Model):
class Committee2(models.Model): class Committee2(models.Model):
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╙эшъры№э√щ эюьхЁ ъюьшёёшш')
id_committee1 = models.IntegerField() id_dict_committee_position = models.PositiveIntegerField(db_comment='╙эшъры№э√щ эюьхЁ фюцэюёЄш т ъюьшёёшш')
id_dict_committee_position = models.IntegerField() id_dict_employee = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ ёюЄЁєфэшър')
id_dict_employee = models.IntegerField(blank=True, null=True) id_dict_committee_expert = models.PositiveIntegerField(blank=True, null=True, db_comment='╙эшъры№э√щ эюьхЁ ¤ъёяхЁЄр')
id_dict_committee_expert = models.IntegerField(blank=True, null=True)
class Meta: class Meta:
managed = False managed = False
db_table = 'committee2' db_table = 'committee2'
db_table_comment = '╤юёЄрт ъюьшёёшщ'
class DictCommitteeExpert(models.Model): class DictCommitteeExpert(models.Model):
fio = models.CharField(max_length=250, blank=True, null=True, db_comment='╘╚╬ ¤ъёяхЁЄр')
fio = models.CharField(max_length=250, blank=True, null=True) tel = models.CharField(max_length=100, blank=True, null=True, db_comment='╥хыхЇюэ')
tel = models.CharField(max_length=100, blank=True, null=True)
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_committee_expert' db_table = 'dict_committee_expert'
db_table_comment = '╤яЁртюўэшъ эхчртшёшь√ї ¤ъёяхЁЄют'
class DictCommitteeOrderAddon(models.Model): class DictCommitteeOrderAddon(models.Model):
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш, т яЁшърчх яю ъюЄюЁющ яЁюшчю°ыш шчьхэхэш ')
id_committee1 = models.IntegerField() number = models.CharField(max_length=100, db_comment='═юьхЁ шчьхэхэшщ ъ яЁшърчє ю ъюьшёёшш')
number = models.CharField(max_length=100) date = models.DateField(db_comment='─рЄр шчьхэхэшщ т яЁшърч ю ъюьшёёшш')
date = models.DateField() name = models.CharField(max_length=1024, blank=True, null=True, db_comment='═ршьхэютрэшх шчьхэхэшщ ъ яЁшърчє ю ъюьшёёшш')
name = models.CharField(max_length=1024, blank=True, null=True) text = models.TextField(blank=True, null=True, db_comment='╥хъёЄ шчьхэхэшщ т яЁшърч ю ъюьшёёшш')
text = models.TextField(blank=True, null=True) # This field type is a guess.
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_committee_order_addon' db_table = 'dict_committee_order_addon'
db_table_comment = '╥рсышЎр фюяюыэхэшщ ъ яЁшърчє ю ъюьшёёшш'
class DictCommitteePosition(models.Model): class DictCommitteePosition(models.Model):
name = models.CharField(max_length=100, blank=True, null=True, db_comment='эршьхэютрэшх фюцэюёЄш т ъюьшёёшш')
name = models.CharField(max_length=100, blank=True, null=True) name_short = models.CharField(max_length=100, blank=True, null=True, db_comment='ъЁрЄъюх эршьхэютрэшх фюцэюёЄш т ъюьшёёшш')
name_short = models.CharField(max_length=100, blank=True, null=True) ord = models.IntegerField(blank=True, null=True, db_comment='╧юЁ фюъ ёюЁЄшЁютъш')
ord = models.IntegerField(blank=True, null=True)
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_committee_position' db_table = 'dict_committee_position'
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ ъюьшёёшщ'
class DictCommitteeType(models.Model): class DictCommitteeType(models.Model):
name = models.CharField(max_length=100, blank=True, null=True, db_comment='═ршьхэютрэшх тшфр ъюьшёёшш')
name = models.CharField(max_length=100, blank=True, null=True)
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_committee_type' db_table = 'dict_committee_type'
db_table_comment = '╤яЁртюўэшъ тшфют ъюьшёёшщ'
class DictCompetences(models.Model): class DictCompetences(models.Model):
id_dict_competences_type = models.ForeignKey('DictCompetencesType', models.DO_NOTHING, db_column='id_dict_competences_type', db_comment='шфхэЄшЇшърЄюЁ уЁєяя√ ъюьяхЄхэЎшш')
id_dict_competences_type = models.IntegerField()
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_competences' db_table = 'dict_competences'
db_table_comment = '╤яЁртюўэшъ ъюьяхЄхэЎшщ'
class DictCompetencesType(models.Model): class DictCompetencesType(models.Model):
name = models.CharField(max_length=50, db_comment='═ршьхэютрэшх уЁєяя√ ъюьяхЄхэЎшщ')
name = models.CharField(max_length=50)
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_competences_type' db_table = 'dict_competences_type'
db_table_comment = '├Ёєяя√ ъюьяхЄхэЎшщ'
class DictDepartment(models.Model): class DictDepartment(models.Model):
id_curator = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ ъєЁрЄюЁр юЄфхыр')
id_curator = models.IntegerField(blank=True, null=True) id_chief = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ эрўры№эшър юЄфхыр')
id_chief = models.IntegerField(blank=True, null=True) name = models.CharField(max_length=500, db_comment='═рчтрэшх юЄфхыр')
name = models.CharField(max_length=500) deleted = models.IntegerField(db_comment='╠рЁъх єфрыхэш  чряшёш')
deleted = models.TextField() # This field type is a guess. name_from_ad = models.CharField(db_column='name_from_AD', max_length=500, blank=True, null=True, db_comment='═рчтрэшх юЄфхыр т AD') # Field name made lowercase.
name_from_ad = models.CharField(db_column='name_from_AD', max_length=500, blank=True, null=True) # Field name made lowercase. name_position_chief = models.CharField(max_length=500, db_comment='═рчтрэшх фюыцэюёЄш эрўры№эшър юЄфхыр')
name_position_chief = models.CharField(max_length=500)
code_department = models.CharField(max_length=2) code_department = models.CharField(max_length=2)
order_department = models.IntegerField() order_department = models.IntegerField()
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_department' db_table = 'dict_department'
db_table_comment = '╤яЁртюўэшъ юЄфхыют'
class DictEmployee(models.Model): class DictEmployee(models.Model):
id = models.PositiveIntegerField(primary_key=True, db_comment='╥рсхы№э√щ эюьхЁ')
id_dict_department = models.IntegerField() id_dict_department = models.PositiveIntegerField(db_comment='╚─ юЄфхыр, т ъюЄюЁюь ЁрсюЄрхЄ ёюЄЁєфэшъ')
id_dict_position = models.IntegerField() id_dict_position = models.PositiveIntegerField(db_comment='╚─ чрэшьрхьющ фюыцэюёЄш')
login = models.CharField(max_length=100, blank=True, null=True) login = models.CharField(max_length=100, blank=True, null=True, db_comment='ыюушэ(sAMAccountName)')
password = models.CharField(max_length=100, blank=True, null=True) password = models.CharField(max_length=100, blank=True, null=True, db_comment='╧рЁюы№ фы  тїюфр эр яюЁЄры')
fio = models.CharField(db_column='FIO', max_length=300, blank=True, null=True) # Field name made lowercase. fio = models.CharField(db_column='FIO', max_length=300, blank=True, null=True, db_comment='╘╚╬(cn)') # Field name made lowercase.
familyname = models.CharField(max_length=100, blank=True, null=True) familyname = models.CharField(max_length=100, blank=True, null=True, db_comment='╘рьшыш (sn)')
name = models.CharField(max_length=100, blank=True, null=True) name = models.CharField(max_length=100, blank=True, null=True, db_comment='╚ь ')
parentname = models.CharField(max_length=100, blank=True, null=True) parentname = models.CharField(max_length=100, blank=True, null=True, db_comment='╬ЄўхёЄтю')
department = models.CharField(max_length=500, blank=True, null=True) department = models.CharField(max_length=500, blank=True, null=True, db_comment='╬Єфхы(department)')
post = models.CharField(max_length=500, blank=True, null=True) post = models.CharField(max_length=500, blank=True, null=True, db_comment='фюыцэюёЄ№(title)')
room = models.CharField(max_length=20, blank=True, null=True) room = models.CharField(max_length=20, blank=True, null=True, db_comment='ърсшэхЄ(physicalDeliveryOfficeName)')
email = models.CharField(max_length=100, blank=True, null=True) email = models.CharField(max_length=100, blank=True, null=True, db_comment='рфЁхё ¤ыхъЄЁюээющ яюўЄ√(mail)')
tel = models.CharField(max_length=20, blank=True, null=True) tel = models.CharField(max_length=20, blank=True, null=True, db_comment='уюЁюфёъющ ЄхыхЇюэ(telephoneNumber)')
iptel = models.CharField(max_length=20, blank=True, null=True) iptel = models.CharField(max_length=20, blank=True, null=True, db_comment='тэєЄЁхээшщ ЄхыхЇюэ(OfficePhone)')
workstatus = models.CharField(db_column='WorkStatus', max_length=500, blank=True, null=True) # Field name made lowercase. workstatus = models.CharField(db_column='WorkStatus', max_length=500, blank=True, null=True, db_comment='ёЄрЄєё') # Field name made lowercase.
is_curator = models.TextField() # This field type is a guess. is_curator = models.PositiveIntegerField(db_comment='╠рЁъхЁ ъєЁрЄюЁр')
datebegin = models.DateField(db_column='DateBegin', blank=True, null=True) # Field name made lowercase. datebegin = models.DateField(db_column='DateBegin', blank=True, null=True, db_comment='─рЄр яЁшхьр эр ЁрсюЄє') # Field name made lowercase.
dateend = models.DateField(db_column='DateEnd', blank=True, null=True) # Field name made lowercase. dateend = models.DateField(db_column='DateEnd', blank=True, null=True, db_comment='─рЄр єтюы№эхэш ') # Field name made lowercase.
workstatus2 = models.CharField(db_column='WorkStatus2', max_length=500, blank=True, null=True) # Field name made lowercase. workstatus2 = models.CharField(db_column='WorkStatus2', max_length=500, blank=True, null=True, db_comment='ёЄрЄєё єўхЄэющ чряшёш(Enabled)') # Field name made lowercase.
workstatus3 = models.TextField(db_column='WorkStatus3', blank=True, null=True) # Field name made lowercase. This field type is a guess. # workstatus3 = models.TextField(db_column='WorkStatus3', blank=True, null=True) # Field name made lowercase. This field type is a guess.
deleted = models.TextField() # This field type is a guess. deleted = models.PositiveIntegerField(db_comment='╠рЁъхЁ єфрыхэш ')
deleteddate = models.DateField(db_column='deletedDate', blank=True, null=True) # Field name made lowercase. deleteddate = models.DateField(db_column='deletedDate', blank=True, null=True, db_comment='─рЄр чряюыэхэш  ьрЁъхЁр єфрыхэш ') # Field name made lowercase.
is_responsible = models.TextField() # This field type is a guess. is_responsible = models.PositiveIntegerField(db_comment='╙фрышЄ№')
is_changed = models.PositiveIntegerField(db_comment='╧Ёшчэръ эрышўш  шчьхэхэшщ')
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_employee' db_table = 'dict_employee'
db_table_comment = '╤яшёюъ ёюЄЁєфэшъют'
def __str__(self):
return str(self.fio)
class DictPosition(models.Model): class DictPosition(models.Model):
name = models.CharField(max_length=1024, db_comment='═ршьхэютрэшх фюыцэюёЄш')
name = models.CharField(max_length=1024)
order_position = models.IntegerField() order_position = models.IntegerField()
class Meta: class Meta:
managed = False managed = False
db_table = 'dict_position' db_table = 'dict_position'
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ'
class MatrixCompetences(models.Model): class MatrixCompetences(models.Model):
id_dict_employee = models.ForeignKey(DictEmployee, models.DO_NOTHING, db_column='id_dict_employee', db_comment='шфхэЄшЇшърЄюЁ ёюЄЁєфэшър')
id_dict_employee = models.IntegerField() id_dict_competences = models.ForeignKey(DictCompetences, models.DO_NOTHING, db_column='id_dict_competences', db_comment='шфхэЄшЇшърЄюЁ ъюьяхЄхэЎшш')
id_dict_competences = models.IntegerField()
class Meta: class Meta:
managed = False managed = False
db_table = 'matrix_competences' db_table = 'matrix_competences'
db_table_comment = '╠рЄЁшЎр ъюьяхЄхэЎшщ'
class OrderResponsibility(models.Model): class OrderResponsibility(models.Model):
number = models.CharField(max_length=50, db_comment='═юьхЁ яЁшърчр')
number = models.CharField(max_length=50) date = models.DateField(db_comment='─рЄр яЁшърчр')
date = models.DateField() name = models.CharField(max_length=1024, db_comment='═рчтрэшх яЁшърчр')
name = models.CharField(max_length=1024) sphere_of_responsibility = models.CharField(max_length=1024, db_comment='╤ЇхЁр юЄтхЄёЄтхээюёЄш ёюЄЁєфэшъют, эрчэрўрхьр  фрээ√ь яЁшърчюь')
sphere_of_responsibility = models.CharField(max_length=1024)
class Meta: class Meta:
managed = False managed = False
db_table = 'order_responsibility' db_table = 'order_responsibility'
db_table_comment = '╥рсышЎр яЁшърчют ю эрчэрўхэшш юЄтхЄёЄтхээ√ї ёюЄЁєфэшъют'
class OrderResponsibilityEmployee(models.Model): class OrderResponsibilityEmployee(models.Model):
id_order_responsibility = models.IntegerField() id_order_responsibility = models.OneToOneField(OrderResponsibility, models.DO_NOTHING, db_column='id_order_responsibility', primary_key=True, db_comment='╚─ яЁшърчр ю эрчэрўхэшш юЄтхЄёЄтхээ√ї ёюЄЁєфэшъют') # The composite primary key (id_order_responsibility, id_dict_employee) found, that is not supported. The first column is selected.
id_dict_employee = models.IntegerField() id_dict_employee = models.ForeignKey(DictEmployee, models.DO_NOTHING, db_column='id_dict_employee', db_comment='╚─ ёюЄЁєфэшър, ъюЄюЁ√щ эрчэрўхэ юЄтхЄёЄтхээ√ь яю фрээюьє яЁшърчє')
class Meta: class Meta:
managed = False managed = False
db_table = 'order_responsibility_employee' db_table = 'order_responsibility_employee'
unique_together = (('id_order_responsibility', 'id_dict_employee'),)
class OrderResponsibilityFiles(models.Model): class OrderResponsibilityFiles(models.Model):
id_order_responsibility = models.ForeignKey(OrderResponsibility, models.DO_NOTHING, db_column='id_order_responsibility', db_comment='╚─ яЁшърчр юс юЄтхЄёЄтхээ√ї ёюЄЁєфэшърї')
id_order_responsibility = models.IntegerField() file_name = models.CharField(max_length=1024, db_comment='╚ь  Їрщыр')
file_name = models.CharField(max_length=1024) is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
is_actual = models.TextField() # This field type is a guess.
class Meta: class Meta:
managed = False managed = False
db_table = 'order_responsibility_files' db_table = 'order_responsibility_files'
class Sprstaff(models.Model):
tn = models.SmallIntegerField(primary_key=True, db_comment='╥рсхы№э√щ эюьхЁ')
login = models.CharField(max_length=100, blank=True, null=True, db_comment='ыюушэ(sAMAccountName)')
fio = models.CharField(db_column='FIO', max_length=300, blank=True, null=True, db_comment='╘╚╬(cn)') # Field name made lowercase.
f = models.CharField(db_column='F', max_length=100, blank=True, null=True, db_comment='╘рьшыш (sn)') # Field name made lowercase.
i = models.CharField(db_column='I', max_length=100, blank=True, null=True, db_comment='╚ь ') # Field name made lowercase.
o = models.CharField(db_column='O', max_length=100, blank=True, null=True, db_comment='╬ЄўхёЄтю') # Field name made lowercase.
department = models.CharField(max_length=500, blank=True, null=True, db_comment='╬Єфхы(department)')
post = models.CharField(max_length=500, blank=True, null=True, db_comment='фюыцэюёЄ№(title)')
room = models.CharField(max_length=20, blank=True, null=True, db_comment='ърсшэхЄ(physicalDeliveryOfficeName)')
email = models.CharField(max_length=50, blank=True, null=True, db_comment='рфЁхё ¤ыхъЄЁюээющ яюўЄ√(mail)')
tel = models.CharField(max_length=20, blank=True, null=True, db_comment='уюЁюфёъющ ЄхыхЇюэ(telephoneNumber)')
iptel = models.CharField(max_length=20, blank=True, null=True, db_comment='тэєЄЁхээшщ ЄхыхЇюэ(OfficePhone)')
workstatus = models.CharField(db_column='WorkStatus', max_length=500, blank=True, null=True, db_comment='ёЄрЄєё') # Field name made lowercase.
datebegin = models.DateField(db_column='DateBegin', blank=True, null=True, db_comment='─рЄр яЁшхьр эр ЁрсюЄє') # Field name made lowercase.
dateend = models.DateField(db_column='DateEnd', blank=True, null=True, db_comment='─рЄр єтюы№эхэш ') # Field name made lowercase.
workstatus2 = models.CharField(db_column='WorkStatus2', max_length=500, blank=True, null=True, db_comment='ёЄрЄєё єўхЄэющ чряшёш(Enabled)') # Field name made lowercase.
workstatus3 = models.TextField(db_column='WorkStatus3', blank=True, null=True) # Field name made lowercase. This field type is a guess.
class Meta:
managed = False
db_table = 'sprstaff'
db_table_comment = '╤яшёюъ ёюЄЁєфэшъют'
class Table14(models.Model):
fio = models.CharField(db_column='FIO', max_length=100, blank=True, null=True) # Field name made lowercase.
col_2 = models.CharField(db_column='COL 2', max_length=30, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_3 = models.CharField(db_column='COL 3', max_length=22, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_4 = models.CharField(db_column='COL 4', max_length=23, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_5 = models.CharField(db_column='COL 5', max_length=12, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_6 = models.CharField(db_column='COL 6', max_length=7, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_7 = models.CharField(db_column='COL 7', max_length=6, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
col_8 = models.CharField(db_column='COL 8', max_length=6, blank=True, null=True) # Field name made lowercase. Field renamed to remove unsuitable characters.
class Meta:
managed = False
db_table = 'table 14'
+7 -4
View File
@@ -34,11 +34,14 @@ class Counter(ListAPIView):
def post(self, request): def post(self, request):
print(request.data['ico'], '----------------------------') myfullPath = request.data['fullPath']
if "?" in myfullPath:
myfullPath= myfullPath.split("?")[0]
# print(fullPath.split("?")[0], '---request.data-------------------------')
if request.data['user__id'] is not None: if request.data['user__id'] is not None:
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'], ico=request.data['ico']) watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=myfullPath, ico=request.data['ico'])
else: else:
watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'], ico=request.data['ico']) watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today(), fullPath=myfullPath, ico=request.data['ico'])
watch.count+=1 watch.count+=1
watch.save() watch.save()
@@ -54,7 +57,7 @@ class SelectedLinksAPIView(ListAPIView):
def get(self, request): def get(self, request):
user = User.objects.get(username=self.request.user) user = User.objects.get(username=self.request.user)
res = CountVisitor.objects.values('page','fullPath','ico').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/') res = CountVisitor.objects.values('page','fullPath','ico').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/')
sort = res.order_by('-count__sum')[:4] sort = res.order_by('-count__sum')[:20]
return Response(sort) return Response(sort)
BIN
View File
Binary file not shown.