Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
1311 Разработка системы заявок для 3д печати
project_1311
Commits
7073aa58
Commit
7073aa58
authored
2 months ago
by
Антонов Егор Алексеевич
Browse files
Options
Download
Patches
Plain Diff
Исправлено отображение данных запросов на редактирование.
parent
fa4ab465
xserver
profile
1 merge request
!15
Исправлено отображение данных запросов на редактирование.
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
movere_local/mainapp/admin.py
+3
-0
movere_local/mainapp/admin.py
movere_local/mainapp/models.py
+1
-1
movere_local/mainapp/models.py
movere_local/mainapp/templates/mainapp/view_editrequests.html
+4
-5
...re_local/mainapp/templates/mainapp/view_editrequests.html
movere_local/mainapp/views.py
+8
-3
movere_local/mainapp/views.py
with
16 additions
and
9 deletions
+16
-9
movere_local/mainapp/admin.py
+
3
−
0
View file @
7073aa58
from
django.contrib
import
admin
from
.models
import
EditRequest
,
IncomingEditRequest
# Register your models here.
admin
.
site
.
register
(
EditRequest
)
admin
.
site
.
register
(
IncomingEditRequest
)
This diff is collapsed.
Click to expand it.
movere_local/mainapp/models.py
+
1
−
1
View file @
7073aa58
...
...
@@ -19,7 +19,7 @@ class EditRequest(models.Model):
req_datetime
=
models
.
DateTimeField
(
auto_now_add
=
True
)
# Дата и время создания заказа
user
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
CASCADE
)
# Связь с пользователем
req_parameters
=
models
.
TextField
(
default
=
'no parameters'
)
# Параметры заказа
file_path
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
# Путь к файлу
file_path
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
# Путь к файлу
, отправлен пользователем
req_state
=
models
.
CharField
(
max_length
=
50
,
default
=
'in_progress'
,
...
...
This diff is collapsed.
Click to expand it.
movere_local/mainapp/templates/mainapp/view_editrequests.html
+
4
−
5
View file @
7073aa58
...
...
@@ -56,11 +56,10 @@
{% for order in orders %}
<li>
Заказ ID: {{ order.id }}
<br>
Дата: {{ order.order_datetime }}
<br>
Параметры: {{ order.order_parameters }}
<br>
Файл: {% if order.file_basename %}{{ order.file_basename }}{% else %}Нет файла{% endif %}
<br>
Дата: {{ order.req_datetime }}
<br>
Параметры: {{ order.req_parameters }}
<br>
Отправленный файл: {% if order.sent_by_user %}{{ order.sent_by_user }}{% else %}Нет файла{% endif %}
<br>
Полученный файл: {% if order.recieved_from_server %}{{ order.recieved_from_server }}{% else %}Нет файла{% endif %}
<br>
</li>
{% endfor %}
</ul>
...
...
This diff is collapsed.
Click to expand it.
movere_local/mainapp/views.py
+
8
−
3
View file @
7073aa58
...
...
@@ -523,11 +523,16 @@ def view_editrequests(request):
orders
=
reqs_by_status
[
status
]
for
order
in
orders
:
# Извлекаем только basename из файловых путей
if
order
.
file_path
:
order
.
sent_by_user
=
os
.
path
.
basename
(
order
.
file_path
)
else
:
order
.
sent_by_user
=
[]
if
order
.
received_file
:
order
.
file_basename
=
os
.
path
.
basename
(
order
.
received_file
)
order
.
recieved_from_server
=
os
.
path
.
basename
(
order
.
received_file
)
else
:
order
.
file_basename
=
[]
order
.
recieved_from_server
=
[]
orders_status_list
.
append
((
status
,
orders
))
return
render
(
request
,
'mainapp/view_editrequests.html'
,
{
'orders_status_list'
:
orders_status_list
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets