Coverage for seedboxsync/core/dao/torrent.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-07-26 17:46 +0000

1# 

2# Copyright (C) 2015-2026 Guillaume Kulakowski <guillaume@kulakowski.fr> 

3# 

4# For the full copyright and license information, please view the LICENSE 

5# file that was distributed with this source code. 

6# 

7"""Peewee DAO model for Torrent.""" 

8 

9import datetime 

10from peewee import AutoField, DateTimeField, TextField 

11from seedboxsync.core.dao import SeedboxSyncModel 

12 

13 

14class Torrent(SeedboxSyncModel): 

15 """ 

16 Data Access Object (DAO) representing a torrent. 

17 

18 This model stores basic metadata for a torrent, including its name, 

19 announce URL, and the timestamp when it was sent or added to the system. 

20 

21 Attributes: 

22 id (int): Auto-incremented primary key. 

23 name (str): Name of the torrent. 

24 announce (str): Tracker announce URL. 

25 sent (datetime): Timestamp indicating when the torrent was sent or created. 

26 """ 

27 

28 id = AutoField() 

29 name = TextField() 

30 announce = TextField(null=True) 

31 sent = DateTimeField(default=datetime.datetime.now)