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
71d886fa
Commit
71d886fa
authored
1 year ago
by
dcz
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring
parent
e8060f67
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
freelus/urls.py
+2
-1
2 additions, 1 deletion
freelus/urls.py
freelus/views.py
+11
-10
11 additions, 10 deletions
freelus/views.py
with
13 additions
and
11 deletions
freelus/urls.py
+
2
−
1
View file @
71d886fa
...
...
@@ -10,7 +10,8 @@ urlpatterns = [
path
(
'
change_role/
'
,
views
.
change_role
,
name
=
'
change_role
'
),
path
(
'
attach_examples_to_frame/
'
,
views
.
attach_examples_to_frame
,
name
=
'
attach_examples_to_frame
'
),
path
(
'
attach_schema_to_argument/
'
,
views
.
attach_schema_to_argument
,
name
=
'
attach_schema_to_argument
'
),
path
(
'
delete_schema_to_argument_connection/
'
,
views
.
delete_schema_to_argument_connection
,
name
=
'
delete_schema_to_argument_connection
'
),
path
(
'
delete_schema_to_argument_connection/
'
,
views
.
delete_schema_to_argument_connection
,
name
=
'
delete_schema_to_argument_connection
'
),
path
(
'
finish_frame_processing/
'
,
views
.
finish_frame_processing
,
name
=
'
finish_frame_processing
'
),
]
This diff is collapsed.
Click to expand it.
freelus/views.py
+
11
−
10
View file @
71d886fa
...
...
@@ -4,10 +4,9 @@ from django.http import JsonResponse
from
common.decorators
import
ajax_required
from
connections.models
import
Entry
,
Status
,
ExampleConnection
,
SchemaHook
,
ArgumentConnection
,
RealisationDescription
from
examples.models
import
Example
from
meanings.models
import
LexicalUnit
from
semantics.models
import
Frame
,
FrameOpinion
,
Argument
,
ArgumentRole
,
SemanticRole
,
RoleAttribute
,
RoleSubAttribute
,
\
RoleType
from
semantics.models
import
Frame
,
FrameOpinion
,
Argument
,
ArgumentRole
,
SemanticRole
,
\
RoleAttribute
,
RoleSubAttribute
,
RoleType
@ajax_required
...
...
@@ -17,7 +16,7 @@ def change_status(request):
entry_id
=
request
.
POST
[
'
entry_id
'
]
status
=
request
.
POST
[
'
status
'
]
entry
=
Entry
.
get
(
pk
=
entry_id
)
entry
=
Entry
.
objects
.
get
(
pk
=
entry_id
)
entry
.
status
=
Status
.
objects
.
get
(
key
=
status
)
entry
.
save
()
return
JsonResponse
({})
...
...
@@ -88,7 +87,8 @@ def change_role_base(frame_argument, request):
sub_attribute_id
=
sub_attribute_id
).
first
()
if
argument_role
is
None
:
argument_role
=
ArgumentRole
(
role
=
SemanticRole
.
objects
.
get
(
pk
=
role_id
),
attribute
=
None
if
attribute_id
is
None
else
RoleAttribute
.
objects
.
get
(
pk
=
attribute_id
),
attribute
=
None
if
attribute_id
is
None
else
RoleAttribute
.
objects
.
get
(
pk
=
attribute_id
),
sub_attribute
=
RoleSubAttribute
.
objects
.
get
(
pk
=
sub_attribute_id
))
argument_role
.
save
()
...
...
@@ -133,13 +133,16 @@ def attach_schema_to_argument(request):
schema_hooks
=
SchemaHook
.
objects
.
filter
(
schema_id
=
schema_id
,
position_id
=
schema_position_id
)
if
len
(
schema_hooks
)
>
0
:
schema_hook
=
schema_hooks
[
0
]
argument_connection
,
xxx
=
ArgumentConnection
.
objects
.
get_or_create
(
argument
=
argument
,
defaults
=
{
'
argument
'
:
argument
})
argument_connection
,
xxx
=
ArgumentConnection
.
objects
.
get_or_create
(
argument
=
argument
,
defaults
=
{
'
argument
'
:
argument
})
argument_connection
.
save
()
argument_connection
.
schema_connections
.
add
(
schema_hook
)
argument_connection
.
save
()
realisation_description
=
RealisationDescription
.
objects
.
get_or_create
(
frame_id
=
frame_id
,
schema_id
=
schema_id
,
defaults
=
{
'
alternation
'
:
1
,
'
description
'
:
''
})
RealisationDescription
.
objects
.
get_or_create
(
frame_id
=
frame_id
,
schema_id
=
schema_id
,
defaults
=
{
'
alternation
'
:
1
,
'
description
'
:
''
})
return
JsonResponse
({})
...
...
@@ -148,7 +151,6 @@ def attach_schema_to_argument(request):
@transaction.atomic
def
delete_schema_to_argument_connection
(
request
):
if
request
.
method
==
'
POST
'
:
frame_id
=
request
.
POST
[
'
frame_id
'
]
argument_id
=
request
.
POST
[
'
argument_id
'
]
schema_id
=
request
.
POST
[
'
schema_id
'
]
schema_position_id
=
request
.
POST
[
'
schema_position_id
'
]
...
...
@@ -175,4 +177,3 @@ def finish_frame_processing(request):
frame
.
save
()
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