-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added python 3 and uuid entity id support
- Loading branch information
Showing
10 changed files
with
95 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
_build | ||
build | ||
django_eav.egg-info/* | ||
*.DS_Store | ||
env/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.3 on 2016-11-04 09:22 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import eav.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('eav', '0002_auto_20161014_0157'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Encounter', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('num', models.PositiveSmallIntegerField()), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Patient', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=12)), | ||
], | ||
), | ||
migrations.AlterField( | ||
model_name='attribute', | ||
name='datatype', | ||
field=eav.fields.EavDatatypeField(choices=[('text', 'Text'), ('float', 'Float'), ('int', 'Integer'), ('date', 'Date'), ('bool', 'True / False'), ('object', 'Django Object'), ('enum', 'Multiple Choice')], max_length=6, verbose_name='data type'), | ||
), | ||
migrations.AddField( | ||
model_name='encounter', | ||
name='patient', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eav.Patient'), | ||
), | ||
migrations.AddField( | ||
model_name='value', | ||
name='entity_uuid', | ||
field=models.UUIDField(blank=True, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='value', | ||
name='entity_id', | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.conf import settings | ||
|
||
|
||
class Utils(object): | ||
ENTITY_ID_TYPES = { | ||
'uuid': 'entity_uuid', | ||
'int': 'entity_id' | ||
} | ||
|
||
def get_eav_entity_id_type(self): | ||
key = getattr(settings, 'EAV_ENTITY_ID_TYPE', 'int') | ||
try: | ||
return self.ENTITY_ID_TYPES[key] | ||
except KeyError: | ||
print('%s not supported, kindly try uuid or int, defaulting to int' % key) | ||
return self.ENTITY_ID_TYPES['int'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Django==1.10.3 | ||
eav-django==1.4.7 |