MCPcopy
hub / github.com/LawRefBook/Laws / get_laws

Method get_laws

scripts/database.py:77–87  ·  view source on GitHub ↗
(self, name: str = None, publish_at: datetime | str = None)

Source from the content-addressed store, hash-verified

75 })
76
77 def get_laws(self, name: str = None, publish_at: datetime | str = None) -> List[Law]:
78 if publish_at and isinstance(publish_at, datetime):
79 publish_at = publish_at.strftime('%Y-%m-%d')
80 expr = None
81 if name:
82 expr = Law.name == name
83 if publish_at:
84 expr = expr & (Law.publish == publish_at)
85 if expr:
86 return Law.select().where(expr)
87 return Law.select().where(1 == 1)
88
89 def delete_law(self, id):
90 Law.delete_by_id(id)

Callers 3

update_databaseFunction · 0.80
update_statusFunction · 0.80
is_bypassed_lawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected