django-adapters
django-adapters copied to clipboard
Research input/output prior art
One goal of this project is to improve the interface to models and other data sources.
These were mentioned in #17:
-
xmodelform
- particularly form field factories -
django-betterforms
- particularlyMultiForm
andMultiModelForm
Two more things for inspiration:
https://github.com/Mechrophile/schemagic -- more schemas. https://github.com/TriOptima/tri.form -- more forms, worth checking out.
In schematics http://schematics.readthedocs.io/en/latest/usage/importing.html http://schematics.readthedocs.io/en/latest/usage/exporting.html
Another snippet found when closing old prs:
+
+class MagicApp(AppConfig):
+ name = 'dal_select2'
+
+ def ready(self):
+ MagicFormMetaclass.register_formfield_for_modelfield(
+ model_field=models.ForeignKey,
+ form_field=Select2ModelChoiceField,
+ )
+
+ MagicFormMetaclass.register_formfield_for_modelfield(
+ model_field=models.OneToOneField,
+ form_field=Select2ModelChoiceField,
+ )
+
+ MagicFormMetaclass.register_formfield_for_modelfield(
+ model_field=models.ManyToManyField,
+ form_field=Select2ModelMultipleChoiceField,
+ )
https://github.com/yourlabs/django-autocomplete-light/pull/579/files
Maybe working maybe not working example :joy: