#23412: Unable to import django.forms.util.ValidationError
-------------------------------+--------------------------------------
     Reporter:  george_edison  |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Forms          |                  Version:  1.7
     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
-------------------------------+--------------------------------------
Changes (by charettes):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 `django.form.util` used to be defined as a side effect of all the imports
 in `django/forms/__init__.py`.

 Since we don't import this module anymore, to prevent firing
 `DeprecatingWarning`s, it's never assigned as a property to the
 `django.forms` module. You can validate this is the case by trying to
 access `forms.util` once you explicitly imported `django.forms.util`.

 {{{
 Python 2.7.6 (default, Mar 22 2014, 22:59:56)
 [GCC 4.8.2] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from django import forms
 >>> forms.util
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 AttributeError: 'module' object has no attribute 'util'
 >>> from django.forms import util
 >>> forms.util
 <module 'django.forms.util' from
 '/home/simon/.virtualenvs/c9a1b5f64fd59792/local/lib/python2.7/site-
 packages/django/forms/util.pyc'>
 }}}

 Since accessing `django.forms.util` without explicitly importing the
 `util` module used to works only because of import side effects I'm
 tempted to mark this ticket as ''won't fix''. I'm not even sure there's a
 way to lazily expose the `util` module to support your case without
 triggering the deprecating warnings.

--
Ticket URL: <https://code.djangoproject.com/ticket/23412#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/071.13970eaca3e3263a5cdd01840dd87d7e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to