Giter Club home page Giter Club logo

django-localflavor-mx's Introduction

django_localflavor_mx

Country-specific Django helpers for Mexico.

WARNING

This app has been superseded by the newly created django-localflavor app which recombines all the different country locaflavors again (after having been removed from Django). Development and maintenance of this app has stopped and is only left online as a reminder for the users of those apps. It will be removed after grace period of 1 Django release (~spring 2014).

What's in the Mexico localflavor?

  • forms.MXZipCodeField: A form field that accepts a Mexican Zip Code. More info about this: List of postal codes in Mexico (zipcodes)
  • forms.MXRFCField: A form field that validates a Mexican Registro Federal de Contribuyentes for either Persona física or Persona moral. This field accepts RFC strings whether or not it contains a homoclave. More info about this: Registro Federal de Contribuyentes (rfc)
  • forms.MXCURPField: A field that validates a Mexican Clave Única de Registro de Población. More info about this: Clave Unica de Registro de Poblacion (curp)
  • forms.MXStateSelect: A Select widget that uses a list of Mexican states as its choices.
  • forms.MXSocialSecurityNumberField: A field that validates a Mexican Social Security Number(NSS) for Instituto Mexicano del Seguro Social.
  • models.MXStateField: A model field that stores the three-letter Mexican state abbreviation in the database.
  • models.MXZipCodeField: A model field that forms represent as a forms.MXZipCodeField field and stores the five-digit Mexican zip code.
  • models.MXRFCField: A model field that forms represent as a forms.MXRFCField field and stores the value of a valid Mexican RFC.
  • models.MXCURPField: A model field that forms represent as a forms.MXCURPField field and stores the value of a valid Mexican CURP.
  • models.MXSocialSecurityNumberField: A model field that forms represent as a forms.MXSocialSecurityNumberField field and stores the eleven-digit Mexican Social Security Number for Instituto Mexicano del Seguro Social.

Additionally, a choice tuple is provided in django_localflavor_mx.mx_states, allowing customized model and form fields, and form presentations, for subsets of Mexican states abbreviations:

  • mx_states.STATE_CHOICES: A tuple of choices of the states abbreviations for all 31 Mexican states, plus the Distrito Federal.

See the source code for full details.

About localflavors

Django's "localflavor" packages offer additional functionality for particular countries or cultures.

For example, these might include form fields for your country's postal codes, phone number formats or government ID numbers.

This code used to live in Django proper -- in django.contrib.localflavor -- but was separated into standalone packages in Django 1.5 to keep the framework's core clean.

For a full list of available localflavors, see https://github.com/django/

django-localflavor-mx's People

Contributors

aaugustin avatar adrianholovaty avatar alex avatar andres-torres-marroquin avatar claudep avatar gerardo-orozco avatar jacobian avatar jezdez avatar malcolmt avatar

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.