.copy() for serializer .data and .errors dictionaries · encode/django-rest-framework@a16a8a1 (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit a16a8a1
.copy() for serializer .data and .errors dictionaries
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -11,6 +11,9 @@ def __init__(self, *args, **kwargs): | ||
11 | 11 | self.serializer = kwargs.pop('serializer') |
12 | 12 | super(ReturnDict, self).__init__(*args, **kwargs) |
13 | 13 | |
14 | +def copy(self): | |
15 | +return ReturnDict(self, serializer=self.serializer) | |
16 | + | |
14 | 17 | |
15 | 18 | class ReturnList(list): |
16 | 19 | """ |