Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Uno-Takashi committed Jun 18, 2022
1 parent 00299bb commit 36f396e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions django_dynamic_shields/models/DynamicShieldsModel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db.models import Model, CharField, IntegerField, BooleanField, DateTimeField
from django_dynamic_shields.data import ShieldsData


class ShieldsDataModel(Model):
Expand All @@ -15,3 +16,19 @@ class ShieldsDataModel(Model):
style = CharField(max_length=15, default="flat")
cacheSeconds = IntegerField(default=300)
updated_datetime = DateTimeField(auto_now=True)

def get_shields_data(self) -> ShieldsData:
return ShieldsData(
label=self.label,
message=self.message,
color=self.color,
labelColor=self.labelColor,
isError=self.isError,
namedLogo=self.namedLogo,
logoSvg=self.logoSvg,
logoColor=self.logoColor,
logoWidth=self.logoWidth,
logoPosition=self.logoPosition,
style=self.style,
cacheSeconds=self.cacheSeconds,
)
2 changes: 1 addition & 1 deletion django_dynamic_shields/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from django_dynamic_shields.models.DynamicShieldsModel import *
from django_dynamic_shields.models.DynamicShieldsModel import *
1 change: 1 addition & 0 deletions django_dynamic_shields/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from django_dynamic_shields.views.DynamicShieldsView import *

__all__ = ["DynamicShieldsView"]

0 comments on commit 36f396e

Please sign in to comment.