我阅读了几篇文章,但这并不是保存所有这些内容的最佳方式:
startingDir<-"C:/Data/SCRIPTS/R/TextMining/myData"
filez<-list.files(startingDir)
sapply(filez,FUN=function(eachPath){
file.rename(from=eachPath,to=sub(pattern =".LOG",replacement=".DOC",eachPath))
})
答案 0 :(得分:1)
不,这是创建视图的正确方法。
对于大型项目,最好扩展Admin
类以清理代码。
class _Admin(Admin):
def add_model_view(self, model):
self.add_view(ModelView(model, db.session))
def add_model_views(self, models):
for model in models:
self.add_model_view(model)
admin.add_model_views([
User, Personal_User, Curriculum_User,
Skills, Question, TagQuestion,
AnswerLong, Snippet, TagSnippet, CommentSnippet,
])