Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_common_py
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
backend_common_py
Commits
20c2a811
Commit
20c2a811
authored
4 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Fix id suffix for Any2Many fields
parent
d99a61e5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/videoag_common/api_object/fields/relationship_fields.py
+5
-3
5 additions, 3 deletions
src/videoag_common/api_object/fields/relationship_fields.py
with
5 additions
and
3 deletions
src/videoag_common/api_object/fields/relationship_fields.py
+
5
−
3
View file @
20c2a811
...
...
@@ -22,8 +22,6 @@ class ApiAbstractRelationshipField(ApiAbstractColumnField[_O], Generic[_O], ABC)
self
.
_relationship
:
orm
.
Relationship
or
None
=
None
def
post_init
(
self
,
context
:
FieldContext
):
self
.
config_id
=
f
"
{
self
.
member_name
}
_id
"
super
().
post_init
(
context
)
if
not
isinstance
(
context
.
own_member
,
orm
.
InstrumentedAttribute
):
...
...
@@ -57,6 +55,8 @@ class ApiMany2OneRelationshipField(ApiAbstractRelationshipField[_O], Generic[_O]
self
.
_may_be_none
=
may_be_none
def
post_init
(
self
,
context
:
FieldContext
):
self
.
config_id
=
f
"
{
self
.
member_name
}
_id
"
if
self
.
data_foreign_in_context
and
self
.
data_id
is
None
and
self
.
member_name
is
not
None
:
self
.
data_id
=
f
"
{
self
.
member_name
}
_id
"
...
...
@@ -117,8 +117,10 @@ class ApiAny2ManyRelationshipField(ApiAbstractRelationshipField[_O], Generic[_O]
super
().
__init__
(
**
kwargs
)
def
post_init
(
self
,
context
:
FieldContext
):
self
.
config_id
=
f
"
{
self
.
member_name
}
_ids
"
if
self
.
data_foreign_in_context
and
self
.
data_id
is
None
and
self
.
member_name
is
not
None
:
self
.
data_id
=
f
"
{
self
.
member_name
}
_id
"
self
.
data_id
=
f
"
{
self
.
member_name
}
_id
s
"
super
().
post_init
(
context
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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