-
Notifications
You must be signed in to change notification settings - Fork 0
Add ContentType and extra field types to Attribute #1
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
Conversation
1f0cdaa to
9a56b8a
Compare
| """ | ||
| value = models.CharField(_('Value'), db_index=True, unique=True, max_length=50) | ||
| value = models.CharField(_('Value'), db_index=True, max_length=100) | ||
| legacy_value = models.CharField(_('Legacy Value'), blank=True, null=True, db_index=True, max_length=100) |
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.
What is the purpose of this field?
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.
It will be used to synchronize existing data.
| TYPE_TEXT = 'text' | ||
| TYPE_FLOAT = 'float' | ||
| TYPE_DECIMAL = 'decimal' | ||
| TYPE_INT = 'int' | ||
| TYPE_DATE = 'date' | ||
| TYPE_BOOLEAN = 'bool' | ||
| TYPE_OBJECT = 'object' | ||
| TYPE_ENUM = 'enum' | ||
| TYPE_ENUM_MULTI = 'enum_multi' |
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.
This kind of aligning is against pep8, no?
| blank=True, | ||
| null=True, | ||
| ) | ||
| entity_id = models.UUIDField( |
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.
Why is this a UUID field?
| # Core attributes | ||
| entity_ct = models.ForeignKey( | ||
| ContentType, | ||
| on_delete = models.PROTECT, |
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.
too many spaces before =
| ct_field = 'entity_ct', | ||
| fk_field = 'entity_id' |
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.
nit: space around =
Adds:
Motivation and Context
Attributes are shared across all the models which register with them. This PR adds support to assign specific Attributes to specific models.
Types of Changes
xin all the boxes that apply:Checklist:
Go over all the following points, and put an
xin all the boxes that apply.If you're unsure about any of these, don't hesitate to ask. We're here to help!