Comments (4)
The router initializes the serializers at startup to generate the configuration object. So, there isn't any request in the context at that time. But once you get to actually rendering and parsing records the request object should be there. So, you just need to have a check or a fallback when dealing with code that relies on request
. One way to do this would be to wait until to_representation
to load the user information.
from wq.db.
I see now that the request
object is missing in the list queries for parent objects; the context is initialized with the router only:
Line 214 in 6fb0c46
You are right for the simple queries.
from wq.db.
This way I managed to add context.request
to serializers:
https://stackoverflow.com/a/31724701/1762343
from wq.db.
I added the request to the context for parent objects.
from wq.db.
Related Issues (20)
- add_lookups: only pull in id and label for related items HOT 1
- alternative for method overridding
- "This field may not be null." for models.CharField declared with blank=True HOT 2
- no user profile information available in login.json HOT 2
- don't assume nested serializers always have get_wq_config
- server equivalent of wq/app.js _default_attachments
- list_exclude causes fields to not show up in config HOT 6
- update python-social-auth
- default_attachments not passing query string parameters to get_lookup_choices
- Handling of context misses for type filters HOT 4
- BooleanField and NullBooleanField treated as type=string with dump_config HOT 2
- Django 2 support
- Django REST framework requires details field HOT 1
- result_inline.html character encoding issue HOT 2
- DRF 3.10 breaking change HOT 1
- Custom OAuth authentication
- Issue in SPATIALITE_LIBRARY_PATH for Windows os HOT 1
- STATIC Contents are loading HOT 1
- Django 3.1 compatibility HOT 5
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 wq.db.