Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Arches model QuerySets #11595 #11596

Draft
wants to merge 127 commits into
base: dev/8.0.x
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
b70e2e3
Group ResourceInstance fields together
jacobtylerwalls Oct 8, 2024
f3f7ca0
Initial commit of PythonicModelQuerySet
jacobtylerwalls Oct 8, 2024
3c7bdaf
Handle cardinality N tiledata
jacobtylerwalls Oct 9, 2024
d5fd6fc
Stub out save/clean/refresh_from_db
jacobtylerwalls Oct 9, 2024
8e851fd
Initial commit of updating and deleting on pythonic models
jacobtylerwalls Oct 9, 2024
04a7638
Orient around nodegroups to help with jagged data, blank tiles
jacobtylerwalls Oct 10, 2024
eaa9c23
Fix tile sortorder calculation
jacobtylerwalls Oct 10, 2024
462fa93
Fix refreshing
jacobtylerwalls Oct 10, 2024
1416a2e
Add datatype validation
jacobtylerwalls Oct 10, 2024
877814c
Stub out function triggers
jacobtylerwalls Oct 10, 2024
341b649
Move ORM lookup to datatype
jacobtylerwalls Oct 11, 2024
de72e26
Unwrap resource instance datatypes to string id
jacobtylerwalls Oct 11, 2024
cbe5751
Straighten out cardinality N interaction with list datatypes
jacobtylerwalls Oct 11, 2024
39b2d25
Check for invalid defer/only values
jacobtylerwalls Oct 12, 2024
7e3fe06
Handle concept-list datatype
jacobtylerwalls Oct 12, 2024
bc9040a
Handle JSON null in resource instance list dt transform
jacobtylerwalls Oct 12, 2024
ccc1f69
Factor out _get_orm_lookup_cardinality_n()
jacobtylerwalls Oct 12, 2024
878ec53
Remove run_functions switch, fix set union, respect name mangling
jacobtylerwalls Oct 16, 2024
8e45b36
Fetch only relevant tiles
jacobtylerwalls Oct 16, 2024
d0424a9
Remove typos in ResourceInstanceDataType validation
jacobtylerwalls Oct 16, 2024
4d28f45
Remove unwanted outer join
jacobtylerwalls Oct 16, 2024
e4fe62a
Return model instances for RI datatypes
jacobtylerwalls Oct 17, 2024
5f21334
Make `request` optional in Tile.__preDelete
jacobtylerwalls Oct 17, 2024
cfbe6b2
Skip no-op tile updates
jacobtylerwalls Oct 18, 2024
77638cc
Improve prefetching
jacobtylerwalls Oct 18, 2024
4b4268c
Implement RI datatype values_match
jacobtylerwalls Oct 18, 2024
56bd61e
Implement datatype post save actions
jacobtylerwalls Oct 18, 2024
a50acaf
Fix fallback value for RI ontology properties
jacobtylerwalls Oct 21, 2024
fc18c91
Make post_tile_save request kwarg optional
jacobtylerwalls Oct 21, 2024
c16f55d
Implement indexing
jacobtylerwalls Oct 21, 2024
2cd8971
Implement edit log saves
jacobtylerwalls Oct 21, 2024
d3698b7
Improve None handling
jacobtylerwalls Oct 21, 2024
c44f296
Add name to ResourceInstance.__repr__()
jacobtylerwalls Oct 21, 2024
8f566de
Harden ConceptListDataType.transform_value_for_tile against lists
jacobtylerwalls Oct 21, 2024
231f7f9
Remove orm_array_transform in favor of to_python()
jacobtylerwalls Oct 21, 2024
c7e4929
Move principal user fallback logic
jacobtylerwalls Oct 22, 2024
1c34d6d
Improve cardinality n vs. n-squared stuff
jacobtylerwalls Oct 22, 2024
6f9358b
Remove as_resource()
jacobtylerwalls Oct 22, 2024
ce8e103
Rename queryset
jacobtylerwalls Oct 22, 2024
1369ebb
Simplify error reporting
jacobtylerwalls Oct 22, 2024
2b41191
Add TileQuerySet
jacobtylerwalls Oct 23, 2024
2c0bb06
Remove eager materialization of RI instances for now
jacobtylerwalls Oct 23, 2024
95ec768
Add as_nodegroup transform
jacobtylerwalls Oct 24, 2024
cb6f1dc
Attach nodegroups to resources
jacobtylerwalls Oct 24, 2024
659231e
Attach child tiles
jacobtylerwalls Oct 24, 2024
c0ac899
Improve child tile attachment
jacobtylerwalls Oct 24, 2024
00388e8
Shave off some data, improve performance
jacobtylerwalls Oct 24, 2024
ef6f5ab
Finish reorienting around nodegroups, add minimal docs
jacobtylerwalls Oct 25, 2024
5e1182d
Fix subquery bugs
jacobtylerwalls Oct 28, 2024
633d947
Initial commit of ArchesModelSerializer
jacobtylerwalls Oct 28, 2024
a420ed0
Move as_nodegroup()
jacobtylerwalls Oct 29, 2024
df92242
Continue fleshing out tile/instance serializers
jacobtylerwalls Oct 29, 2024
5eb6ec9
Move some helpers to utils
jacobtylerwalls Oct 29, 2024
dd5e807
Make further fields blank
jacobtylerwalls Oct 29, 2024
786334b
Fix additional subquery bugs
jacobtylerwalls Oct 29, 2024
6b58ec9
Harden concept{list} dt validation against UUIDs
jacobtylerwalls Oct 29, 2024
0d7a931
Update save machinery
jacobtylerwalls Oct 29, 2024
ebbd728
Move ersatz model fields to datatype classes
jacobtylerwalls Oct 30, 2024
d0bfcf0
Implement single tile updates
jacobtylerwalls Oct 30, 2024
78bb3d5
Make StringDataType a JSONField
jacobtylerwalls Oct 30, 2024
b30e661
Fix example query
jacobtylerwalls Oct 30, 2024
6c444e2
Fix tests
jacobtylerwalls Oct 31, 2024
ca9af65
Quiet output from tests that expect transactions to fail
jacobtylerwalls Oct 31, 2024
2a5a7bd
Avoid saving resource update edit log entries
jacobtylerwalls Oct 31, 2024
3e73bb1
Fix parent/child tile attachment
jacobtylerwalls Oct 31, 2024
4f7ec0a
Update changelog
jacobtylerwalls Oct 31, 2024
f96c070
Add documentation, reduce queries
jacobtylerwalls Oct 31, 2024
e143921
Point to other docstring
jacobtylerwalls Oct 31, 2024
fba5031
Remove N+1 queries in build_unknown_field()
jacobtylerwalls Oct 31, 2024
eaf3b27
Improve ResourceInstance deserialization
jacobtylerwalls Oct 31, 2024
3587f3b
Improve names
jacobtylerwalls Nov 1, 2024
2840e4a
Support nodegroups = "__all__" in serializers
jacobtylerwalls Nov 5, 2024
5bff63b
Allow creation with tile data
jacobtylerwalls Nov 5, 2024
feb177a
Check correct private attribute
jacobtylerwalls Nov 5, 2024
bd44aad
Harden RI transform_value_for_tile
jacobtylerwalls Nov 5, 2024
a705331
Implement provisional edits
jacobtylerwalls Nov 6, 2024
7c36fac
Temporarily workaround tile deserialization issues
jacobtylerwalls Nov 6, 2024
0137088
Override TileModel.refresh_from_db()
jacobtylerwalls Nov 6, 2024
449ef94
Disallow empty strings for legacyid
jacobtylerwalls Nov 6, 2024
4011a48
Proof of concept of db_default uuid4() #10958
jacobtylerwalls Nov 6, 2024
2fb035f
Improve peformance of browsable API
jacobtylerwalls Nov 7, 2024
9b025c1
Improve types handling in ResourceInstance dt transform_value_for_tile
jacobtylerwalls Nov 7, 2024
61b5213
Add edit log update on ResourceInstance.save()
jacobtylerwalls Nov 7, 2024
ff187d0
Refactor get_values_query()
jacobtylerwalls Nov 7, 2024
87fb328
Add default pagination
jacobtylerwalls Nov 7, 2024
a991613
Limit graph choices in browsable API
jacobtylerwalls Nov 7, 2024
1da0afa
Avoid 404 for permission denied
jacobtylerwalls Nov 7, 2024
b7c6892
Allow null for tile serializer fields
jacobtylerwalls Nov 7, 2024
49ca86d
Factor out _make_tile_serializer()
jacobtylerwalls Nov 7, 2024
c83b44d
Fix nodegroup declaration on serializers
jacobtylerwalls Nov 7, 2024
0a0b698
Implement ResourceInstance dt to_python()
jacobtylerwalls Nov 7, 2024
50155a3
Calculate display value for RI/RI list datatypes
jacobtylerwalls Nov 7, 2024
bee6a24
Harden ConceptListDataType.to_json()
jacobtylerwalls Nov 7, 2024
fe260d8
Add lookups for searching localized strings in any language
jacobtylerwalls Nov 7, 2024
2ac22d6
Pop extra RI keys
jacobtylerwalls Nov 7, 2024
65b488e
Improve todo
jacobtylerwalls Nov 7, 2024
4443aa6
Improve SQL safety
jacobtylerwalls Nov 11, 2024
b55edd8
Fix migration history
jacobtylerwalls Nov 11, 2024
24376cb
Add ontologyProperty, inverseOntologyProperty
jacobtylerwalls Nov 11, 2024
14bd35f
Remove incorrect TODOs
jacobtylerwalls Nov 11, 2024
7ddbc49
DRY out x-list serializer fields
jacobtylerwalls Nov 12, 2024
361aa33
Add RDMAdministrator permission class
jacobtylerwalls Nov 12, 2024
ff1063a
Catch KeyError in ResourceInstanceDataType.validate()
jacobtylerwalls Nov 12, 2024
1d987f6
Re-serialize creates and updates with new data from backend
jacobtylerwalls Nov 12, 2024
da6a02e
Harden against calling .values()
jacobtylerwalls Nov 12, 2024
e45b88e
Allow creation of resource with new tiles
jacobtylerwalls Nov 12, 2024
554a055
Explicit is None comparison
jacobtylerwalls Nov 12, 2024
96cc1ef
Fix root node detection
jacobtylerwalls Nov 13, 2024
dbdb1b9
Fix regression with tile saves; revisit after grouping node field merges
jacobtylerwalls Nov 13, 2024
b457931
Set as_representation=True in more cases
jacobtylerwalls Nov 20, 2024
bca5cc7
Linearize migrations
jacobtylerwalls Dec 3, 2024
80543f9
Forbid double quotes in JSONPathFilter
jacobtylerwalls Dec 4, 2024
8a7e5da
fixup! Improve types handling
jacobtylerwalls Dec 9, 2024
59dad0f
fixup! Add RDMAdministrator permission class
jacobtylerwalls Dec 10, 2024
7b9fb52
Reject unknown keys
jacobtylerwalls Dec 10, 2024
bff1d42
Unpack nested validation errors
jacobtylerwalls Dec 30, 2024
1f20a0c
fixup! Make further fields blank
jacobtylerwalls Dec 30, 2024
ccd33b5
Supply graph from serializer options
jacobtylerwalls Dec 30, 2024
590ae0a
Guard against None in ConceptDataType.to_json()
jacobtylerwalls Jan 2, 2025
22835df
Short-circuit before reparsing datetimes
jacobtylerwalls Jan 7, 2025
a79b25e
fixup! Short-circuit before reparsing datetimes
jacobtylerwalls Jan 7, 2025
796cc86
fixup! Short-circuit before reparsing datetimes
jacobtylerwalls Jan 7, 2025
2d518b3
fixup! Short-circuit before reparsing datetimes
jacobtylerwalls Jan 7, 2025
2532fe2
Fix tile creates
jacobtylerwalls Jan 8, 2025
a8f9539
fixup! Fix tile creates
jacobtylerwalls Jan 8, 2025
8828a2f
Finish fixing tile creates
jacobtylerwalls Jan 8, 2025
785837d
Use safer params concatenation
jacobtylerwalls Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DRY out x-list serializer fields
jacobtylerwalls committed Dec 3, 2024
commit 7ddbc49272fe8e03bfa9f81fd52ff51cda352256
4 changes: 3 additions & 1 deletion arches/app/datatypes/concept_types.py
Original file line number Diff line number Diff line change
@@ -415,7 +415,9 @@ def ignore_keys(self):


class ConceptListDataType(BaseConceptDataType):
rest_framework_model_field = ArrayField(base_field=fields.UUIDField(), null=True)
rest_framework_model_field = ArrayField(
base_field=BaseConceptDataType.rest_framework_model_field, null=True
)

def validate(
self,
4 changes: 3 additions & 1 deletion arches/app/datatypes/datatypes.py
Original file line number Diff line number Diff line change
@@ -2434,7 +2434,9 @@ def values_match(self, value1, value2):


class ResourceInstanceListDataType(ResourceInstanceDataType):
rest_framework_model_field = ArrayField(base_field=JSONField(), null=True)
rest_framework_model_field = ArrayField(
base_field=ResourceInstanceDataType.rest_framework_model_field, null=True
)

def to_json(self, tile, node):
from arches.app.models.resource import (