Merge branch 'razrab'
This commit is contained in:
commit
dd02f13ac9
14 files changed
+294
-126
No files matched your search
@@ -65,6 +65,7 @@ class CustomAuth(ModelBackend):
|
||||
# try:
|
||||
|
||||
user = DictEmployee.objects.using('user_directory').get(login=username)
|
||||
# print(user)
|
||||
|
||||
if user.deleted!=1:
|
||||
homeuser, created = User.objects.get_or_create(username=username)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from rest_framework import serializers
|
||||
from django.contrib.auth import authenticate
|
||||
from .models import User
|
||||
|
||||
@@ -13,6 +13,7 @@ urlpatterns = [
|
||||
path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||
path('token/verify/', TokenVerifyView.as_view(), name='token_access'),
|
||||
path('getuser/', getuserAPIView.as_view(), name='getuserAPIView'),
|
||||
path('getuser/', getuserAPIView.as_view(), name='getuserAPIView', ),
|
||||
|
||||
|
||||
]
|
||||
+12
-3
@@ -5,6 +5,8 @@ from rest_framework.views import APIView
|
||||
from .renderers import UserJSONRenderer
|
||||
from userauth.models import *
|
||||
from .models import *
|
||||
from .serializers import *
|
||||
import pandas as pd
|
||||
# from .serializers import RegistrationSerializer
|
||||
|
||||
# class RegistrationAPIView(APIView):
|
||||
@@ -36,6 +38,7 @@ class UserAPIView(APIView):
|
||||
|
||||
class getuserAPIView(APIView):
|
||||
permission_classes = (AllowAny,)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,8 +46,14 @@ class getuserAPIView(APIView):
|
||||
userlogin = request.query_params.get('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)
|
||||
|
||||
|
||||
Binary file not shown.
Generated
+12
@@ -26,6 +26,7 @@
|
||||
"roboto-fontface": "*",
|
||||
"v-tooltip": "^2.1.3",
|
||||
"vue": "^3.2.0",
|
||||
"vue-cal": "^4.8.1",
|
||||
"vue-chartjs": "^5.2.0",
|
||||
"vue-jwt-decode": "^0.1.0",
|
||||
"vue-router": "^4.0.0",
|
||||
@@ -21546,6 +21547,17 @@
|
||||
"@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": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-5.2.0.tgz",
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"roboto-fontface": "*",
|
||||
"v-tooltip": "^2.1.3",
|
||||
"vue": "^3.2.0",
|
||||
"vue-cal": "^4.8.1",
|
||||
"vue-chartjs": "^5.2.0",
|
||||
"vue-jwt-decode": "^0.1.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,
|
||||
multiMonthMaxColumns: 2,
|
||||
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>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="bg-yellow flex-column h-100">
|
||||
<div class="flex-column h-100">
|
||||
|
||||
<v-card
|
||||
:ref="i"
|
||||
@@ -13,7 +13,7 @@
|
||||
</v-card-title>
|
||||
<v-img
|
||||
:src="`${burl}${x.link}`"
|
||||
height="164px"
|
||||
height="185px"
|
||||
cover
|
||||
width="92%"
|
||||
class="mx-auto"
|
||||
|
||||
@@ -12,13 +12,11 @@
|
||||
<v-col class="pr-0 pt-0 flex-column">
|
||||
<v-card class="h-100 bg-transparent pa-2 d-flex flex-column">
|
||||
<v-row class="d-flex">
|
||||
<v-col>
|
||||
<Calendar-full/>
|
||||
<v-col class="flex-column d-flex">
|
||||
<!-- <Calendar-full/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<Calendar-full
|
||||
:initial="'listYear'"
|
||||
/>
|
||||
<v-col> -->
|
||||
<event-calendar/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
@@ -26,10 +24,10 @@
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="flex-column d-flex ma-3">
|
||||
<v-row class="bg-red">
|
||||
<v-col class="flex-grow-0"> <digital-letna/></v-col>
|
||||
<v-col class="flex-column d-flex h-100">
|
||||
<v-card class="overflow-auto d-flex h-100 flex-column">
|
||||
<v-row >
|
||||
<v-col class="flex-grow-0 pa-0 pb-3"> <digital-letna/></v-col>
|
||||
<v-col class="flex-column d-flex pr-0 pt-0 pb-0">
|
||||
<v-card class=" flex-column pik overflow-auto">
|
||||
|
||||
<News-list-home />
|
||||
|
||||
@@ -37,8 +35,9 @@
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="bg-yellow flex-grow-0">
|
||||
<v-row class=" flex-grow-0">
|
||||
<v-col class="pa-0">
|
||||
<v-card class=" flex-colmn">
|
||||
<v-btn-toggle
|
||||
v-model="toggle"
|
||||
divided
|
||||
@@ -58,11 +57,13 @@
|
||||
/>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</v-btn-toggle>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -155,6 +156,9 @@
|
||||
import LoadRound from '@/components/load-round.vue'
|
||||
import DigitalLetna from '@/components/digital-letna.vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
import EventCalendar from '@/components/UI/event-calendar.vue'
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
@@ -164,7 +168,9 @@
|
||||
CalendarFull,
|
||||
NewsListHome,
|
||||
LoadRound,
|
||||
DigitalLetna
|
||||
DigitalLetna,
|
||||
|
||||
EventCalendar
|
||||
},
|
||||
|
||||
|
||||
@@ -173,6 +179,7 @@
|
||||
const appStore = useAppStore()
|
||||
const favorit = ref([])
|
||||
const toggle = ref(null)
|
||||
|
||||
pagecounter()
|
||||
const accountStore = useAccountStore()
|
||||
onMounted(() => {
|
||||
@@ -215,7 +222,7 @@
|
||||
}
|
||||
|
||||
.pik {
|
||||
height: 97%;
|
||||
height: 85.3vh;
|
||||
}
|
||||
|
||||
.hicard {
|
||||
|
||||
+127
-87
@@ -9,26 +9,25 @@ from django.db import models
|
||||
|
||||
|
||||
class Committee1(models.Model):
|
||||
|
||||
name = models.CharField(max_length=1000, blank=True, null=True)
|
||||
num_start = models.CharField(max_length=100, blank=True, null=True)
|
||||
date_start = models.DateField(blank=True, null=True)
|
||||
num_finish = models.CharField(max_length=100, blank=True, null=True)
|
||||
date_finish = models.DateField(blank=True, null=True)
|
||||
comment = models.CharField(max_length=4000, blank=True, null=True)
|
||||
id_dict_committee_type = models.IntegerField()
|
||||
id_master = models.IntegerField(blank=True, null=True)
|
||||
name = models.CharField(max_length=1000, blank=True, null=True, db_comment='═ршьхэютрэшх ъюьшёёшш')
|
||||
num_start = models.CharField(max_length=100, blank=True, null=True, db_comment='═юьхЁ яЁшърчр ю ёючфрэшш ъюьшёёшш')
|
||||
date_start = models.DateField(blank=True, null=True, db_comment='─рЄр яЁшърчр ю ёючфрэшш ъюьшёёшш')
|
||||
num_finish = models.CharField(max_length=100, blank=True, null=True, db_comment='═юьхЁ яЁшърчр юс єяЁрчфэхэшш ъюьшёёшш')
|
||||
date_finish = models.DateField(blank=True, null=True, db_comment='─рЄр єяЁрчфэхэш ъюьшёёшш')
|
||||
comment = models.CharField(max_length=4000, blank=True, null=True, db_comment='╧Ёшьхўрэшх')
|
||||
id_dict_committee_type = models.ForeignKey('DictCommitteeType', models.DO_NOTHING, db_column='id_dict_committee_type', db_comment='╙эшъры№э√щ эюьхЁ тшфр ъюьшёёшш')
|
||||
id_master = models.ForeignKey('self', models.DO_NOTHING, db_column='id_master', blank=True, null=True, db_comment='╙═ т√°хёЄю ∙хщ ъюьшёёшш')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'committee1'
|
||||
db_table_comment = '╤яшёюъ ъюьшёёшщ'
|
||||
|
||||
|
||||
class Committee1Files(models.Model):
|
||||
|
||||
id_committee1 = models.IntegerField()
|
||||
file_name = models.CharField(max_length=1024)
|
||||
is_actual = models.TextField() # This field type is a guess.
|
||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш')
|
||||
file_name = models.CharField(max_length=1024, db_comment='╚ь Їрщыр')
|
||||
is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
@@ -36,176 +35,217 @@ class Committee1Files(models.Model):
|
||||
|
||||
|
||||
class Committee2(models.Model):
|
||||
|
||||
id_committee1 = models.IntegerField()
|
||||
id_dict_committee_position = models.IntegerField()
|
||||
id_dict_employee = models.IntegerField(blank=True, null=True)
|
||||
id_dict_committee_expert = models.IntegerField(blank=True, null=True)
|
||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╙эшъры№э√щ эюьхЁ ъюьшёёшш')
|
||||
id_dict_committee_position = models.PositiveIntegerField(db_comment='╙эшъры№э√щ эюьхЁ фюцэюёЄш т ъюьшёёшш')
|
||||
id_dict_employee = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ ёюЄЁєфэшър')
|
||||
id_dict_committee_expert = models.PositiveIntegerField(blank=True, null=True, db_comment='╙эшъры№э√щ эюьхЁ ¤ъёяхЁЄр')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'committee2'
|
||||
db_table_comment = '╤юёЄрт ъюьшёёшщ'
|
||||
|
||||
|
||||
class DictCommitteeExpert(models.Model):
|
||||
|
||||
fio = models.CharField(max_length=250, blank=True, null=True)
|
||||
tel = models.CharField(max_length=100, blank=True, null=True)
|
||||
fio = models.CharField(max_length=250, blank=True, null=True, db_comment='╘╚╬ ¤ъёяхЁЄр')
|
||||
tel = models.CharField(max_length=100, blank=True, null=True, db_comment='╥хыхЇюэ')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_committee_expert'
|
||||
db_table_comment = '╤яЁртюўэшъ эхчртшёшь√ї ¤ъёяхЁЄют'
|
||||
|
||||
|
||||
class DictCommitteeOrderAddon(models.Model):
|
||||
|
||||
id_committee1 = models.IntegerField()
|
||||
number = models.CharField(max_length=100)
|
||||
date = models.DateField()
|
||||
name = models.CharField(max_length=1024, blank=True, null=True)
|
||||
text = models.TextField(blank=True, null=True) # This field type is a guess.
|
||||
id_committee1 = models.ForeignKey(Committee1, models.DO_NOTHING, db_column='id_committee1', db_comment='╚─ ъюьшёёшш, т яЁшърчх яю ъюЄюЁющ яЁюшчю°ыш шчьхэхэш ')
|
||||
number = models.CharField(max_length=100, db_comment='═юьхЁ шчьхэхэшщ ъ яЁшърчє ю ъюьшёёшш')
|
||||
date = models.DateField(db_comment='─рЄр шчьхэхэшщ т яЁшърч ю ъюьшёёшш')
|
||||
name = models.CharField(max_length=1024, blank=True, null=True, db_comment='═ршьхэютрэшх шчьхэхэшщ ъ яЁшърчє ю ъюьшёёшш')
|
||||
text = models.TextField(blank=True, null=True, db_comment='╥хъёЄ шчьхэхэшщ т яЁшърч ю ъюьшёёшш')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_committee_order_addon'
|
||||
db_table_comment = '╥рсышЎр фюяюыэхэшщ ъ яЁшърчє ю ъюьшёёшш'
|
||||
|
||||
|
||||
class DictCommitteePosition(models.Model):
|
||||
|
||||
name = models.CharField(max_length=100, blank=True, null=True)
|
||||
name_short = models.CharField(max_length=100, blank=True, null=True)
|
||||
ord = models.IntegerField(blank=True, null=True)
|
||||
name = models.CharField(max_length=100, blank=True, null=True, db_comment='эршьхэютрэшх фюцэюёЄш т ъюьшёёшш')
|
||||
name_short = models.CharField(max_length=100, blank=True, null=True, db_comment='ъЁрЄъюх эршьхэютрэшх фюцэюёЄш т ъюьшёёшш')
|
||||
ord = models.IntegerField(blank=True, null=True, db_comment='╧юЁ фюъ ёюЁЄшЁютъш')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_committee_position'
|
||||
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ ъюьшёёшщ'
|
||||
|
||||
|
||||
class DictCommitteeType(models.Model):
|
||||
|
||||
name = models.CharField(max_length=100, blank=True, null=True)
|
||||
name = models.CharField(max_length=100, blank=True, null=True, db_comment='═ршьхэютрэшх тшфр ъюьшёёшш')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_committee_type'
|
||||
db_table_comment = '╤яЁртюўэшъ тшфют ъюьшёёшщ'
|
||||
|
||||
|
||||
class DictCompetences(models.Model):
|
||||
|
||||
id_dict_competences_type = models.IntegerField()
|
||||
id_dict_competences_type = models.ForeignKey('DictCompetencesType', models.DO_NOTHING, db_column='id_dict_competences_type', db_comment='шфхэЄшЇшърЄюЁ уЁєяя√ ъюьяхЄхэЎшш')
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_competences'
|
||||
db_table_comment = '╤яЁртюўэшъ ъюьяхЄхэЎшщ'
|
||||
|
||||
|
||||
class DictCompetencesType(models.Model):
|
||||
|
||||
name = models.CharField(max_length=50)
|
||||
name = models.CharField(max_length=50, db_comment='═ршьхэютрэшх уЁєяя√ ъюьяхЄхэЎшщ')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_competences_type'
|
||||
db_table_comment = '├Ёєяя√ ъюьяхЄхэЎшщ'
|
||||
|
||||
|
||||
class DictDepartment(models.Model):
|
||||
|
||||
id_curator = models.IntegerField(blank=True, null=True)
|
||||
id_chief = models.IntegerField(blank=True, null=True)
|
||||
name = models.CharField(max_length=500)
|
||||
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) # Field name made lowercase.
|
||||
name_position_chief = models.CharField(max_length=500)
|
||||
id_curator = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ ъєЁрЄюЁр юЄфхыр')
|
||||
id_chief = models.PositiveIntegerField(blank=True, null=True, db_comment='╚─ эрўры№эшър юЄфхыр')
|
||||
name = models.CharField(max_length=500, db_comment='═рчтрэшх юЄфхыр')
|
||||
deleted = models.IntegerField(db_comment='╠рЁъх єфрыхэш чряшёш')
|
||||
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_position_chief = models.CharField(max_length=500, db_comment='═рчтрэшх фюыцэюёЄш эрўры№эшър юЄфхыр')
|
||||
code_department = models.CharField(max_length=2)
|
||||
order_department = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_department'
|
||||
db_table_comment = '╤яЁртюўэшъ юЄфхыют'
|
||||
|
||||
|
||||
class DictEmployee(models.Model):
|
||||
|
||||
id_dict_department = models.IntegerField()
|
||||
id_dict_position = models.IntegerField()
|
||||
login = models.CharField(max_length=100, blank=True, null=True)
|
||||
password = models.CharField(max_length=100, blank=True, null=True)
|
||||
fio = models.CharField(db_column='FIO', max_length=300, blank=True, null=True) # Field name made lowercase.
|
||||
familyname = models.CharField(max_length=100, blank=True, null=True)
|
||||
name = models.CharField(max_length=100, blank=True, null=True)
|
||||
parentname = models.CharField(max_length=100, blank=True, null=True)
|
||||
department = models.CharField(max_length=500, blank=True, null=True)
|
||||
post = models.CharField(max_length=500, blank=True, null=True)
|
||||
room = models.CharField(max_length=20, blank=True, null=True)
|
||||
email = models.CharField(max_length=100, blank=True, null=True)
|
||||
tel = models.CharField(max_length=20, blank=True, null=True)
|
||||
iptel = models.CharField(max_length=20, blank=True, null=True)
|
||||
workstatus = models.CharField(db_column='WorkStatus', max_length=500, blank=True, null=True) # Field name made lowercase.
|
||||
is_curator = models.TextField() # This field type is a guess.
|
||||
datebegin = models.DateField(db_column='DateBegin', blank=True, null=True) # Field name made lowercase.
|
||||
dateend = models.DateField(db_column='DateEnd', blank=True, null=True) # Field name made lowercase.
|
||||
workstatus2 = models.CharField(db_column='WorkStatus2', max_length=500, blank=True, null=True) # Field name made lowercase.
|
||||
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.
|
||||
deleteddate = models.DateField(db_column='deletedDate', blank=True, null=True) # Field name made lowercase.
|
||||
is_responsible = models.TextField() # This field type is a guess.
|
||||
id = models.PositiveIntegerField(primary_key=True, db_comment='╥рсхы№э√щ эюьхЁ')
|
||||
id_dict_department = models.PositiveIntegerField(db_comment='╚─ юЄфхыр, т ъюЄюЁюь ЁрсюЄрхЄ ёюЄЁєфэшъ')
|
||||
id_dict_position = models.PositiveIntegerField(db_comment='╚─ чрэшьрхьющ фюыцэюёЄш')
|
||||
login = models.CharField(max_length=100, blank=True, null=True, db_comment='ыюушэ(sAMAccountName)')
|
||||
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, db_comment='╘╚╬(cn)') # Field name made lowercase.
|
||||
familyname = models.CharField(max_length=100, blank=True, null=True, db_comment='╘рьшыш (sn)')
|
||||
name = models.CharField(max_length=100, blank=True, null=True, db_comment='╚ь ')
|
||||
parentname = models.CharField(max_length=100, blank=True, null=True, db_comment='╬ЄўхёЄтю')
|
||||
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=100, 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.
|
||||
is_curator = models.PositiveIntegerField(db_comment='╠рЁъхЁ ъєЁрЄюЁр')
|
||||
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.
|
||||
deleted = models.PositiveIntegerField(db_comment='╠рЁъхЁ єфрыхэш ')
|
||||
deleteddate = models.DateField(db_column='deletedDate', blank=True, null=True, db_comment='─рЄр чряюыэхэш ьрЁъхЁр єфрыхэш ') # Field name made lowercase.
|
||||
is_responsible = models.PositiveIntegerField(db_comment='╙фрышЄ№')
|
||||
is_changed = models.PositiveIntegerField(db_comment='╧Ёшчэръ эрышўш шчьхэхэшщ')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_employee'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.fio)
|
||||
db_table_comment = '╤яшёюъ ёюЄЁєфэшъют'
|
||||
|
||||
|
||||
class DictPosition(models.Model):
|
||||
|
||||
name = models.CharField(max_length=1024)
|
||||
name = models.CharField(max_length=1024, db_comment='═ршьхэютрэшх фюыцэюёЄш')
|
||||
order_position = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'dict_position'
|
||||
db_table_comment = '╤яЁртюўэшъ фюыцэюёЄхщ'
|
||||
|
||||
|
||||
|
||||
|
||||
class MatrixCompetences(models.Model):
|
||||
|
||||
id_dict_employee = models.IntegerField()
|
||||
id_dict_competences = models.IntegerField()
|
||||
id_dict_employee = models.ForeignKey(DictEmployee, models.DO_NOTHING, db_column='id_dict_employee', db_comment='шфхэЄшЇшърЄюЁ ёюЄЁєфэшър')
|
||||
id_dict_competences = models.ForeignKey(DictCompetences, models.DO_NOTHING, db_column='id_dict_competences', db_comment='шфхэЄшЇшърЄюЁ ъюьяхЄхэЎшш')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'matrix_competences'
|
||||
db_table_comment = '╠рЄЁшЎр ъюьяхЄхэЎшщ'
|
||||
|
||||
|
||||
class OrderResponsibility(models.Model):
|
||||
|
||||
number = models.CharField(max_length=50)
|
||||
date = models.DateField()
|
||||
name = models.CharField(max_length=1024)
|
||||
sphere_of_responsibility = models.CharField(max_length=1024)
|
||||
number = models.CharField(max_length=50, db_comment='═юьхЁ яЁшърчр')
|
||||
date = models.DateField(db_comment='─рЄр яЁшърчр')
|
||||
name = models.CharField(max_length=1024, db_comment='═рчтрэшх яЁшърчр')
|
||||
sphere_of_responsibility = models.CharField(max_length=1024, db_comment='╤ЇхЁр юЄтхЄёЄтхээюёЄш ёюЄЁєфэшъют, эрчэрўрхьр фрээ√ь яЁшърчюь')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'order_responsibility'
|
||||
db_table_comment = '╥рсышЎр яЁшърчют ю эрчэрўхэшш юЄтхЄёЄтхээ√ї ёюЄЁєфэшъют'
|
||||
|
||||
|
||||
class OrderResponsibilityEmployee(models.Model):
|
||||
id_order_responsibility = models.IntegerField()
|
||||
id_dict_employee = 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.ForeignKey(DictEmployee, models.DO_NOTHING, db_column='id_dict_employee', db_comment='╚─ ёюЄЁєфэшър, ъюЄюЁ√щ эрчэрўхэ юЄтхЄёЄтхээ√ь яю фрээюьє яЁшърчє')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = 'order_responsibility_employee'
|
||||
unique_together = (('id_order_responsibility', 'id_dict_employee'),)
|
||||
|
||||
|
||||
class OrderResponsibilityFiles(models.Model):
|
||||
|
||||
id_order_responsibility = models.IntegerField()
|
||||
file_name = models.CharField(max_length=1024)
|
||||
is_actual = models.TextField() # This field type is a guess.
|
||||
id_order_responsibility = models.ForeignKey(OrderResponsibility, models.DO_NOTHING, db_column='id_order_responsibility', db_comment='╚─ яЁшърчр юс юЄтхЄёЄтхээ√ї ёюЄЁєфэшърї')
|
||||
file_name = models.CharField(max_length=1024, db_comment='╚ь Їрщыр')
|
||||
is_actual = models.IntegerField(db_comment='╧Ёшчэръ ръЄєры№эюёЄш Їрщыр')
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
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'
|
||||
@@ -34,11 +34,14 @@ class Counter(ListAPIView):
|
||||
|
||||
|
||||
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:
|
||||
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:
|
||||
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.save()
|
||||
|
||||
@@ -54,7 +57,7 @@ class SelectedLinksAPIView(ListAPIView):
|
||||
def get(self, request):
|
||||
user = User.objects.get(username=self.request.user)
|
||||
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)
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user