Skip to content

Instantly share code, notes, and snippets.

View stuross's full-sized avatar

Stuart Ross stuross

  • CNN
  • San Francisco, Ca
View GitHub Profile
@stuross
stuross / gist:1584791
Created January 9, 2012 20:33
change to generickey.js
valueMatches : function(facet, searchTerm, callback) {
if('results' in facets.raw[facet]){
callback(facets.raw[facet].results);
} else{
var app_label = facets.raw[facet].app_label,
model = facet;
// TODO: don't pound the server
$.getJSON("/admin/" + app_label + "/" + model + "/search/", {q: searchTerm}, function(data) {
facets.raw[facet].results = data.results;
@stuross
stuross / gist:1296727
Created October 18, 2011 21:07
article migrations
Traceback (most recent call last):
File "/home/stuart/armstrong/dev/bin/armstrong", line 8, in <module>
load_entry_point('armstrong.cli==1.0.1', 'console_scripts', 'armstrong')()
File "/home/stuart/armstrong/dev/lib/python2.6/site-packages/armstrong/cli/main.py", line 91, in main
func(argv=argv, **kwargs)
File "/home/stuart/armstrong/dev/lib/python2.6/site-packages/armstrong/cli/main.py", line 113, in call_django
execute_manager(settings, argv=new_argv)
File "/home/stuart/armstrong/dev/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/stuart/armstrong/dev/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
class Content(ContentBase):
headline = models.CharField((u'Homepage headline'), max_length=255, blank=True, null=True)
placement_category = models.ForeignKey(Category, blank=True, null=True)
published_objects = PublishedManager()
class Meta:
verbose_name_plural = "Content"
ordering = ['-pub_date']