You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example Model
class UniqueTest(BaseModel):
answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
date = models.DateField()
This discussion was converted from issue #9350 on March 28, 2024 10:16.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Example Model
class UniqueTest(BaseModel):
answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
date = models.DateField()
Sample error response for violation
{
"non_field_errors": [
"The fields answer, subject, date must make a unique set."
]
}
Expected error response
{
"non_field_errors": [
"test error message"
]
}
Beta Was this translation helpful? Give feedback.
All reactions