ciudadanointeligente / write-it

App to create and send messages to public persons. It's a component of POPLUS project.
poplus.org
GNU General Public License v3.0
38 stars 23 forks source link

Move some models to a new instance app to avoid circular dependencies #1162

Closed mhl closed 8 years ago

mhl commented 8 years ago

There was an unnecessary circular dependency between the 'nuntium' and 'contactos' Django apps:

contactos.Contact needs nuntium (for nuntium.WriteItInstance) nuntium.OutboundMessage needs contactos (for contactos.Contact)

This wouldn't be a big deal, except that when we're migrating to Django 1.7 it means that makemigrations generates multiple initial migrations (0001_initial and 0002_auto..., the latter of which adds the problematic foreign keys). The second of these migrations didn't work properly on Django 1.7 and SQLite, so the easiest way to deal with that upgrade seems to be to:

This pull request deals with the first of those by creating a new 'instance' app, which contains:

WriteItInstance Membership WriteItInstanceConfig WriteitInstancePopitInstanceRecord

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.02%) to 98.451% when pulling 2c98be19a123e0f6a20d705bf21e9b80edbd78c7 on remove-circular-dependencies into d3b833b71923be7da5bb56d71426b224e6d2dd64 on master.

chrismytton commented 8 years ago

Tried this with sqlite and mysql and it's working as expected. So :+1: from me.