Capomastro requirements file installs incompatible version of django

Bug #1414166 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Released
High
Unassigned

Bug Description

I was provisioning a capomastro development environment, the first thing to do after installing deb dependencies and creating the DB is running tests. I ran tox and I got:

ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form ProjectForm needs updating.

I got 29 of these failures.

======================================================================
ERROR: projects.tests.test_views (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: projects.tests.test_views
Traceback (most recent call last):
  File "/usr/lib/python2.7/unittest/loader.py", line 254, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
    __import__(name)
  File "/capomastro/projects/tests/test_views.py", line 25, in <module>
    from projects.views import DependencyDetailView, ProjectDetailView
  File "/capomastro/projects/views.py", line 20, in <module>
    from projects.forms import (
  File "/capomastro/projects/forms.py", line 10, in <module>
    class ProjectForm(forms.ModelForm):
  File "/capomastro/.tox/py27/local/lib/python2.7/site-packages/django/forms/models.py", line 273, in __$ew__
    "needs updating." % name
ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attrib$te is prohibited; form ProjectForm needs updating.

Our requirements.txt file has:

Django>=1.6.1

however, apparently django 1.8a1 (which is what's being pulled when creating the venv) breaks things. I wonder if 1.8a1 should even be available from pypi. Anyway, I downgraded the requirement to 1.7.3 and I see this:

/capomastro/projects/forms.py:10: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form ProjectForm needs updating
  class ProjectForm(forms.ModelForm):

This simple patch takes care of this particular problem (though there's another 1.8 incompatibility which I'll file separately):

diff --git a/projects/forms.py b/projects/forms.py
index 9b09a90..bca81ae 100644
--- a/projects/forms.py
+++ b/projects/forms.py
@@ -14,6 +14,7 @@ class ProjectForm(forms.ModelForm):

     class Meta:
         model = Project
+ fields = "__all__"

     def save(self, commit=True):
         project = super(ProjectForm, self).save(commit=False)

Related branches

Daniel Manrique (roadmr)
Changed in capomastro:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Daniel Manrique (roadmr) wrote :

Django 1.8 will be long-term supported so it would be good to ensure we have no incompatibilities, in case we want to move to 1.8 and stay there for a few years.

Changed in capomastro:
milestone: none → 2015-04
Daniel Manrique (roadmr)
Changed in capomastro:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.