def save_model(self, request, obj, form, change): MultiDBModelAdmin.save_model(self, request, obj, form, change) if not change: hep_post = PostInfo.objects.using(self.using).create( post=obj.id, pub_date=obj.pub_date) hep_post.save(using=self.using)
def save_model(self, request, obj, form, change): MultiDBModelAdmin.save_model(self, request, obj, form, change) if not change: hep_member = PersonInfo.objects.using(self.using).create( person=obj.id, kind='AL', position='alumni') hep_member.save(using=self.using)
def get_actions(self, request): ''' Disable entry delete from DB ''' actions = MultiDBModelAdmin.get_actions(self, request) del actions['delete_selected'] return actions
def __init__(self, *parg, **karg): MultiDBModelAdmin.__init__(self, *parg, **karg) self.list_display_links = (None, ) # disable news edit self.__physics_posts = None
def get_actions(self, request): actions = MultiDBModelAdmin.get_actions(self, request) del actions['delete_selected'] return actions
def __init__(self, *parg, **karg): MultiDBModelAdmin.__init__(self, *parg, **karg) self.list_display_links = (None, ) # disable person edit self.__hep_members = None