nsarchive 2.0.0a6__tar.gz → 2.0.0a7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsarchive
3
- Version: 2.0.0a6
3
+ Version: 2.0.0a7
4
4
  Summary: API-wrapper pour récupérer des données liées à Nation
5
5
  License: GPL-3.0
6
6
  Author: happex
@@ -244,7 +244,7 @@ class EconomyInstance(Instance):
244
244
  if type(archive) == Transaction:
245
245
  _data['_type'] = "transaction"
246
246
  else:
247
- _data['_type'] = "unknown"
247
+ _data['_type'] = "action"
248
248
 
249
249
  self._put_in_db('archives', _data)
250
250
 
@@ -167,8 +167,20 @@ class EntityInstance(Instance):
167
167
  - `list[Entity | User | Organization]`
168
168
  """
169
169
 
170
- _res = self.fetch('individuals', **query)
171
- _res.extend(self.fetch('organizations', **query))
170
+ if "_type" in query.keys():
171
+ if query["_type"] == "individual":
172
+ del query["_type"]
173
+ _res = self.fetch('individuals', **query)
174
+ elif query["_type"] == "organization":
175
+ del query["_type"]
176
+ _res = self.fetch('organizations', **query)
177
+ else:
178
+ del query["_type"]
179
+ _res = self.fetch('individuals', **query)
180
+ _res.extend(self.fetch('organizations', **query))
181
+ else:
182
+ _res = self.fetch('individuals', **query)
183
+ _res.extend(self.fetch('organizations', **query))
172
184
 
173
185
  return [ self.get_entity(NSID(entity['id'])) for entity in _res if entity is not None ]
174
186
 
@@ -247,7 +259,7 @@ class EntityInstance(Instance):
247
259
  elif type(archive) == Report:
248
260
  _data['_type'] = "report"
249
261
  else:
250
- _data['_type'] = "unknown"
262
+ _data['_type'] = "action"
251
263
 
252
264
  self._put_in_db('archives', _data)
253
265
 
@@ -14,8 +14,8 @@ class RepublicInstance(Instance):
14
14
  Gère les interactions avec les votes, les archives de la république, et les fonctionnaires.
15
15
 
16
16
  ## Informations
17
- - Résultats des votes: `.Vote | .ClosedVote`
18
- - Différentes institutions: `.Institutions | .Administration | .Government | .Assembly | .Court | .PoliceForces`
17
+ - Résultats des votes et procès: `.Vote | .Referendum | .Lawsuit`
18
+ - Différentes institutions: `.State | .Administration | .Government | .Assembly | .Court | .PoliceForces`
19
19
  - Occupants des différents rôles et historique de leurs actions: `.Official`
20
20
  """
21
21
 
@@ -35,7 +35,7 @@ class RepublicInstance(Instance):
35
35
  ID du vote.
36
36
 
37
37
  ## Renvoie
38
- - `.Vote | .ClosedVote`
38
+ - `.Vote | .Referendum | .Lawsuit`
39
39
  """
40
40
 
41
41
  id = NSID(id)
@@ -60,7 +60,7 @@ class RepublicInstance(Instance):
60
60
 
61
61
  return vote
62
62
 
63
- def save_vote(self, vote: Vote | Referendum) -> None:
63
+ def save_vote(self, vote: Vote | Referendum | Lawsuit) -> None:
64
64
  """Sauvegarde un vote dans la base de données."""
65
65
 
66
66
  vote.id = NSID(vote.id)
@@ -222,7 +222,7 @@ class RepublicInstance(Instance):
222
222
  elif type(archive) == Demotion:
223
223
  _data['_type'] = "demotion"
224
224
  else:
225
- _data['_type'] = "unknown"
225
+ _data['_type'] = "action"
226
226
 
227
227
  self._put_in_db('archives', _data)
228
228
  self._put_in_db('mandate', _data) # Ajouter les archives à celle du mandat actuel
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nsarchive"
3
- version = "2.0.0-alpha.6"
3
+ version = "2.0.0-alpha.7"
4
4
  description = "API-wrapper pour récupérer des données liées à Nation"
5
5
  authors = ["happex <110610727+okayhappex@users.noreply.github.com>"]
6
6
  license = "GPL-3.0"
File without changes
File without changes