Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Draft: support annotate parameter in field to allow ORM annotations #255

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fjsj
Copy link

@fjsj fjsj commented Jun 30, 2023

Incomplete: missing tests and docs.

Copy link
Member

@bellini666 bellini666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome! :) Excited for the final version of the PR

Left a small comment, other than that everything else seems fine and correct.

obs. Although we are both brazilians, I'll comment here in english in case anyone that doesn't speak portuguese is following this.

@@ -79,6 +80,7 @@
else:
_relation_fields = (models.ManyToManyField, ManyToManyRel, ManyToOneRel)
_sentinel = object()
_annotate_placeholder = "______annotate_placeholder______"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just __annotated_placeholder__ would be enough? Any reason to be using 4 underscores?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change to __annotated_placeholder__, it should be more than enough to avoid clashes. Also, if you have a suggestion on how to avoid this, please LMK. Unfortunately, I needed this workaround because field names aren't bind at class declaration moment.

@codecov
Copy link

codecov bot commented Jul 1, 2023

Codecov Report

Merging #255 (54db7ec) into main (16922ab) will decrease coverage by 0.32%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main     #255      +/-   ##
==========================================
- Coverage   88.35%   88.03%   -0.32%     
==========================================
  Files          28       28              
  Lines        2833     2858      +25     
==========================================
+ Hits         2503     2516      +13     
- Misses        330      342      +12     
Impacted Files Coverage Δ
strawberry_django_plus/optimizer.py 84.25% <55.55%> (-2.75%) ⬇️
strawberry_django_plus/field.py 89.86% <100.00%> (ø)
strawberry_django_plus/utils/typing.py 89.47% <100.00%> (+0.58%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants