-
Notifications
You must be signed in to change notification settings - Fork 264
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
JSON Array Field #131
JSON Array Field #131
Conversation
a041f0f
to
d912404
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
a1f2f88
to
dca3f31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've arrived at me nitpicking docstrings. I am super pleased with this and as far as I'm concerned, these are my last pieces of feedback on this PR. :)
nautobot/utilities/forms/fields.py
Outdated
""" | ||
A FormField counterpart to JSONArrayField. | ||
Replicates ArrayFormField's base field validation: Field values are validated as JSON Arrays, | ||
and each Array element is validated by |base_field| validators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could sub the |foo|
pipes w/ backticks here in this class, too, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -45,6 +45,9 @@ def setUpTestData(cls): | |||
cls.status = cls.statuses.get(slug="connected") | |||
cls.status_planned = cls.statuses.get(slug="planned") | |||
|
|||
# create a Cable that is not contained in any CablePath | |||
cls.dneCable = Cable(status=cls.status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this being created intentionally as an invalid object? Normally the Cable terminations are required to be non-null and are checked for validity in the Cable.clean()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's the "does not exist cable". It's used in assertContainedByPath()
to assert that path_contains
is not returning false positives. Attempting to .clean()
or .save()
this Cable will fail, but it's valid to use it in filter expressions
Replaces uses of Postgres array fields with a custom JSON array field