| 1 | | Replying to [ticket:28347 Tom Turner]: |
| 2 | | > I want to add a custom attributes to a Django model field |
| 3 | | > |
| 4 | | > |
| 5 | | > {{{ |
| 6 | | > name = models.CharField(max_length=255, data_merge=True) |
| 7 | | > }}} |
| 8 | | > |
| 9 | | > |
| 10 | | > I want to do this so i can loop round my fields and see if this field is set. |
| 11 | | > |
| 12 | | > {{{ |
| 13 | | > for field in Project._meta.get_fields(include_parents=False, include_hidden=False): |
| 14 | | > if field.extra_info.data_merge: |
| 15 | | > // do something here |
| 16 | | > }}} |
| 17 | | > |
| 18 | | > I haven't been the first to ask for this see [https://stackoverflow.com/questions/20679057/adding-custom-attributes-to-django-model-field] |
| 19 | | > |
| 20 | | > If you accept this enhancement I am happy to write a patch, test and documentation. Please let me know. |
| 21 | | > |