Comments (13)
Hey @Sibyx I am currently working on other priority work. I will visit this back once I am done with that.
from django_api_forms.
Hello @AmberAnsari89, feel free to take the issue. Basically all you need to know is stated in this issue so read it carefully. If you have any questions feel free to ask. Implementation is suppose to happen in the DictionaryField. Validation is executed in the to_python
and you can mark validation error by raising DetailValidationError
(if you have path to the key in a dictionary) or ValidationError
if you have a generic error. Check existing implementation. Feel free to offer a PR so we can discuss the source code in the more practical way. Let me know if you are going to take the issue.
from django_api_forms.
What would constitute an invalid key?
from django_api_forms.
@harlansgs Hi, I am thinking of possibility to do something like this:
Example request
{
"my_typed_dict": {
"b061bb03-1eaa-47d0-948f-3ce1f15bf3bb": 2.718,
"0a8912f0-6c10-4505-bc27-bbb099d2e395": 42
}
}
Example form
class AlbumForm(Form):
my_typed_dict = DictionaryField(key_field=fields.UUIDFIeld(), value_field=fields.DecimalField())
I am still undecided if it makes sense to have such a "feature". What do you think?
from django_api_forms.
I would like to work on this.
from django_api_forms.
@bumblebee211196 feel free to take the issue :) If you any questions don't hesitate to ask.
from django_api_forms.
@bumblebee211196 feel free to take the issue :) If you any questions don't hesitate to ask.
Sure!. Let me first collect a list of field types we can provide for the keys
and values
in the DictionaryField
. We shall discuss on what to include and what not to include.
from django_api_forms.
Hi @bumblebee211196, I think it is not necessary to specify allowed fields for dictionary keys
and values
. I am aware that not all fields are making sense as keys
, but enforcing such limitations will be a needless complication. If we want to keep the codebase as simple and as fast as possible we can't do everything for the programmer (checking his logical errors). If you have a different opinion I am here to listen of course :)
from django_api_forms.
hi,
i am beginner in python/django..can you help to get a issue to solve at my level?
from django_api_forms.
Hello @Sibyx, is this issue still opened and free to take? Can i take it?
from django_api_forms.
thank you for your reply.. i ready to take the issue however i am new to open source area. so please help me with guidelines and source code and other details to do my analysis and get better insight.
from django_api_forms.
from django_api_forms.
You need to add new parameters to the DictionaryField
constructor (check my example in this issue). Then in the to_python
method you have to call validation (to_python
methods for attributes from the constructor you created).
from django_api_forms.
Related Issues (20)
- Support of additional interchange formats HOT 1
- RRuleField HOT 12
- ModelChoiceField problem with Enum attribute HOT 1
- Raise ValidationError in invalid Data URI by default HOT 3
- Limits for list fields HOT 7
- Property aliases HOT 4
- Population strategies HOT 1
- Empty FormFieldList validation HOT 4
- Linear validation errors HOT 1
- Error in `clean_` methon HOT 1
- Use `Poetry` for install, build and publish instead of `setuptools` and `twine`. HOT 2
- Updating Django Docs Links HOT 3
- Empty cleaned data in clean method
- Exclude key in populate does not work properly. HOT 1
- Additional params in form creation
- Ignore default clean method if error exists
- Add support for TypedDict HOT 3
- FieldList can not show internal field message errors
- Placeholders not filled
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_api_forms.