Closed jorenham closed 8 years ago
I haven't tested this, but probably you need a setter decorator, say:
@full_name.setter
def full_name(self, combined_name):
self.first_name = ... do some regex magic on combined_name
self.last_name = ... more regex magic
If you absolutely want to stick to NgCRUDView (which I discourage, see my second point), you can define a custom serializer for your NgCRUDView and add your properties in it.
If you're starting to use django-angular more and more, NGCrudView are great to begin with but you should consider using some more battle-proof library to handle your CRUD views such as django-rest-framework. Such support is then included =)
Let me know if you need more help.
Thank you for your assistance. I'm going for the custom serializer option.
I would like to add an
@property
method to thefields
of aNgCRUDView
, but this is not supported at the moment.Example:
How should I proceed?