Permalink
Browse files

Added support for south migrations.

  • Loading branch information...
1 parent a014953 commit d531ae4e934adf2e1c4f66ca68d43c3b048c4023 @jakewins jakewins committed May 15, 2011
Showing with 18 additions and 4 deletions.
  1. +17 −2 djmoney/models/fields.py
  2. +1 −2 setup.py
View
@@ -7,8 +7,6 @@
__all__ = ('MoneyField', 'currency_field_name', 'NotSupportedLookup')
currency_field_name = lambda name: "%s_currency" % name
-
-
SUPPORTED_LOOKUPS = ('exact', 'lt', 'gt', 'lte', 'gte')
class NotSupportedLookup(Exception):
@@ -118,3 +116,20 @@ def formfield(self, **kwargs):
defaults = {'form_class': forms.MoneyField}
defaults.update(kwargs)
return super(MoneyField, self).formfield(**defaults)
+
+## South support
+try:
+ from south.modelsinspector import add_introspection_rules
+
+ rules = [
+ ((MoneyField,),
+ [], # No positional args
+ {'default_currency':('default_currency',{})}),
+ ((CurrencyField,),
+ [], # No positional args
+ {}), # No new keyword args
+ ]
+
+ add_introspection_rules(rules, ["^djmoney\.models"])
+except ImportError:
+ pass
View
@@ -16,15 +16,14 @@
version="0.1",
description="Adds support for using money and currency fields in django models and forms. Uses py-moneyed as money implementation, based on python-money django implementation.",
url="https://github.com/jakewins/django-money",
- zip_safe=False,
packages=["djmoney",
"djmoney.forms",
"djmoney.models"],
# Commented out, waiting for pull request to be fulfilled: https://github.com/limist/py-moneyed/pull/1
#install_requires=['setuptools',
# 'Django >= 1.2',
# 'py-moneyed > 0.3'],
- package_dir={"": "src"},
+ package_dir={"": ""},
@domguard

domguard Feb 12, 2012

this breaks setup.py with pip install

@jakewins

jakewins Feb 12, 2012

Contributor

Darn. So the proper way to do this would be to have a src directory, and to roll back the change to this line?

@domguard

domguard Feb 12, 2012

I never used the package_dir setting, what is it good for ?
for example, this : https://github.com/quinode/coop-bar/blob/master/setup.py works fine for pypi

cmdclass = cmdclass,
classifiers=["Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",

0 comments on commit d531ae4

Please sign in to comment.