#28347: Adding custom attributes to django model field
-------------------------------+--------------------------------------
     Reporter:  Tom Turner     |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Uncategorized  |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by Tom Turner:

Old description:

> I want to add a custom attributes to a Django model field
>

> {{{
> name = models.CharField(max_length=255, **data_merge=True**)
> }}}
>

> I want to do this so i can loop round my fields and see if this field is
> set.
>
> {{{
>         for field in Project._meta.get_fields(include_parents=False,
> include_hidden=False):
>             if field.extra_info.data_merge:
>                    // do something here
> }}}
>
> I haven't been the first to ask for this see
> [https://stackoverflow.com/questions/20679057/adding-custom-attributes-
> to-django-model-field]
>
> If you accept this enhancement I am happy to write a patch, test and
> documentation. Please let me know.

New description:

 I want to add a custom attributes to a Django model field


 {{{
 name = models.CharField(max_length=255, data_merge=True)
 }}}


 I want to do this so i can loop round my fields and see if this field is
 set.

 {{{
         for field in Project._meta.get_fields(include_parents=False,
 include_hidden=False):
             if field.extra_info.data_merge:
                    // do something here
 }}}

 I haven't been the first to ask for this see
 [https://stackoverflow.com/questions/20679057/adding-custom-attributes-to-
 django-model-field]

 If you accept this enhancement I am happy to write a patch, test and
 documentation. Please let me know.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28347#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.0a44523b6323acd4509c65d270924197%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to