Avoid UnicodeEncodeError. (#544)

* Fix wrong README format.

* [FIX][base_import_match] Avoid UnicodeEncodeError.

When the model or field you chose was translated and had some non-ascii
character, you got an error like this: `UnicodeEncodeError: 'ascii' codec can't
encode character u'\xed' in position 15: ordinal not in range(128)`.

Now, using unicode strings, that won't happen again.

* Do not require a hidden field.

* Further unicode protection, add ondelete clause.
This commit is contained in:
Jairo Llopis
2016-09-20 13:41:56 +02:00
committed by ernesto
parent 25df7ef68f
commit 5559ac3e60
4 changed files with 18 additions and 16 deletions

View File

@@ -29,18 +29,18 @@ After installing this module, the import logic will be changed to:
- Discard the rules that require fields you are not importing.
- Traverse the remaining rules one by one in order to find a match in the database.
- Skip the rule if it requires a special condition that is not
satisfied.
- If one match is found:
- Skip the rule if it requires a special condition that is not
satisfied.
- If one match is found:
- Stop traversing the rest of valid rules.
- **Update** that record.
- If zero or multiple matches are found:
- Stop traversing the rest of valid rules.
- **Update** that record.
- If zero or multiple matches are found:
- Continue with the next rule.
- If all rules are exhausted and no single match is found:
- Continue with the next rule.
- If all rules are exhausted and no single match is found:
- **Create** a new record.
- **Create** a new record.
- If there are no match rules for your model:
- **Create** a new record.