Comments (2)
Yest, this is due in part the XLS cell being formatted as a number. One easy way to fix this is to register a custom serializer class with a field that converts the number to int
and then to string
. So, instead of:
# myapp/wizard.py
import data_wizard
from .models import Address
data_wizard.register(Address)
You could do this:
# myapp/wizard.py
from rest_framework import serializers
import data_wizard
from .models import Address
class NumericCharField(serializers.CharField):
def to_internal_value(self, data):
if isinstance(data, float):
data = int(data)
return str(data)
class AddressSerializer(serializers.ModelSerializer):
postal_code = NumericCharField()
class Meta:
model = Address
fields = "__all__"
data_wizard.register('Address with Zip Code', AddressSerializer)
from django-data-wizard.
Thank you very much work really well.
from django-data-wizard.
Related Issues (20)
- ImportError with DRF >= 3.8 HOT 2
- getting 401 Unauthorized when trying to run wizard HOT 5
- Cannot search Natural Key when use unique=True in a NaturalKeyModel HOT 3
- 'NoneType' object has no attribute 'run' HOT 1
- Upon installation admin interface error: Reverse for 'app_list' not found. 'app_list' is not a valid view function or pattern name. HOT 4
- update for wq.app 1.2.0
- Error 403 in GET /datawizard/3/status/ HOT 1
- DataError: integer out of range with Postgres HOT 1
- backend doesn't support absolute paths: Support for non local filesystem HOT 4
- Custom Serializer questions HOT 1
- Debugging HOT 2
- Troubles importing datas when target model has many to many field HOT 1
- django.contrib.admin.sites.AlreadyRegistered: The model Run is already registered in app 'data_wizard'.
- Error Loading Template HOT 1
- ImportError: cannot import name 'MutableMapping' from 'collections' HOT 1
- Did anyone tried it with django 4.06 python 3.10 HOT 1
- No pyproject.toml (poetry) config file HOT 1
- No runtests.sh mentioned in contributing.md and `python -m django test` fails HOT 1
- Failing URL lookup HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-data-wizard.