FAQ
Table of Contents
Feel free to edit this wiki and this page in particular. You can also email questions and feedback to dev-flock@… or, if you prefer a single contact instead of an amorphous list, lucy@….
How do I edit the wiki?
To edit pages, first register for an account by clicking on "Register" from the top-right menu. After logging in, edit pages using the "Edit this page" button at the bottom of the page.
How do I find text on a page?
In this FAQ we might say "click on Foo," eg "click on 'Register' from the top-right menu." How do you find "Foo" quickly? What if you don't see the word "Register"?
Use "Edit --> Find", or the keyboard shortcut "control-F" (apply-F on Mac OS X), to open a search box. Type in the word you're looking for into the search box. Your browser will automatically find and highlight that word on the current webpage (Safari does this *really* well).
How do I attach and show an image on this wiki?
The "Attach File" button should appear at the bottom of the page next to "Edit Page". If it does not and you would like to attach a file please email Lucy.
To show the image use WikiMacros (search page for [[Image]]); eg,
[[Image(photo.jpg, 120)]]
Float the image, eg
[[Image(photo.jpg, 120, right)]]
The size (width) will be in pixels unless you put a '%' afterwards.
How do I insert code on this wiki?
Preformatted (that is, no wiki formatting) text is enclosed in three curly braces. To use WikiProcessors, begin the enclosed text with the magic words:
- #!python
- #!js
- #!c
- #!text/html
eg, to show html for floating a div
{{{
#!text/html
<div style="float:right;">
Boowoop Boo Woop doowoop.
</div>
}}}
How do I insert HTML?
To actually insert html use #!html
{{{
#!html
<div style="float:right;">
Boowoop Boo Woop doowoop.
</div>
}}}
Development Help
If you're new to python have a look at
- Dive Into Python online book
- help(object)
- dir(object)
If you're new to Django we recommend going through the django tutorial. In addition, Django has excellent documentation pages, as well as an online book.
Help displays the docstrings, and dir prints all the attributes (eg, fields, methods). This information is also available through the epydoc APIs:
Interactive Django
In order to access models and project code in external python files or from the shell use:
import lib.django_from_shell
lib.django_from_shell.start_django()That's it. Then you can do things like
n = Node.objects.get(id=3)
Behind the scenes something like this is going on
# directory containing settings.py file -- django_from_shell finds this automatically database_settings = '/var/sites/hm_www' # set up Django environment sys.path.append(database_settings) DJANGO_SETTINGS_MODULE=database_settings from django.core.management import setup_environ import settings setup_environ(settings) from django.db.models import * # set up TAM application environment from db.models import * from db.graph import *
A guide for setting up an interactive django shell in Eclipse.
What are Mixins?
@TODO
What are Actions?
@TODO
ContentType errors
Sqlite bug
Result of select query changes after adding an index
This bug is fixed in the sqlite source code, but the binaries on their website and (probably) on your computer are older and do not contain the fix.
To get the fixed version of sqlite you will need to checkout the code from the repository, configure it, make it and install it. Enter the following commands in order:
| *command* | *description* |
| cd ~/Projects | change directory (cd) to wherever you want to put the sqlite source |
| cvs -d :pserver:anonymous@www.sqlite.org:/sqlite login | add login information for sqlite repository to ~/.cvspass |
| anonymous | password for repository |
| cvs -d :pserver:anonymous@www.sqlite.org:/sqlite checkout -d sqlite_src sqlite | checkout sqlite module from repository into sqlite_src directory on your computer |
| cat sqlite/README | read the install instructions to promote good habits |
| mkdir sqlite_build | separate the build from the source |
| cd sqlite_build | cd to build directory |
| ../sqlite_src/configure | create configuration files in the build directory using the source directory |
| make | compile |
| make install | install. optional, but will put things in the right place |
On Macs, sqlite3 is already installed in /usr/bin/sqlite3
which sqlite3 % /usr/bin/sqlite3
If you need more help, eg with path issues, let us know.