Git Product home page Git Product logo

Comments (3)

keubs avatar keubs commented on July 19, 2024

Adding my own comment here since the owner doesn't appear excited to answer. I find it's best to just drop that constraint altogether. You'll have plenty of instances in which the postal_code will differ but the state_code and name in the address_locality table will remain the same. You can fix this with the following steps:

SHOW CREATE TABLE address_locality;

find the index that binds "name" and "state_id", and drop the constraint with that name. In my case, address_locality_name_5eb72081b80e9d3d_uniq.

ALTER TABLE address_locality DROP INDEX address_locality_name_5eb72081b80e9d3d_uniq

from django-address.

keubs avatar keubs commented on July 19, 2024

A little more on this - While the steps above go so far as to remove the database constraint, there is still a built-in constraint living in the model declaration of the app. To remove this, you'll need to open up the models.py file in the app and comment out/delete the line from within the Locality(models.model) declaration that enforces this constraint. On my file, it's line 199: unique_together = ('name', 'state'). Hope this helps!

from django-address.

banagale avatar banagale commented on July 19, 2024

Thank you @keubs for this report. This was resolved as described in #63. Please see #98 for updates on django-address.

from django-address.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.