Giter Site home page Giter Site logo

nereid's Introduction

Nereid for Tryton

image

image

Nereid is a web framework built over Flask, with Tryton as an ORM.

Read COPYRIGHT

License

GPL3 - Read LICENSE

Installation

From PyPI using pip:

pip install trytond_nereid

Using github repository:

git clone [email protected]:openlabs/nereid.git
cd nereid
python setup.py install

Translation

Best practice for Nereid Translations is a little bit different from the usual procedure due to the different nature of the translatable messages in Nereid. For best results the following workflow is recommended:

  • Import translations as usual by installing the module with the desired language.
  • Run 'Set translations' to import new messages into the database.
  • This is the additional step recommended in Nereid: Run 'Update translations' just once to get the new translations copied to your language and updated with the proposal evtl. found on an (old) existent string.
  • Run 'Clean translations' to remove obsolete messages, that could lead to errors in translation mechanism and that are needless to translate.
  • Now work on 'Update translations' the second time on a clean set of the actual messages. Don't forget to control and unmark fuzzy messages that got a proposal from an old string.
  • When done, run as usual 'Export translations'.
  • Enjoy!

Note

When working on translations to be included in the upstream package, please work on a clean template tree without customizations.

FAQ

What are the uses of Nereid ?

Nereid can be used to build web applications, that could use Tryton's ORM as a backend. While, there are no inherent limitations which prevent you from using nereid to build any kind of web application, the design decision that we made while building nereid itself are tailored to build application that extend the functionality of the ERP system, like e-commerce system, EDI systems, Customer/Supplier Portals etc.

Why Tryton as a backend ?

Well, why not would be our question to you ? It's scalable, it's flexible and offers the best approach we have seen so far into a declarative coding pattern for model design in any ORM. The unique way Tryton handles inheritance also makes it an excellent choice. In addition to the above, Tryton by default has several modules which make designing business applications faster in comparison to other frameworks.

Let's say that you want to build a customer portal, (which is our example application), all that you need to do from your end is create a module which exposes the information that you want to, and leave other stuff like order management, account management etc to the existing Tryton modules.

Which version of Tryton does nereid use ?

Nereid is available for version 2.0, 2.4, 2.6, 2.8, 3.0 and 3.2.

All versions other than 3.2 and 3.0 are mainteinance only releases.

Now that brings us to how versioning is done

Nereid being a module for tryton, follows the same release process of Tryton with a few differences. The repository is maintained on Github and each version of Nereid is separately maintained on a git branch.

Specific minor releases can be identified from git tags or downloaded from the tags page on github. All minor releases are available on PYPI too.

What is the license of Nereid ?

Nereid follows the same license as that of Tryton which is GPLv3. Have a problem with that ? Contact us and we will be glad to help you out!

How do I install nereid ?

Just clone the module and run the python setup file. It installs all the dependencies too.

$ git clone git://github.com/openlabs/nereid.git
$ cd nereid
$ python setup.py install

Is nereid modular ?

Depends on what you think modular is. For us we think Nereid is modular because you could separate logically different functionality into a separate Tryton module and then the functionality would be available to you depending on what modules are installed in the database that you are accessing.

This also allows modules to be reused. For example, the nereid-catalog module which makes product information available could just be used for a display only catalog and is also used as the cart display module for nereid-webshop - the full eCommerce system.

A little history

The initial goal was to build an e-commerce system over OpenERP/Odoo called Callisto, and we did! It worked, but never scaled on OpenERP. The license sucked (surprise)! and then we saw that most issues we saw with OpenERP don't exist in Tryton. And, we were right.

If you want to know more about why we made these design decisions, feel free to drop us a mail

Authors and Contributors

Nereid was built at Openlabs. It's now opensource, feel free to fork and contribute! Hate us! Just fork You can get hold of @openlabsindia or @sharoonthomas if you have some techy questions to drill with.

Support or Contact

Having trouble with Nereid? Check out the documentation at TODO or contact [email protected] and we’ll help you sort it out.

nereid's People

Contributors

aregee avatar aroraumang avatar gauravbutola avatar goyal1092 avatar kavitanjalisingh avatar mbehrle avatar param107 avatar pokoli avatar prakashpp avatar pritishc avatar raimonesteve avatar shalabhaggarwal avatar tarunbhardwaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nereid's Issues

Use tryton translation system

Currently the translation system is a little bit messy:

  • Tryton translation system is used for tryton models.
  • Babel is used for forms amb template.

IMHO that should be unified into Tryton translation system and drop babel translation system. That will imply that forms and templates strings must be loaded into tryton database.

I've created a tryton patch to simply the addition of custom translation types in tryton [1]. Once this patch merged two new types of translations can be added to tryton: nereid_forms and nereid_templates.

For templating we can use the context to pass the translations to the template and treat it as custom variables. Another option is to create a jinja2 extension[2] that similiar to jinja2.ext.i18n that stores uses tryton database as backend. On both cases Translation set wizard must be overriden in order to search for all the templates in the installed modules and create the not found transaltions. This can be done by searching for _( or {trans} in all the available templates.

For forms, it's difficult for me (as I have a very little knowledge of wtkforms) but maybe we have to develop an extension for wtkforms that integrates it with tryton models and treat fields and error messages like normal tryton fields and error messages.

@sharoonthomas would be great if you can provide some feedback about it.

[1] http://codereview.tryton.org/2431002/
[2] http://www.pocoo.org/~blackbird/jinja2docs/html/extensions.html

Phase I:

  • Ability to extract translatable strings from python code
  • Ability to extract translatable strings from jinja templates
  • ability to extract translation comments from the template for assisting translators
  • Ability to extract the builtin messages from wtforms
  • Implement updating of translations
  • Implement cleaning of translations
  • Test cases for extraction from nereid code
  • Test cases for extraction from nereid_template
  • Test cases for extraction from wtforms
  • Test cases for cleaning and updating

Phase II: Fetch translations from tryton instead of using the current system

  • For python code
  • For wtforms
  • For template
  • Tests for python code translation
  • Tests for template translation
  • Tests for wtforms translation

Phase III: Check ability to export translations

  • Test export of translations
  • Documentation about exporting translations

Phase IV: Write documentation on how to translate nereid

  • Translating core nereid
  • Translating your own nereid module

Optional Tasks

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1896846-use-tryton-translation-system?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

Handle invalid user sessions

If a nereid_user is deleted from tryton and the session still exists in the browser cache, it results in a user error. This needs to be handled.

The best approach could be to delete the session and force the user to login again

RFC: Use decorators for routing

Flask uses decorators for routing URLs to methods, while nereid uses a url database table to do the same.

Explore the possibility of using flask blueprints and getting rid of the URLs from the database table.

the jinja2 cache should be configurable instead of forcing Memcache

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8796056-the-jinja2-cache-should-be-configurable-instead-of-forcing-memcache?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

Template loading improvements

At the moment, nereid uses jinja2.FileSystemLoader for loading templates from a directory which is configured in the application loading script (or the wsgi script).

This introduces a limitation where packages like nereid-project have their own templates bundled, but they need to be manually copied to the template folder when used as one of the several applications a nereid website uses.

The best approach to the problem seems to be having a mechanism to load templates, by looking into multiple places in a predefined order. At first it could look into the local templates folder, followed by template folders in the module package template folders (if they exist). While setting the first preference to a local template directory is easy, setting the order in which template lookup should happen in the modules is quite tricky. For example, nereid-project-agile extends the functionality of nereid-project (in other words nereid-project-agile depends on nereid-project), then the order in which template should be looked up should be:

  1. Local template directory
  2. nereid-project-agile/templates
  3. nereid-project/templates

This could be achieved by hooking into the MODULES global defined in the module graph and using jinja2.PackageLoader to load packages from each of the modules. The jinja2.ChoiceLoader could be used to set the order in which the template loaders should be used.

This change should be completely backward compatible since, the first loading preference is from the local template folder which is the current behavior.

This should also allow some standard templates like activation emails to be shipped with core nereid itself.

Drop crontrib.gravatar

drop crontrib.gravatar because not really required and could be provided by external lib

Add field url_map to tree view of Urls

The current list view of nereid.url_rule does not show the url_map to which the rule is associated to. It would be better to have it as the last column.

Test

Test Descritio

Improve activation and reset using itsdangerous

its dangerous is already a dependency of flask. Nereid reinvents a bunch of activation related logic which could make use of its dangerous. In addition nereid authentication mixes the concept of verifying the login email with activation of the account. By default of course it should do both, but downstream modules should be able to separate this functionality.

  • remove activation_code field
  • add email_verified boolean (default: False, Migration: set True where account is active)
  • add active boolean (default: False, Migration: set True where account is active)
  • Add view for active and disabled (inactive) users
  • Add method get_email_verification_sign which returns a timestampsigned, url_serialised sign with a salt 'verification'
  • Add method get_reset_password_sign which return a timestampsigned, url_serialised sign with a salt 'reset-password'
  • Add method verify_email(self, sign, max_age=24*60*60) which verifies the signature and checks the boolean field email_verified as True
  • Add method activate(self, sign) which calls verify_email and to retain current behavior, sets the active field to True.
  • Change reset_password which currently sets the session to accept a sign in the URL which will be used as verification to set the new password.
  • Since all the above requires a secret_key to be set, update nereid initialization to validate the presence of a secret_key.

Update to latest version of Flask

Nereid is not compatible with the latest version of flask which (on this date) is 0.10.1. Update the codebase to use the latest version.

Handle locale outside ir.translation

At the moment nereid makes language in the IETF BCP format (like: en_US) mandatory on every url. This is not a good design because:

  1. Some sites may not need language (simple ones)
  2. Some sites might want to use the same translations (language) for two locales
  3. The currency association to the language could be moved too as haning a currency field on the ir.language table makes no sense.

The proposal is to add a new model called nereid.website.locale with the following fields:

  • code - the locale code that the user wants to use - it could be 2 character codes like 'ca' or IETF BCP codes like 'en-us'
  • language - Many2One to ir.language
  • currency - The currency associated with the locale (or atleast the default one)

nereid.website would have a many2many relationship with nereid.website.locale

Changing this behavior would mean:

  • Adding new model 'nereid.website.locale' (Raimon)
  • Add default locales en-us(en_US, USD)
  • Adding migration for existing users (Sharoon)
  • Adding request.nereid_locale to wrapper (Sharoon)
  • Updating the url_for method which auto fills the locale code (Sharoon)
  • Updating the dispatcher to lookup language from locale code and then set the language in the context (Sharoon)

Double items in translation table

When updating a database with german localization after having exported the translations to de_DE.po I get the same error as encountered in openlabs/nereid-webshop#73. The issue is caused by double translation items like

2014-07-05 19:28:41 UTC FEHLER: doppelter Schlüsselwert verletzt Unique-Constraint »ir_translation_translation_md5_uniq«
2014-07-05 19:28:41 UTC DETAIL: Schlüssel »(name, res_id, lang, type, src_md5, module)=(tests/test_i18n.py, -1, de_DE, nereid, fba18081da4e1dba0c7598f6ffa39815, nereid)« existiert bereits.
2014-07-05 19:28:41 UTC ANWEISUNG: INSERT INTO "ir_translation" ("create_uid", "create_date", "lang", "src", "name", "type", "overriding_module", "module", "src_md5", "value", "fuzzy", "res_id") VALUES (0, NOW(), 'de_DE', '%(num)d apple', 'tests/test_i18n.py', 'nereid', NULL, 'nereid', 'fba18081da4e1dba0c7598f6ffa39815', '%(num)d apple', false, -1) RETURNING "id"

Not knowing exactly the state of #122 it could be, that the missing server patch caused this behavior. I applied the server patch later after the translation.

I will test once more with a clean installation and the server patch and report the result.

Implement a lazy renderer

Tryton's modularity allows one method in a model to either completely overwrite the functionality of a method from the inheriting model or pick the values with the super method and then manipulate the result.

Nereid view handler method returns a rendered template, which is a string. While modifying the template is possible using the template inheritance provisions, the context itself cannot be manipulated. This could be improved if the returned value is a lazyrender object in which the context can be manipulated and the object is rendered just at the dispatcher layer.

Templates directory when TEMPLATE_PREFIX_WEBSITE_NAME = False

About answer #67 (comment)

Where directory we add templates when TEMPLATE_PREFIX_WEBSITE_NAME = False? In base path app flask next py files? Not more better to create a directory "templates" and add here this templates?

TEMPLATE_PREFIX_WEBSITE_NAME = True
domain/home.jinja
domain/login.jinja
domain/....

TEMPLATE_PREFIX_WEBSITE_NAME = False
templates/home.jinja
templates/login.jinja
templates/....

MemcachedSessionStore should be rename as it is multi-backend support

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8796057-memcachedsessionstore-should-be-rename-as-it-is-multi-backend-support?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

login problems

I have the next error when I try to login:

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
Display the sourcecode for this frameOpen an interactive python shell in this framereturn self.wsgi_app(environ, start_response)
File "/home/usuari/server/trytond/trytond/modules/nereid_iptecno/application.py", line 69, in call
return self.app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/trytond_nereid-3.0.3.0dev-py2.7.egg/nereid/application.py", line 312, in dispatch_request
rv = self._dispatch_request(req)
File "/usr/local/lib/python2.7/dist-packages/trytond_nereid-3.0.3.0dev-py2.7.egg/nereid/application.py", line 356, in _dispatch_request
result = meth(**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/trytond_nereid-3.0.3.0dev-py2.7.egg/trytond/modules/nereid/routing.py", line 258, in login
login.send()
File "/usr/local/lib/python2.7/dist-packages/blinker/base.py", line 268, in send
for receiver in self.receivers_for(sender)]

What should I do?

jsonify import error

I see this error on launching tryton.
trytond_nereid was installed from pypi onto a clean Debian Wheezy host.

Traceback (most recent call last):
  File "/usr/bin/trytond", line 111, in <module>
    trytond.server.TrytonServer(options).run()
  File "/usr/lib/python2.7/dist-packages/trytond/server.py", line 124, in run
    Pool(db_name).init(update=update, lang=lang)
  File "/usr/lib/python2.7/dist-packages/trytond/pool.py", line 140, in init
    self.start()
  File "/usr/lib/python2.7/dist-packages/trytond/pool.py", line 92, in start
    register_classes()
  File "/usr/lib/python2.7/dist-packages/trytond/modules/__init__.py", line 354, in register_classes
    mod_file, pathname, description)
  File "/usr/local/lib/python2.7/dist-packages/trytond/modules/nereid/__init__.py", line 5, in <module>
    from .party import Address, Party, ContactMechanism, NereidUser, Permission, \
  File "/usr/local/lib/python2.7/dist-packages/trytond/modules/nereid/party.py", line 19, in <module>
    from nereid import request, url_for, render_template, login_required, flash, \
  File "/usr/local/lib/python2.7/dist-packages/nereid/__init__.py", line 13, in <module>
    from flask.json import jsonify
ImportError: No module named json

As far as I can see this should be

from flask import jsonify

Add mechanism to translate URLs

As started on #122 we may add a mechanism to add translation to the URL, so an url can be localized.

With the new route decorator introduced on #178, we can use something like:

@route('/product/<uri>')
@route_translation('es_ES', '/producto/<uri>')
def product(self):

This will generate a default route for es_US ('/product/<uri>) and another route for es_ES (`'/producto/').

With this information, we should generate the routes based on website default locale, and website locales. So the following cases will occur.

If website has no locales and website default locale is en_US, the url_for product method must return '/product/<uri>.

If website has no locales and website default locale is es_ES, the url_for product method must return '/producto/<uri>.

If website has multiple locales, the url_for must return the slug in the current transaction locale, prefixed with the variable.

Just started a PoC on https://github.com/pokoli/nereid/tree/route_translations but i think is not as easy as I thought.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1930624-add-mechanism-to-translate-urls?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

Use the newly introduced default_smtp_from

At the moment nereid uses its own configuration variable smtp_from. Tryton 2.8 introduces smtp_default_from_email and the system should default to that.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8795754-use-the-newly-introduced-default_smtp_from?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

Remove dependency on electronic_mail_template

The activation and reset emails are currently sent using electronic_mail_template module. This is suboptimal for the folllowing reasons:

  1. Difficulty in getting the current nereid context into the genshi context of email_template.
  2. Such emails are usually designed by designers and design asset reuse in electronic_mail_template is difficult.
  3. Two more module dependency is reduced.

Feature Request in permissions_required and has_permissions too

Currently permissions_required and has_permissions both of these check for all permissions passed to these decorator/method.

It should be possible to check any of the passed permissions.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2981798-feature-request-in-permissions_required-and-has_permissions-too?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

Use the route() decorator is used to bind a function to a URL

Using a decorator to bind URLs to view functions the canonical way to route URLs in flask. This patch implements the same for nereid and this issue will be used as a reference to why this change is done and the implementation detail.

New design

It is now possible to use a route decorator to bind your URLs to view functions. Example below::

class Product:
    __name__ = 'product.product'

    @classmethod
    @route('/product/<uri>')
    def render_product(cls, uri):
        ...
        return 'Product Information'

Caveats

Methods need to be decorated again if they are implemented in subclasses (mostly in downstream modules). This is easier to explain with an example.

If the code in the above example was from nereid_catalog module and the nereid_webshop module implements this method to make a change in the behavior, then the decorator needs to be applied again.

Example code:

# File: nereid_webshop/product.py

class Product:
    __name__ = 'product.product'

    @classmethod
    @route('/product/<uri>')
    def render_product(cls, uri):
        # Do something here
        # may be call the super function to get the response
        # return the final result
       return render_template('...')

Before

Nereid, until version 3.0.7.0 used xml records which created the rules in the database to bind URLs to view functions which were methods in tryton models. This was required because the URLs (and view functions) change depending on the database (more precisely the modules installed in the database). Since XML records in a module are only created in the database when a module is installed for the specific database, it was an easy way to bind URLs to the corresponding views. However, the approach had its flaws:

  1. URL creation was more complicated than it should have been (define XML, upgrade DB and so on).
  2. Non flaskish - URL routing with decorators is indeed considered a major feature of Flask and nereid should not miss out on it.

Nereid Project : if Connected db is not tryton db , raises error

If the connected database is not the nereid database , the psycopg2 raises following error :

Traceback (most recent call last):
File "application_staging.py", line 60, in <module>
app.initialise()
File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/Nereid-     2.6.0.8-py2.7.egg/nereid/application.py", line 164, in initialise
self.load_backend()
File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/Nereid-2.6.0.8-py2.7.egg/nereid/application.py", line 220, in load_backend
self._pool.init()
File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/trytond-2.6.9-py2.7.egg/trytond/pool.py", line 134, in init
 lang=lang)
 File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/trytond- 2.6.9-py2.7.egg/trytond/modules/__init__.py", line 378, in load_modules
 cursor.execute("SELECT name FROM ir_module_module " \
 File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/trytond-2.6.9- py2.7.egg/trytond/backend/postgresql/database.py", line 309, in execute
 res = self.cursor.execute(sql)
 File "/Users/aregee/.virtualenvs/office/lib/python2.7/site-packages/newrelic-2.10.0.8/newrelic/hooks/database_dbapi2.py", line 25, in execute
 return self.__wrapped__.execute(sql)
 psycopg2.ProgrammingError: relation "ir_module_module" does not exist
 LINE 1: SELECT name FROM ir_module_module WHERE state IN ('installed... 

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8897218-nereid-project-if-connected-db-is-not-tryton-db-raises-error?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F386869&utm_medium=issues&utm_source=github).

use Flask-Login and supporting tools instead of reinventing

Flask-Login [1] seems to be the defacto library for handling logins in flask and is database agnostic.

  • Create and use Flask-Login methods and views
  • Support for Basic Authentication
  • Support for Digest Authentication
  • Support for Token based Authentication

subdivision is always required, even when validators.Required unset

With the following change subdivision remains required in My Account / Add Address:

diff --git a/trytond_nereid/party.py b/trytond_nereid/party.py
index bd2b146..0d57f6a 100644
--- a/trytond_nereid/party.py
+++ b/trytond_nereid/party.py
@@ -28,9 +28,12 @@ class AddressForm(Form):
streetbis = TextField(('Street (Bis)'))
zip = TextField(
('Post Code'), [validators.Required(), ])
city = TextField(_('City'), [validators.Required(), ])

  • #country = SelectField(_('Country'), [validators.Required(), ], coerce=int)
  • country = SelectField(_('Country'))
  • #subdivision = IntegerField(_('State/County'), [validators.Required()])
  • subdivision = IntegerField(_('State/County'))

It is quite unusual to select (or even request) the subdivision in some European countries.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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.