Permalink
Browse files

Replace fjord.sampledata with django-eadred

I spent some time extracting the sampledata application out as a separate
project so we could use it in Kitsune (and other places as well). This
switches fjord over to using that.

One nice thing eadred has is the ability to pass parameters from the
command line to the generate_sampledata functions. This allows us to
easily allow for different kinds of sample data generation: reproducible
data set for contributors, randomized large data set for testing the
dashboard, icky data set for testing security and unicode handling, ...
  • Loading branch information...
1 parent f803445 commit 9f388a3f88afa770173c45ba9b37488716097967 @willkg willkg committed Sep 27, 2012
View
@@ -13,3 +13,6 @@
[submodule "vendor-local/src/jingo-minify"]
path = vendor-local/src/jingo-minify
url = git://github.com/jsocol/jingo-minify
+[submodule "vendor-local/src/django-eadred"]
+ path = vendor-local/src/django-eadred
+ url = git://github.com/willkg/django-eadred.git
View
@@ -315,7 +315,7 @@ Getting sample data
You can get sample data in your db by running::
- $ ./manage.py sampledata
+ $ ./manage.py generatedata
This will generate a bunch of sample data so that your Fjord instance
has something to look at.
@@ -25,7 +25,7 @@ def create_simple(happy, description, url=u'', ua=FIREFOX_LINUX_17,
return obj
-def generate_sampledata():
+def generate_sampledata(options):
# Create 5 happy opinions.
create_simple(True, u'Firefox is great!')
create_simple(True, u'Made me pancakes!')
No changes.
No changes.
@@ -1,34 +0,0 @@
-import imp
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-from django.utils.importlib import import_module
-
-
-class Command(BaseCommand):
- help = 'Loads sample data--helpful for development.'
-
- def handle(self, *args, **options):
- if not args:
- args = []
-
- for app in settings.INSTALLED_APPS:
- if args and app not in args:
- continue
-
- try:
- app_path = import_module(app).__path__
- except AttributeError:
- continue
-
- try:
- imp.find_module('sampledata', app_path)
- except ImportError:
- continue
-
- module = import_module('%s.sampledata' % app)
- if hasattr(module, 'generate_sampledata'):
- print 'Loading sample data from %s...' % app
- module.generate_sampledata()
-
- print 'Done!'
View
@@ -24,13 +24,13 @@
'django.contrib.admin',
'django_nose',
'djcelery',
+ 'eadred',
'jingo_minify',
'test_utils',
'fjord.analytics',
'fjord.base',
'fjord.feedback',
- 'fjord.sampledata',
'fjord.search',
))
Submodule django-eadred added at 7e0ef4
View
@@ -1,8 +1,9 @@
-src/django-cache-machine
src/django-adminplus
+src/django-cache-machine
+src/django-eadred
src/elasticutils
src/jingo-minify
packages/pyes
-packages/python-memcached
packages/pyquery
+packages/python-memcached
packages/cssselect

0 comments on commit 9f388a3

Please sign in to comment.