reykit 1.1.91__py3-none-any.whl → 1.1.92__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
reykit/rschedule.py CHANGED
@@ -23,10 +23,25 @@ from .rbase import Base, throw
23
23
 
24
24
 
25
25
  __all__ = (
26
- 'Schedule',
26
+ 'TableSchedule',
27
+ 'Schedule'
27
28
  )
28
29
 
29
30
 
31
+ class TableSchedule(rorm.Model, table=True):
32
+ """
33
+ Database `schedule` table model.
34
+ """
35
+
36
+ __comment__ = 'Schedule execute record table.'
37
+ create_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', not_null=True, index_n=True, comment='Record create time.')
38
+ update_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', index_n=True, comment='Record update time.')
39
+ id: int = rorm.Field(field_type=rorm.types_mysql.INTEGER(unsigned=True), key_auto=True, comment='ID.')
40
+ status: str = rorm.Field(field_type=rorm.types_mysql.TINYINT(unsigned=True), not_null=True, comment='Schedule status, 0 is executing, 1 is completed, 2 is occurred error.')
41
+ task: str = rorm.Field(field_type=rorm.types.VARCHAR(100), not_null=True, comment='Schedule task function name.')
42
+ note: str = rorm.Field(field_type=rorm.types.VARCHAR(500), comment='Schedule note.')
43
+
44
+
30
45
  class Schedule(Base):
31
46
  """
32
47
  Schedule type.
@@ -35,7 +50,6 @@ class Schedule(Base):
35
50
  Attributes
36
51
  ----------
37
52
  db_names : Database table name mapping dictionary.
38
- Error : Database `schedule` table model.
39
53
  """
40
54
 
41
55
  db_names = {
@@ -44,16 +58,6 @@ class Schedule(Base):
44
58
  }
45
59
 
46
60
 
47
- class Schedule(rorm.Model, table=True):
48
- __comment__ = 'Schedule execute record table.'
49
- create_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', not_null=True, index_n=True, comment='Record create time.')
50
- update_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', index_n=True, comment='Record update time.')
51
- id: int = rorm.Field(field_type=rorm.types_mysql.INTEGER(unsigned=True), key_auto=True, comment='ID.')
52
- status: str = rorm.Field(field_type=rorm.types_mysql.TINYINT(unsigned=True), not_null=True, comment='Schedule status, 0 is executing, 1 is completed, 2 is occurred error.')
53
- task: str = rorm.Field(field_type=rorm.types.VARCHAR(100), not_null=True, comment='Schedule task function name.')
54
- note: str = rorm.Field(field_type=rorm.types.VARCHAR(500), comment='Schedule note.')
55
-
56
-
57
61
  def __init__(
58
62
  self,
59
63
  max_workers: int = 10,
@@ -104,7 +108,7 @@ class Schedule(Base):
104
108
  self.db = db
105
109
 
106
110
 
107
- def handle_build_db(self) -> tuple[list[type[Schedule]], list[dict[str, Any]]]:
111
+ def handle_build_db(self) -> tuple[list[type[TableSchedule]], list[dict[str, Any]]]:
108
112
  """
109
113
  Handle method of check and build database tables, by `self.db_names`.
110
114
 
@@ -118,10 +122,10 @@ class Schedule(Base):
118
122
  throw(ValueError, self.db)
119
123
 
120
124
  # Set parameter.
121
- self.Schedule._name(self.db_names['schedule'])
125
+ TableSchedule._set_name(self.db_names['schedule'])
122
126
 
123
127
  ## Table.
124
- tables = [self.Schedule]
128
+ tables = [TableSchedule]
125
129
 
126
130
  ## View stats.
127
131
  views_stats = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.91
3
+ Version: 1.1.92
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -11,7 +11,7 @@ reykit/rnum.py,sha256=jEhPQatAAaIV6kPx2tVtfjuK0F09UCWU6BjfPRamqBE,3620
11
11
  reykit/ros.py,sha256=n9aqChdRQQFozOn_jXQns_UrKoEstCNRzFTgOBel4wM,47787
12
12
  reykit/rrand.py,sha256=kh9yWOW8zaj8bUU0H0RL_GiOs2K8JDviVzKSoPLEuls,8566
13
13
  reykit/rre.py,sha256=uqqved1_SWrJOQK-o5WYRoJf3JH0YpEktnxwA0x7TPU,6018
14
- reykit/rschedule.py,sha256=rXECyOjUUpOTO6gMsl5ehdFSLAQdSy7e7d2QPzDyEwY,12975
14
+ reykit/rschedule.py,sha256=xQeKlGGKAMsLRIdxIBbd3RHw3O2d9bejq9idK9ZoBzQ,12990
15
15
  reykit/rstdout.py,sha256=bLN_kXsWpgTrCrBJNgaEE27DUk-ojsBV-9YJtWH41b4,8188
16
16
  reykit/rsys.py,sha256=PEXUU_jyglEgIyN-URtnpUcrqKF5PFeAVAljEmaSqOs,24931
17
17
  reykit/rtable.py,sha256=ItsycFuN-gb3gYhHuMx_nbAluGc8tAIMOyD5DHPS-lU,12173
@@ -22,7 +22,7 @@ reykit/rwrap.py,sha256=8MqbOjq56DbDKuTix75wYGXcAykzLiAPKrgl13Gk4xQ,15086
22
22
  reykit/rzip.py,sha256=u-yyEFXY5iOysgzzqEbaaDTFfoHBj0L2sv5m4AQLt1c,3450
23
23
  reykit/rdll/__init__.py,sha256=TEVZjiW9Y1_VxbZgIygcwmRp5xFHM2wLgwZccZ6gjng,698
24
24
  reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.91.dist-info/METADATA,sha256=ZbSn5m-l-_BZPVeGZL2xMsKqoMOMh4zSDBma5FrGscI,1872
26
- reykit-1.1.91.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.91.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.91.dist-info/RECORD,,
25
+ reykit-1.1.92.dist-info/METADATA,sha256=yInLHMpchvta0ERsIz57idu5qdNOoJWLJzzuekf-WQQ,1872
26
+ reykit-1.1.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.92.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.92.dist-info/RECORD,,