-# -*- coding: utf-8 -*-
-__version__ = (0, 2, 0, 'dev')
+# -*- coding: utf8 -*-
+# (major, minor, bugfix, "pre-alpha" | "alpha" | "beta" | "final", release | 0)
+VERSION = (0, 2, 0, 'alpha', 0)
def get_version():
- version = '%s.%s' % (__version__[0], __version__[1])
- if __version__[2]:
- version = '%s.%s' % (version, __version__[2])
- if __version__[3] != '':
- version = '%s %s' % (version, __version__[3])
+ version = '%s.%s' % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = '%s.%s' % (version, VERSION[2])
+ if VERSION[3:] == ('alpha', 0):
+ version = '%s pre-alpha' % version
+ else:
+ if VERSION[3] != 'final':
+ version = '%s %s %s' % (version, VERSION[3], VERSION[4])
return version
+
# We want to make get_version() available to setup.py even if Django is not
-# available or we are not inside a Django project (so we do distutils stuff).
+# available or we are not inside a Django project.
try:
- # this fails if project settings module isn't configured
- from django.contrib import admin
+ # http://docs.djangoproject.com/en/dev/topics/settings/ says::
+ #
+ # If you don't set DJANGO_SETTINGS_MODULE and don't call configure(),
+ # Django will raise an ImportError exception the first time a setting is
+ # accessed.
+ #
+ from django.conf import settings
+ settings.DEBUG # will raise ImportError if Django isn't configured
except ImportError:
+ # allow get_version() to remain available
import warnings
warnings.warn('django-tables requires Django to be configured (settings) '
'prior to use, however this has not been done. Version information '
from django.template import Context
from .utils import rmprefix, toggleprefix, OrderByTuple, Accessor
from .columns import Column
-from .memory import sort_table
from .rows import Rows, BoundRow
from .columns import Columns
# -*- coding: utf8 -*-
-from distutils.core import setup
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
packages = packages,
data_files = data_files,
cmdclass = cmdclasses,
- requires = ['django(>=1.1)'],
- install_requires = ['django>=1.1']
+ requires = ['Django(>=1.1)'],
+ install_requires = ['Django>=1.1']
)