autonomous-app 0.2.7__py3-none-any.whl → 0.2.9__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.
autonomous/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.7"
1
+ __version__ = "0.2.9"
2
2
 
3
3
  from .logger import log
4
4
  from .model.automodel import AutoModel
autonomous/db/table.py CHANGED
@@ -103,7 +103,6 @@ class Table:
103
103
 
104
104
  def find(self, **search_terms):
105
105
  search_terms = self._convert_to_dot_notation(search_terms)
106
- log(search_terms)
107
106
  result = self._db.find_one(search_terms)
108
107
  if result:
109
108
  result["_id"] = str(result["_id"])
@@ -4,5 +4,5 @@ class DanglingReferenceError(Exception):
4
4
  self.pk = pk
5
5
  self.obj = obj
6
6
  super().__init__(
7
- f"Model relationship error. Most likely failed to clean up dangling reference.\nModel: {model}\npk: {pk}\nResult: {obj}"
7
+ f"Reference to a deleted object.\nModel: {model}\npk: {pk}\nResult: {obj}"
8
8
  )
@@ -341,6 +341,20 @@ class AutoModel(ABC):
341
341
  attribs = cls.table().find(**kwargs)
342
342
  return cls(**attribs) if attribs else None
343
343
 
344
+ def update(self, values):
345
+ """
346
+ Delete this model from the database.
347
+ """
348
+ if not isinstance(values, dict):
349
+ raise ValueError("Values must be a dictionary")
350
+ for k, v in values.items():
351
+ if k in self.attributes or f"_{k}" in self.attributes:
352
+ if getattr(self.__class__, k, None) and getattr(self.__class__, k).fset:
353
+ getattr(self.__class__, k).fset(self, v)
354
+ elif k in self.attributes:
355
+ setattr(self, k, v)
356
+ self.save()
357
+
344
358
  def delete(self):
345
359
  """
346
360
  Delete this model from the database.
@@ -99,12 +99,12 @@ class ImageStorage:
99
99
  def search(self, folder="", **kwargs):
100
100
  imgs = []
101
101
  for f in os.listdir(f"{self.base_path}/{folder}"):
102
- log(f"{self.base_path}/{folder}", f)
102
+ # log(f"{self.base_path}/{folder}", f)
103
103
  img_key = self._get_key(
104
104
  f"{folder}",
105
105
  pkey=f,
106
106
  )
107
- log(img_key)
107
+ # log(img_key)
108
108
  imgs.append(img_key)
109
109
  return imgs
110
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autonomous-app
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Containerized application framework built on Flask with additional libraries and tools for rapid development of web applications.
5
5
  Author-email: Steven A Moore <samoore@binghamton.edu>
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- autonomous/__init__.py,sha256=wqTpYFL82D-fLpDlNzgzolBLQhYNQx4w5G6a0DIZIgE,86
1
+ autonomous/__init__.py,sha256=hrO1rH9OqOj4wOEhHsSikwNItcD8PIrqGROP5gnqQI0,86
2
2
  autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
3
3
  autonomous/logger.py,sha256=hDX3gvbcWiGPvA8pfarih3xHS4aHG_NuNkF8PQfq_pM,1844
4
4
  autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -10,16 +10,16 @@ autonomous/auth/google.py,sha256=cHmqbyNEPTKipc3WkYcD1XPOyqcWEFW0Ks4qJYmGvPw,104
10
10
  autonomous/auth/user.py,sha256=uR0cpPhXizcFM9-9JQbMNKtklOrAmCrRYZHXovZwtAw,2174
11
11
  autonomous/db/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
12
  autonomous/db/autodb.py,sha256=GifrahGJ2dAi8jQOiMIh0pgktcbuKt_1kAXIjKlKVZY,2376
13
- autonomous/db/table.py,sha256=d8X_PsDPdCxDG4EHYzBXN7632NXM92LmfodnFpGGWLw,4608
13
+ autonomous/db/table.py,sha256=geBQ2WZB2Y7t7pVw4jS07hmqg7hOv1YXZelPJehzHnw,4582
14
14
  autonomous/errors/__init__.py,sha256=OruWG9IkAF4LN-OAo5c2K9Dnds4oZFJJQHKaXbQaWnA,59
15
- autonomous/errors/danglingreferenceerror.py,sha256=iHcE6mOgyXvTvc-EhMEzP_Zlo8FpBn0lMjF76V-zkDE,321
15
+ autonomous/errors/danglingreferenceerror.py,sha256=obfNjpn2vsyK4ak-UuuwFTMVzecs1SaeFPshOvnukS8,275
16
16
  autonomous/model/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
17
17
  autonomous/model/autoattribute.py,sha256=q09cORKC6-LpoZ3Ez-lRkd5kxuSFQrB2nA2f9_8k2c8,588
18
- autonomous/model/automodel.py,sha256=ODvaRZQAiLnqwGtFi7PPv42qTyWEvNXHblkajHcFX00,11296
18
+ autonomous/model/automodel.py,sha256=dkeBWG5oPqFDBpm_aLfPJ0EvxQHQQ1VFSIItAfbSGNQ,11853
19
19
  autonomous/model/orm.py,sha256=IJrbp15RmBgF61vLsqcS_VdnAnw9736sLW75_xFYE9Y,2521
20
20
  autonomous/model/serializer.py,sha256=EnjyS-aWFTt1aDtEavR2xAmNGTX75cekTovohBfPhb0,2939
21
21
  autonomous/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- autonomous/storage/imagestorage.py,sha256=blCWTsY1iOjkl5iCijKi_AzcrVzeoymSURd1_v6Uue8,3966
22
+ autonomous/storage/imagestorage.py,sha256=WOBvnpW3VhvliT2pXtaD_Msh1XEAVxqEBELblsvfdtA,3970
23
23
  autonomous/storage/localstorage.py,sha256=FzrR6O9mMGAZt5dDgqzkeOQVfGRXCygR0kksz2MPpwE,2286
24
24
  autonomous/storage/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
25
25
  autonomous/storage/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
@@ -29,8 +29,8 @@ autonomous/storage/version_control/GHVersionControl.py,sha256=VIhVRxe6gJgozFWyhy
29
29
  autonomous/storage/version_control/__init__.py,sha256=tP0bAWYl1RwBRi62HsIidmgyqHuSlCUqwGuKUKKRugc,117
30
30
  autonomous/tasks/__init__.py,sha256=pn7iZ14MhcHUdzcLkfkd4-45wgPP0tXahAz_cFgb_Tg,32
31
31
  autonomous/tasks/autotask.py,sha256=_WQ8w1LyV2FVJ0Ct0FoF9q1W8ClXfS57-omnBb0LNWE,4910
32
- autonomous_app-0.2.7.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
33
- autonomous_app-0.2.7.dist-info/METADATA,sha256=zv4ww3BP5Kc27CeP_76CAgcOHW9Jv3J1RqAIfh-TRSY,4228
34
- autonomous_app-0.2.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
35
- autonomous_app-0.2.7.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
36
- autonomous_app-0.2.7.dist-info/RECORD,,
32
+ autonomous_app-0.2.9.dist-info/LICENSE,sha256=-PHHSuDRkodHo3PEdMkDtoIdmLAOomMq6lsLaOetU8g,1076
33
+ autonomous_app-0.2.9.dist-info/METADATA,sha256=5UPfNXTwY2RuGCEmXe2ZB4VMKCQTj8pmvS-yThhPdtw,4228
34
+ autonomous_app-0.2.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
35
+ autonomous_app-0.2.9.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
36
+ autonomous_app-0.2.9.dist-info/RECORD,,