コード例 #1
0
ファイル: models.py プロジェクト: surendrakgp/questov1
    def __init__(self, *args, **kwargs):
        """
        Regular initialization with a custom has_valid_location property.
        Rather than modify the data on import, we mark the location as invalid.
        """

        super(PartnerLibrary, self).__init__(*args, **kwargs)
        self.has_valid_location = self.st.upper() in states.keys()
コード例 #2
0
ファイル: models.py プロジェクト: surendrakgp/questov1
    def save(self, *args, **kwargs):
        self.has_valid_location = self.st.upper() in states.keys()

        super(PartnerLibrary, self).save(*args, **kwargs)