CustomCountryModel not working
See original GitHub issueIssue Description
Checklist
- I have verified that I am using a GIS-enabled database, such as PostGIS or Spatialite.
- I have verified that that issue exists against the
master
branch of django-cities. - I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- I have reduced the issue to the simplest possible case.
- I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
Fresh install, add CustomCountryModel as it is in the example from django-cities, run makemigrations.
INSTALLED_APPS = (
...
# I tried both order
'myapp',
'cities',
)
Environment: Python 3.5.2 Django==1.10.5 django-cities==0.5.0.3 ( installed from github, branch master )
Expected behavior
I think it should do the migration files 😃
Actual behavior
host:~#./manage.py makemigrations
SystemCheckError: System check identified some issues:
ERRORS:
<myapp>.CustomCountryModel.alt_names: (fields.E300) Field defines a relation with model 'AlternativeName', which is either not installed, or is abstract.
<myapp>.CustomCountryModel.alt_names: (fields.E307) The field <myapp>.CustomCountryModel.alt_names was declared with a lazy reference to '<myapp>.alternativename', but app '<myapp>' doesn't provide model 'alternativename'.
<myapp>.CustomCountryModel_alt_names.alternativename: (fields.E307) The field <myapp>.CustomCountryModel_alt_names.alternativename was declared with a lazy reference to '<myapp>.alternativename', but app '<myapp>' doesn't provide model 'alternativename'.
For a quick fix I moved the AlternativeNames model above Place and removed the lazy reference of AlternativeName
Let me know if you need more details.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:22
Top Results From Across the Web
django-cities - Bountysource
The import seems to have some serious reliability issues. While I'm sure some of these aren't due to cities doing the wrong thing....
Read more >[Help] Simple Form gem and custom Country model list not ...
I've got two models that I want to use for select questions in a Simple Form form (Audience and Country). Both have data...
Read more >Django 1.5 custom User model error. "Manager isn't available
But below config seem work for me with latest Dev version. Model.py: class CustomUser(AbstractUser): custom_field = models.ForeignKey(' ...
Read more >django-cities - Python Package Health Analysis - Snyk
The python package django-cities was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >intl-input-phone - npm
Start using intl-input-phone in your project by running `npm i ... in dropdown as well or not, when specify custom country list in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
all this variants not work only variant with swapper in meta work without add to settings file CITIES_COUNTRY_MODEL = ‘geo.CustomCountryModel’ but there are no custom fields in model may be migrations made by django wrong
-- coding: utf-8 --
Generated by Django 1.10 on 2017-07-31 16:44
from future import unicode_literals
from django.conf import settings from django.db import migrations, models import django.db.models.deletion
class Migration(migrations.Migration):
more_data field exists in migration but not in db
Dang, I was hoping it would be an easy fix.
If you make a PR with your changes I’ll review it and merge it in.
As for making sure this doesn’t break in the future, since these issues were caught by Django’s checks framework, I’m thinking I can just make an app with custom/swapped models and run Django’s
check
management command.