Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ValUnifer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPIPAN
ValUnifer
Commits
47ae4a11
There was an error fetching the commit references. Please try again later.
Commit
47ae4a11
authored
1 year ago
by
dcz
Browse files
Options
Downloads
Patches
Plain Diff
Loading entries with lu optimization bugfix
parent
394270bb
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+7
-0
7 additions, 0 deletions
README.md
entries/views.py
+8
-9
8 additions, 9 deletions
entries/views.py
with
15 additions
and
9 deletions
README.md
+
7
−
0
View file @
47ae4a11
...
@@ -59,4 +59,11 @@ Compiled application files will be located in `frontend/dist/`.
...
@@ -59,4 +59,11 @@ Compiled application files will be located in `frontend/dist/`.
*
Login: Superleksykograf
*
Login: Superleksykograf
*
Hasło: valier111
*
Hasło: valier111
## Database manual migration
export LOADING_THE_SLOWOSIEC_ONTOLOGY_HIERARCHY_DISABLED=true
python manage.py makemigrations <module-name> (e.g. python manage.py makemigrations users)
python manage.py migrate <module-name> (e.g. python manage.py migrate users)
This diff is collapsed.
Click to expand it.
entries/views.py
+
8
−
9
View file @
47ae4a11
...
@@ -423,7 +423,7 @@ def get_entries(request):
...
@@ -423,7 +423,7 @@ def get_entries(request):
assert
(
not
errors_dict
)
assert
(
not
errors_dict
)
linked_ids
=
set
()
linked_ids
=
set
()
if
request
.
session
[
'
show_linked_entries
'
]:
if
request
.
session
[
'
show_linked_entries
'
]
and
not
with_lexical_units
:
entries_linked
=
Entry
.
objects
.
filter
(
pk__in
=
(
entries_linked
=
Entry
.
objects
.
filter
(
pk__in
=
(
Entry
.
objects
Entry
.
objects
.
filter
(
subentries__schema_hooks__argument_connections__schema_connections__subentry__entry__in
=
entries
)
.
filter
(
subentries__schema_hooks__argument_connections__schema_connections__subentry__entry__in
=
entries
)
...
@@ -454,12 +454,7 @@ def get_entries(request):
...
@@ -454,12 +454,7 @@ def get_entries(request):
)
)
if
with_lexical_units
:
if
with_lexical_units
:
if
exclude_status
is
not
None
:
frameQueryset
=
Frame
.
objects
.
prefetch_related
(
Prefetch
(
"
assignments
"
,
to_attr
=
"
_assignments
"
))
entries
=
entries
.
filter
(
lexical_units__frames__status__iexact
=
exclude_status
)
entries
=
entries
.
filter
(
lexical_units__frames__isnull
=
False
)
if
has_unified_frame
==
'
true
'
:
entries
=
entries
.
filter
(
lexical_units__frames__slowal_frame_2_unified_frame__isnull
=
False
)
frameQueryset
=
Frame
.
objects
.
select_related
(
"
slowal_frame_2_unified_frame
"
).
prefetch_related
(
Prefetch
(
"
assignments
"
,
to_attr
=
"
_assignments
"
));
entries
=
entries
.
prefetch_related
(
entries
=
entries
.
prefetch_related
(
Prefetch
(
Prefetch
(
"
lexical_units
"
,
"
lexical_units
"
,
...
@@ -472,6 +467,11 @@ def get_entries(request):
...
@@ -472,6 +467,11 @@ def get_entries(request):
)
)
)
)
)
)
if
exclude_status
is
not
None
:
entries
=
entries
.
filter
(
lexical_units__frames__status__iexact
=
exclude_status
)
entries
=
entries
.
filter
(
lexical_units__frames__isnull
=
False
)
if
has_unified_frame
==
'
true
'
:
entries
=
entries
.
filter
(
lexical_units__frames__slowal_frame_2_unified_frame__isnull
=
False
)
filtered
=
entries
.
count
()
filtered
=
entries
.
count
()
...
@@ -481,7 +481,7 @@ def get_entries(request):
...
@@ -481,7 +481,7 @@ def get_entries(request):
def
iter_lexical_units
(
e
):
def
iter_lexical_units
(
e
):
for
lu
in
e
.
lexical_units
.
all
():
for
lu
in
e
.
lexical_units
.
all
():
lu
.
_frame
=
lu
.
_frames
[
0
]
if
lu
.
_frames
and
len
(
lu
.
_frames
)
>
0
else
None
lu
.
_frame
=
lu
.
_frames
[
0
]
if
lu
.
_frames
and
len
(
lu
.
_frames
)
>
0
else
None
if
lu
.
_frame
is
None
:
if
lu
.
_frame
is
None
or
not
hasattr
(
lu
.
_frame
,
'
slowal_frame_2_unified_frame
'
)
:
continue
continue
else
:
else
:
yield
lu
yield
lu
...
@@ -517,7 +517,6 @@ def get_entries(request):
...
@@ -517,7 +517,6 @@ def get_entries(request):
}
for
e
in
entries
[
first_index
:
last_index
]
}
for
e
in
entries
[
first_index
:
last_index
]
],
],
}
}
return
JsonResponse
(
result
)
return
JsonResponse
(
result
)
return
JsonResponse
({})
return
JsonResponse
({})
...
...
This diff is collapsed.
Click to expand it.
Preview
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