Commit 66e85eb1 authored by Ashish's avatar Ashish

Updated version, added release notes, fixed flake9 violations

parent 12a298af
......@@ -6,4 +6,11 @@ History
0.1.0 (2014-09-03)
++++++++++++++++++
* First release
\ No newline at end of file
* First release
0.2.0 (2015-07-13)
++++++++++++++++++
* Support for DRF 3.1
* Support for SQLAlchemy 0.9
* Support for Python 3
\ No newline at end of file
......@@ -22,10 +22,11 @@ class AlchemyRelatedField(RelatedField):
pk_field = primary_key(value.__class__)
pk_val = getattr(value, pk_field, None)
return ('{parent}{model}s/{pk}/'
''.format(parent=self.parent_path, model=model_name, pk=pk_val))
''.format(parent=self.parent_path,
model=model_name, pk=pk_val))
except KeyNotFoundException:
# Use actual model name
# Use actual model name
return self.parent_path + model_name + 's/'
......
......@@ -2,7 +2,6 @@
Integration test cases for AlchemyModelViewSet
Uses Django test client
'''
import datetime
import unittest
import mock
......
......@@ -43,15 +43,15 @@ class DeclarativeModel(Base):
datetime = Column(DateTime, default=datetime.datetime.utcnow)
floatfield = Column(Float)
bigintfield = Column(BigInteger)
child_model = relationship(ChildModel, uselist=False, primaryjoin=
(declarativemodel_id == ChildModel.parent_id))
child_model = relationship(ChildModel, uselist=False,
primaryjoin=(declarativemodel_id == ChildModel.parent_id))
#Multiple primary keys
# Multiple primary keys
class CompositeKeysModel(Base):
__tablename__ = 'composite_model'
#This order of PK definition is important
# This order of PK definition is important
pk1 = Column(String, primary_key=True)
pk2 = Column(String, primary_key=True)
compositekeysmodel_id = Column(INTEGER, primary_key=True)
......
......@@ -19,7 +19,7 @@ history = open('HISTORY.rst').read().replace('.. :changelog:', '')
setup(
name='djangorest-alchemy',
version='0.1.3',
version='0.2.0',
description='Django REST Framework and SQLAlchemy integration',
long_description=readme + '\n\n' + history,
author='Ashish Gore',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment