

def get_default(self):
    'Here we check if the default value is an object and return the to_field if so.'
    field_default = super(ForeignKey, self).get_default()
    if isinstance(field_default, self.rel.to):
        return getattr(field_default, self.rel.get_related_field().attname)
    return self

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/models/fields/related.py ForeignKey.get_default/VarMisuse@57/105 `field_default`->`self`