本文整理匯總了Python中models.Album.description方法的典型用法代碼示例。如果您正苦於以下問題:Python Album.description方法的具體用法?Python Album.description怎麽用?Python Album.description使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Album
的用法示例。
在下文中一共展示了Album.description方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: new_album
# 需要導入模塊: from models import Album [as 別名]
# 或者: from models.Album import description [as 別名]
def new_album(self):
form = NewAlbumForm(request.form or None)
if request.method == 'POST' and form.validate():
album = Album()
album_title = request.form['title']
album_description = request.form['description']
album_path, album_thumb = self.gal_man.create_album(album_title)
album.title = album_title
album.description = album_description
album.album_path = album_path
album.thumb_path = album_thumb
album.save()
return redirect(url_for('.show_album', album_id=album.id))
return self.render('admin/new_album.html', form=form)
示例2: post
# 需要導入模塊: from models import Album [as 別名]
# 或者: from models.Album import description [as 別名]
def post(self):
user = get_user()
if user:
album = Album(parent=DEFAULT_DOMAIN_KEY)
album.author = user.key
album.name = self.request.get('album_name')
album.description = self.request.get('album_desc')
album.put()
self.redirect('/album/%s/view' % album.key.integer_id())
else:
self.redirect_to_login()