Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add manual loader for the fixture

  • Loading branch information...
commit 812babd1bfdb2e0b1b7e03990927630090225480 1 parent 2c16fd3
Areski Belaid areski authored
0  country_dialcode/management/__init__.py
View
No changes.
0  country_dialcode/management/commands/__init__.py
View
No changes.
22 country_dialcode/management/commands/load_country_dialcode.py
View
@@ -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)
12 setup.py
View
@@ -51,6 +51,7 @@ def parse_dependency_links(file_name, install_flag=False):
version = '0.3.0'
+
setup(
name='django-country-dialcode',
version=version,
@@ -58,7 +59,16 @@ def parse_dependency_links(file_name, install_flag=False):
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,
Please sign in to comment.
Something went wrong with that request. Please try again.