Skip to content

Commit

Permalink
Merge pull request #18 from helpacket/issue-17
Browse files Browse the repository at this point in the history
Issue 17
  • Loading branch information
garciparedes committed Apr 11, 2020
2 parents 50bd86e + 0871fbc commit 9a3ea8f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

./src/entry_point.sh
# End of https://www.gitignore.io/api/linux,macos,django,python,windows,pycharm+all

src/entry_point.sh
18 changes: 18 additions & 0 deletions src/users/migrations/0002_auto_20200411_1518.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.2 on 2020-04-11 15:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='party',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
]
12 changes: 11 additions & 1 deletion src/users/models/parties/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

from django.db.models import (
Model,
Model, AutoField,
)

logger = logging.getLogger(__name__)
Expand All @@ -12,10 +12,20 @@
class Party(Model):
"""Party model."""

id = AutoField(primary_key=True)

@property
def is_supplier(self) -> bool:
"""Flag to now if the party is a Supplier.
:return: A boolean value.
"""
return hasattr(self, "supplier")

@property
def is_client(self) -> bool:
"""Flag to now if the party is a Client.
:return: A boolean value.
"""
return hasattr(self, "client")

0 comments on commit 9a3ea8f

Please sign in to comment.