Last active
May 9, 2017 07:13
-
-
Save azpwnz/9ba5dec7aef2bd6323d5da3aa1de323b to your computer and use it in GitHub Desktop.
The way to check whether object has ManyToMany or OneToOne field in Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if hasattr(object, 'some_field'): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment