Skip to content

Commit 7b31ab1

Browse files
committed
The psycopg2 JSONEncoder is the same thing... Issue #6
1 parent 6f01fc3 commit 7b31ab1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

rawl/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ def get_name(self, pk):
5656
import logging
5757
import random
5858
import warnings
59+
import decimal
5960
from enum import IntEnum
6061
from abc import ABC
62+
from json import JSONEncoder
6163
from datetime import datetime
6264
from psycopg2 import sql
63-
from psycopg2.extras import json
6465
from psycopg2.pool import ThreadedConnectionPool
6566
from psycopg2.extensions import (
6667
STATUS_IN_TRANSACTION,
@@ -463,7 +464,7 @@ def all(self):
463464
return self.select("SELECT {0} FROM " + self.table + ";",
464465
self.columns)
465466

466-
class RawlJSONEncoder(json.JSONEncoder):
467+
class RawlJSONEncoder(JSONEncoder):
467468
"""
468469
A JSON encoder that can be used with json.dumps
469470
@@ -476,4 +477,4 @@ def default(self, o):
476477
return o.isoformat()
477478
elif type(o) == RawlResult:
478479
return o.to_dict()
479-
return json.JSONEncoder.default(self, o)
480+
return super(RawlJSONEncoder, self).default(o)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name = 'rawl',
8-
version = '0.2.4b1',
8+
version = '0.2.5b1',
99
description = 'An ugly raw SQL postgresql db layer',
1010
url = 'https://github.com/mikeshultz/rawl',
1111
author = 'Mike Shultz',

0 commit comments

Comments
 (0)