Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename models to have similar names #11

Closed
wants to merge 1 commit into from

Conversation

kiote
Copy link
Contributor

@kiote kiote commented Jan 24, 2016

disconnect cosmopolitan models with django_cities models

related to #8

I did this with several steps, but for commit merged them to one, so here is bit too much happens.

  • renaming Continent -> CosmopolitanContinent, Currency -> CosmopolitanCurrency, ExtraCountry -> CosmopolitanCountry
  • all models were disconnected from base django_cities models (so no references there now).
  • reduced amount of serialisers (please tell me if you think it's not worth it): now all -list and -detail views have name among of params (before -detail views has only id and url).

@pwalsh
Copy link
Member

pwalsh commented Jan 25, 2016

@kiote tests are failing on Travis.

fields=[
('id', models.CharField(serialize=False, primary_key=True, max_length=2)),
('id', models.CharField(max_length=2, serialize=False, primary_key=True)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add the 3 letter variant too. Maybe an array field called codes which lists all the codes for the country (including the one we use as id).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from django_cities we have 3 letters code already: in code3 field (Char, as django_cities offers only one code for one country). Is that enough?

@pwalsh
Copy link
Member

pwalsh commented Jan 25, 2016

Better to keep the serialisers as they were. It is always useful and important to have minimal serialisers for nesting in other objects, especially as payloads get bigger and we add more things.

@kiote
Copy link
Contributor Author

kiote commented Jan 25, 2016

Better to keep the serialisers as they were

Okay, I'll bring them back :)

  disconnect cosmopolitan models with django_cities models

  related to openspending#8
@kiote kiote closed this Jan 27, 2016
@kiote kiote deleted the feature/untied-models2 branch February 22, 2016 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants