Releases: Mathison-AG/django-angular-dynamic-forms
Releases · Mathison-AG/django-angular-dynamic-forms
CORS requests, valueChanged emitter
Added ANGULAR_FORM_ABSOLUTE_URLS to django settings for cases where django server and angular are on different hosts/ports (CORS)
- setting this constant to True will instruct backend to emit absolute URLS
added valueChanged emitter to in-page dialogs
- see console output in all controls demo
Custom save method for form data
Custom save method for a form via @form_action
decorator.
Example:
class CityViewSet(AngularFormMixin, viewsets.ModelViewSet):
...
form_layouts = {
'custom': ['name']
}
# form_id + the same parameters as DRF's @action decorator
@form_action(form_id='custom', detail=False, url_path='custom', methods=['GET', 'POST'])
def custom_form_action(self, request):
if request.method == 'POST':
# zipcode is a required field
request.data['zipcode'] = lookup_zipcode(request.data['city'])
return super().create(request)
return super().retrieve(request)
this.dialog.open('/api/1.0/cities/', {
formId: 'custom'
}).subscribe(result => {
console.log(result);
});
Support for creation of objects related by foreign key
class Company(models.Model):
...
class Contact(models.Model):
company = models.ForeignKey(Company)
This release adds means to create (for a given company) a new contact and link it automatically.
See the foreign/create demo for usage details.
Support for M2M fields
0.6.3 version 0.6.3: Angular update
Supporting foreign keys
0.5.44 version 0.5.44: Finished the first iteration of support for foreign k…
First usable release both in NPM & PIP
See the demo for a proof
Error propagation
Propagating errors to formsets, columns and groups
Support for email, fieldsets, groups and columns
See the AllControlsComponent in demo/angular for details