Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-django-backend
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
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-django-backend
Commits
b9e99fa0
Verified
Commit
b9e99fa0
authored
Oct 29, 2020
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: ListOfReferencesField
parent
b8a94313
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
djaosdb/models/fields.py
+5
-2
5 additions, 2 deletions
djaosdb/models/fields.py
tests/test_new.py
+1
-0
1 addition, 0 deletions
tests/test_new.py
with
6 additions
and
2 deletions
djaosdb/models/fields.py
+
5
−
2
View file @
b9e99fa0
...
@@ -26,7 +26,10 @@ from django.db.models import (
...
@@ -26,7 +26,10 @@ from django.db.models import (
Manager
,
Model
,
Field
,
AutoField
,
Manager
,
Model
,
Field
,
AutoField
,
ForeignKey
,
BigAutoField
,
ManyToManyField
)
ForeignKey
,
BigAutoField
,
ManyToManyField
)
from
django.utils
import
version
from
django.utils
import
version
from
django.db.models.fields.related
import
RelatedField
from
django.db.models.fields.related
import
(
RelatedField
,
lazy_related_operation
)
from
django.db.models.fields.related_descriptors
import
(
ManyToManyDescriptor
)
from
django.forms
import
modelform_factory
from
django.forms
import
modelform_factory
from
django.utils.functional
import
cached_property
from
django.utils.functional
import
cached_property
from
django.utils.html
import
format_html_join
,
format_html
from
django.utils.html
import
format_html_join
,
format_html
...
@@ -1209,4 +1212,4 @@ class ListOfReferencesField(ManyToManyField):
...
@@ -1209,4 +1212,4 @@ class ListOfReferencesField(ManyToManyField):
setattr
(
cls
,
self
.
name
,
ManyToManyDescriptor
(
self
.
remote_field
,
reverse
=
False
))
setattr
(
cls
,
self
.
name
,
ManyToManyDescriptor
(
self
.
remote_field
,
reverse
=
False
))
# Set up the accessor for the m2m table name for the relation.
# Set up the accessor for the m2m table name for the relation.
self
.
m2m_db_table
=
partial
(
self
.
_get_m2m_db_table
,
cls
.
_meta
)
self
.
m2m_db_table
=
functools
.
partial
(
self
.
_get_m2m_db_table
,
cls
.
_meta
)
This diff is collapsed.
Click to expand it.
tests/test_new.py
+
1
−
0
View file @
b9e99fa0
...
@@ -12,6 +12,7 @@ from djaosdb.sql2mongo.query import (Query, InsertQuery, SelectQuery,
...
@@ -12,6 +12,7 @@ from djaosdb.sql2mongo.query import (Query, InsertQuery, SelectQuery,
from
djaosdb.sql2mongo.converters
import
(
AggColumnSelectConverter
,
from
djaosdb.sql2mongo.converters
import
(
AggColumnSelectConverter
,
InnerJoinConverter
,
InnerJoinConverter
,
OuterJoinConverter
)
OuterJoinConverter
)
from
djaosdb.models
import
ListOfReferencesField
class
_MockContainer
(
_Container
):
class
_MockContainer
(
_Container
):
...
...
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