Skip to content

Instantly share code, notes, and snippets.

View melinath's full-sized avatar

Stephen Lewis (Burrows) melinath

View GitHub Profile
@melinath
melinath / armstrong-requirements.git
Created July 31, 2014 18:09
Armstrong dev requirements
-e git+git://github.com/armstrong/armstrong.cli.git#egg=armstrong.cli
-e git+git://github.com/armstrong/armstrong.core.arm_access.git#egg=armstrong.core.arm_access
-e git+git://github.com/armstrong/armstrong.core.arm_content.git#egg=armstrong.core.arm_content
-e git+git://github.com/armstrong/armstrong.core.arm_layout.git#egg=armstrong.core.arm_layout
-e git+git://github.com/armstrong/armstrong.core.arm_sections.git#egg=armstrong.core.arm_sections
-e git+git://github.com/armstrong/armstrong.core.arm_wells.git#egg=armstrong.core.arm_wells
-e git+git://github.com/armstrong/armstrong.apps.articles.git#egg=armstrong.apps.articles
-e git+git://github.com/armstrong/armstrong.apps.content.git#egg=armstrong.apps.content
-e git+git://github.com/armstrong/armstrong.apps.images.git#egg=armstrong.apps.images
-e git+git://github.com/armstrong/armstrong.apps.related_content.git#egg=armstrong.apps.related_content
@melinath
melinath / dashboard_spec.md
Last active August 29, 2015 14:13
View spec example

These are example view specs for brambling's UserDashboardView and InviteAcceptView.

User dashboard

template: brambling/dashboard.html

Context

  • upcoming_events: A list of public Events that haven't started yet, ordered by how soon they start
  • upcoming_events_interest: A list of public Events in the user's interest groups that haven't started yet, ordered by how soon they start
  • admin_events: A list of Events that the user can edit, ordered by how recently they were edited
  • registered_events: A list of upcoming Events that the user has bought (or started buying) a ticket for, ordered by when the event will start
mysql.host: 'localhost'
mysql.port: 3306
mysql.user: 'mysql'
mysql.pass: ''
mysql.db: 'mysql'
mysql.unix_socket: '/opt/mysql/mysql.sock'
mysql.charset: 'utf8'
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/oberlin/sourcearticle/8/
Django Version: 1.3 pre-alpha SVN-13431
Python Version: 2.6.1
Installed Applications:
['philo',
'django.contrib.auth',
'django.contrib.contenttypes',
from django.db import models
from django.conf import settings
from philo.models import Tag, Titled, Entity, MultiView, Page, register_value_model
from philo.exceptions import ViewCanNotProvideSubpath
from django.conf.urls.defaults import url, patterns, include
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from datetime import datetime
from philo.utils import paginate
from philo.contrib.penfield.validators import validate_pagination_count
class Collection:
#Not for metadata - for personal use.
class Photo:
photographer
caption #default caption (location and people in picture?) and different depending on where it's being displayed
location
date taken
date added to system
from django.test import TestCase
from django.contrib.auth.models import User
from stepping_out.mail.models import UserEmail, MailingList, sync_user_emails
class MailingListTest(TestCase):
def setUp(self):
self.user1 = User.objects.create_user(username="username", password="password")
self.user2 = User.objects.create_user(username="test", password="test")
self.useremail = UserEmail.objects.create(email='mrow@test.com')
The problem: Running get_view_forms returns an empty queryset even if get_entity_forms(node) would return a non-empty queryset.
@melinath
melinath / entity_raw_id_fields.diff
Created January 26, 2011 22:09
Diff of present entity_raw_id_fields branch from current master
diff --git a/contrib/cowell/admin.py b/contrib/cowell/admin.py
new file mode 100644
index 0000000..94df7cb
--- /dev/null
+++ b/contrib/cowell/admin.py
@@ -0,0 +1,107 @@
+from django import forms
+from django.contrib import admin
+from philo.contrib.cowell.fields import ForeignKeyAttribute, ManyToManyAttribute
+from philo.contrib.cowell.forms import ProxyFieldForm, proxy_fields_for_entity_model
from django.db import models
class Orange(models.Model):
pass
class BaseClass(models.Model):
field = models.ForeignKey(Orange)
class Meta: