Skip to content

Instantly share code, notes, and snippets.

View ChristinaMeno's full-sized avatar
😎

Christina Meno ChristinaMeno

😎
  • RedHat
  • San Diego
View GitHub Profile
what_i_want = dict(
name = performer.name,
slug = slug,
sound_description = performer.short_bio,
history = performer.long_bio,
eventful_id = performer.id,
primary_category_id = PERFORMER_CATEGORY,
website = website,
)
+ body_text = indexes.CharField(model_attr='bio')
+ body_text = indexes.CharField(model_attr='blurb')
+ body_text = indexes.CharField(model_attr='body')
+ body_text = indexes.CharField(model_attr='caption')
+ body_text = indexes.CharField(model_attr='description')
+ body_text = indexes.CharField(model_attr='description')
+ body_text = indexes.CharField(model_attr='description')
+ body_text = indexes.CharField(model_attr='long_description')
+ body_text = indexes.CharField(model_attr='question')
+ body_text = indexes.CharField(model_attr='story')
# Change this to match your user.
username = 'daniel'
from tastypie.models import ApiKey
from django.contrib.auth.models import User
my_user = User.objects.get(username=username)
key, created = ApiKey.objects.get_or_create(user=my_user)
# Now use key.key for the digest password.
def _build_coherent_name(field, parent):
return parent and '.'.join((parent, field)) or field
def _verify_fields_recursive(expected, data, parent=None):
analysis = {}
for field, field_info in expected.items():
coherent_name = _build_coherent_name(field, parent)
status = field in data and 'found' or 'missing',
>>> thing = type('name', (object,), {'hello':'hello world'})()
>>> thing.hello
'hello world'
class name(object):
hello = 'hello world'
diff --git a/medley/abcs/extensions_admin.py b/medley/abcs/extensions_admin.py
index 90f3db9..2e9a7d4 100644
--- a/medley/abcs/extensions_admin.py
+++ b/medley/abcs/extensions_admin.py
@@ -216,6 +216,7 @@ class MedleyBaseModelAdminForm(BaseModelForm):
def clean_primary_category(self):
primary_category = self.cleaned_data.get('primary_category')
+ return primary_category
if primary_category:
@ChristinaMeno
ChristinaMeno / gist:1118635
Created August 1, 2011 17:55
load_prod_schema_crap
#for jellydoughnut
git checkout prod_schema
unset CMG_LOCAL_VIRTUALENV_VERSION
source three_venv.sh
#activate your VE
load_prod_schema
#for storyville
git checkout crap_fixture
django-admin.py loaddata category_taxonomy.json
diff --git a/medley/medley_ads/tests/test_bulkadload.py b/medley/medley_ads/tests/test_bulkadload.py
index dc2ccb5..5272ea6 100644
--- a/medley/medley_ads/tests/test_bulkadload.py
+++ b/medley/medley_ads/tests/test_bulkadload.py
@@ -2,6 +2,7 @@
Tests for the bulk_ad_load view and new adt_tag
"""
import httplib2
+from datetime import datetime, timedelta
@ChristinaMeno
ChristinaMeno / gist:1347840
Created November 8, 2011 14:21
I need LVM again dang
sudo pvs
sudo lvscan
#if the volgrp is not avail do this
sudo lvchange -a y <volgroup>
sudo mount /dev/ubuntu/root /mnt
<!-- Begin Cox Digital Solutions tag for "Leaderboard" Ad Space (728x90) ID #1000007413807 -->
<script type="text/javascript">
sr_adspace_id = 1000007413807;
sr_adspace_width = 728;
sr_adspace_height = 90;
sr_ad_new_window = true;
sr_adspace_type = "graphic";
sr_k1 = "";
sr_k2 = "";