当前位置: 首页>>代码示例>>Python>>正文


Python Album.songs方法代码示例

本文整理汇总了Python中models.Album.songs方法的典型用法代码示例。如果您正苦于以下问题:Python Album.songs方法的具体用法?Python Album.songs怎么用?Python Album.songs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Album的用法示例。


在下文中一共展示了Album.songs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mock_album

# 需要导入模块: from models import Album [as 别名]
# 或者: from models.Album import songs [as 别名]
def mock_album():
    songs = [
        Song(title="You Ain't Goin' Nowhere", track=1, album_id=1, s3_name="Los Angeles 2012-10-26-00.ogg", duration="5:20"),
        Song(title="To Ramona", track=2, album_id=1, s3_name="Los Angeles 2012-10-26-02.ogg", duration="5:01"),
        Song(title="Things Have Changed", track=3, album_id=1, s3_name="Los Angeles 2012-10-26-02.ogg", duration="5:20"),
        Song(title="Tangled Up In Blue", track=4, album_id=1, s3_name="Los Angeles 2012-10-26-03.ogg", duration="6:26"),
        Song(title="The Levee's Gonna Break", track=5, album_id=1, s3_name="Los Angeles 2012-10-26-04.ogg", duration="7:14"),
        Song(title="Make You Feel My Love", track=6, album_id=1, s3_name="Los Angeles 2012-10-26-05.ogg", duration="5:00"),
        Song(title="Cry A While", track=7, album_id=1, s3_name="Los Angeles 2012-10-26-06.ogg", duration="5:42"),
        Song(title="Desolation Row", track=8, album_id=1, s3_name="Los Angeles 2012-10-26-07.ogg", duration="9:08"),
        Song(title="Highway 61 Revisitied", track=9, album_id=1, s3_name="Los Angeles 2012-10-26-08.ogg", duration="7:00"),
        Song(title="Love Sick", track=10, album_id=1, s3_name="Los Angeles 2012-10-26-09.ogg", duration="5:32"),
        Song(title="Thunder on the Mountain", track=11, album_id=1, s3_name="Los Angeles 2012-10-26-10.ogg", duration="7:51"),
        Song(title="Ballad of A Thin Man", track=12, album_id=1, s3_name="Los Angeles 2012-10-26-11.ogg", duration="6:17"),
        Song(title="Like A Rolling Stone", track=13, album_id=1, s3_name="Los Angeles 2012-10-26-12.ogg", duration="6:32"),
        Song(title="All Along the Watchtower", track=14, album_id=1, s3_name="Los Angeles 2012-10-26-13.ogg", duration="6:18"),
        Song(title="Blowin' In the Wind", track=15, album_id=1, s3_name="Los Angeles 2012-10-26-14.ogg", duration="9:02"),
    ]
    album = Album(
        title="Hollywood Bowl 2012",
        date=datetime.date(year=2012, day=26, month=10),
        venue="Hollywood Bowl",
        city="Los Angeles",
        bucket="priestc-dylan",
        folder="hollywood_bowl_2012",
        encoding="ogg q5",
        source="Core Sound micros DPA 4060 with Sony PCM - M10>Hard Drive>Flac"
    )
    album.songs = songs
    return album
开发者ID:priestc,项目名称:dylan,代码行数:32,代码来源:mocks.py


注:本文中的models.Album.songs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。