Skip to content

Commit

Permalink
TCW Add base model to main models file and upgrade module version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekirapapaul committed Aug 9, 2020
1 parent 86a18ef commit 03a4a06
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
18 changes: 18 additions & 0 deletions mpesa/migrations/0004_auto_20200809_1604.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.5 on 2020-08-09 16:04

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('mpesa', '0003_paymenttransaction_order_id'),
]

operations = [
migrations.RenameField(
model_name='wallet',
old_name='uid',
new_name='uuid',
),
]
14 changes: 13 additions & 1 deletion mpesa/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@

from django.db import models
from django.conf import settings
from mpesa.commons.models import BaseModel
import uuid


# Create your models here.
class BaseModel(models.Model):
uuid = models.UUIDField(default=uuid.uuid4, editable=False)
id = models.AutoField(primary_key=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
is_active = models.BooleanField(default=True, blank=True)
is_deleted = models.BooleanField(default=False, blank=True)

class Meta:
abstract = True


class PaymentTransaction(models.Model):
phone_number = models.CharField(max_length=30)
amount = models.DecimalField(('amount'), max_digits=6, decimal_places=2, default=0)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = django-mpesa
version = 1.1
version = 1.3
description = A python library that interfaces safaricoms mpesa apis
long_description = file: README.rst
url = https://www.vorane.com/
Expand Down

0 comments on commit 03a4a06

Please sign in to comment.