Skip to content

Instantly share code, notes, and snippets.

View melinath's full-sized avatar

Stephen Lewis (Burrows) melinath

View GitHub Profile
--[[
Usage:
When running wesnoth, type:
:lua shell()
This will open the shell. Type any lua code you like in the shell. Variables will be stored in a shell-specific environment. The shell defines some additional functions:
clear() :: clears the output area.
close() :: closes the shell.
local game_events = wesnoth.game_events
local time_utils = wesnoth.require "~/add-ons/Brent/lua/time/utils.lua"
-- timedelta is the local time change per turn
timedelta = 4
turns_per_day = 6
local old_on_load = game_events.on_load
function game_events.on_load(cfg)
from django.db import models
class Orange(models.Model):
pass
class BaseClass(models.Model):
field = models.ForeignKey(Orange)
class Meta:
@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
The problem: Running get_view_forms returns an empty queryset even if get_entity_forms(node) would return a non-empty queryset.
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')
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.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
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',