Validate if foreign Key exists

linkaiyi
Follow

Validate if foreign key exists:

use exists()

    def has_answer(self):
        has_answer = False
        if self.answer.exists():
            has_answer = True
        return has_answer
Object has 0 attachments

Was this article helpful?

This article is viewed 55 times!

0 Comments

Leave a Comment

Support