Permalink
Browse files

add manual loader for the fixture

  • Loading branch information...
1 parent 2c16fd3 commit 812babd1bfdb2e0b1b7e03990927630090225480 @areski areski committed Aug 18, 2012
View
0 country_dialcode/management/__init__.py
No changes.
View
0 country_dialcode/management/commands/__init__.py
No changes.
View
22 country_dialcode/management/commands/load_country_dialcode.py
@@ -0,0 +1,22 @@
+from django.core.management.base import BaseCommand
+from django.core.management import call_command
+import inspect
+import os
+
+
+class Command(BaseCommand):
+ args = ' '
+ help = "Load Dial Code\n"
+
+ option_list = BaseCommand.option_list
+
+ def handle(self, *args, **options):
+ """
+ Load country dialcode
+ """
+ script_directory = os.path.dirname(
+ inspect.getfile(inspect.currentframe()))
+ fixture_file = script_directory + \
+ '/../../fixtures/country_dialcode.json'
+ print "This fixture is going to be loaded : " + fixture_file
+ call_command('loaddata', fixture_file)
View
12 setup.py
@@ -51,14 +51,24 @@ def parse_dependency_links(file_name, install_flag=False):
version = '0.3.0'
+
setup(
name='django-country-dialcode',
version=version,
description='Application providing Dialcode and Countries code',
author='Belaid Arezqui',
author_email='areski@gmail.com',
url='http://github.com/Star2Billing/django-country-dialcode',
- packages=['country_dialcode'],
+ packages=[
+ "country_dialcode",
+ "country_dialcode.management",
+ "country_dialcode.management.commands",
+ ],
+ package_data={
+ "": [
+ "fixtures/*",
+ ]
+ },
include_package_data=True,
download_url='https://github.com/Star2Billing/django-country-dialcode/tarball/master',
zip_safe=False,

0 comments on commit 812babd

Please sign in to comment.