def set_mongoadmin(self):
if hasattr(self, "<STR_LIT>"):<EOL><INDENT>return None<EOL><DEDENT>if not hasattr(self, "<STR_LIT>"):<EOL><INDENT>self.set_mongonaut_base()<EOL><DEDENT>for mongoadmin in self.get_mongoadmins():<EOL><INDENT>for model in mongoadmin['<STR_LIT>'].models:<EOL><INDENT>if model.name == self.document_name:<EOL><INDENT>self.mongoadmin = model.mongoadmin<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if not hasattr(self, "<STR_LIT>"):<EOL><INDENT>raise NoMongoAdminSpecified("<STR_LIT>".format(self.app_label, self.document_name))<EOL><DEDENT>
Returns the MongoAdmin object for an app_label/document_name style view