Skip to content

Commit

Permalink
Remove django-pgcrypto-fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
Minglee01 committed Mar 2, 2017
1 parent 26be183 commit 9706aa7
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 102 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Logging for changes made to Django model instances.

Add `model_logging` to your `INSTALLED_APPS`.

This library uses [`django-pgcrypto-fields`](https://github.com/incuna/django-pgcrypto-fields),
which means you will need PGP public and private keys. See the `settings.configure()`
block in `model_logging/tests/run.py` for an (extremely insecure) example.

## Usage

#### Low-level use
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

Upcoming

* BREAKING CHANGE: Remove django-pgcrypto-fields.

### v0.1.0

* Add LogEntry model, together with a supporting serializer and view mixins.
3 changes: 1 addition & 2 deletions model_logging/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import unicode_literals

from django.db import models, migrations
import pgcrypto.fields
from django.conf import settings
import django.utils.timezone

Expand All @@ -21,7 +20,7 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(default=django.utils.timezone.now)),
('operation', models.CharField(max_length=255, choices=[('added', 'Added'), ('removed', 'Removed'), ('modified', 'Modified')])),
('model_path', models.CharField(max_length=255)),
('data', pgcrypto.fields.TextPGPPublicKeyField(default='')),
('data', models.TextField(default='')),
('creator', models.ForeignKey(null=True, related_name='log_entries_created', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(null=True, related_name='log_entries', to=settings.AUTH_USER_MODEL)),
],
Expand Down
3 changes: 1 addition & 2 deletions model_logging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from pgcrypto.fields import TextPGPPublicKeyField


def get_model_path(model):
Expand Down Expand Up @@ -66,7 +65,7 @@ class LogEntry(models.Model):

operation = models.CharField(choices=OPERATION_CHOICES, max_length=255)
model_path = models.CharField(max_length=255)
data = TextPGPPublicKeyField(default='')
data = models.TextField(default='')
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
null=True,
Expand Down
57 changes: 0 additions & 57 deletions model_logging/tests/keys/private.key

This file was deleted.

30 changes: 0 additions & 30 deletions model_logging/tests/keys/public.key

This file was deleted.

6 changes: 0 additions & 6 deletions model_logging/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

INSTALLED_APPS=(
'model_logging',
'pgcrypto',

'django',
'django.contrib.admin',
Expand All @@ -30,11 +29,6 @@
'django.contrib.sessions',
'django.contrib.sites',
),

# Dummy pgcrypto configuration
PGCRYPTO_KEY='so_secure_you_guys',
PUBLIC_PGP_KEY=open('model_logging/tests/keys/public.key').read(),
PRIVATE_PGP_KEY=open('model_logging/tests/keys/private.key').read(),
)


Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


install_requires={
'django-pgcrypto-fields>=1.0.0,<2.0.0',
'simplejson>=3.8.0,<4.0.0',
'djangorestframework>=3.2.4,<4.0.0',
}
Expand Down

0 comments on commit 9706aa7

Please sign in to comment.