Jump to: navigation, search

GEPS 013: Gramps Webapp

27 bytes added, 01:53, 26 November 2011
moved src/web to src/webapp and from web.grampsdb to webapp.grampsdb
=== Models/Views ===
Here is the model that defines the Person table from [ src/webwebapp/grampsdb/]:
% cd trunk
% PYTHONPATH=src DJANGO_SETTINGS_MODEL=webwebapp.settings python >>> from webwebapp.grampsdb.models import Person
>>> Person.objects.all()
[<Person>, <Person>, ...]
The first retrieves all of the rows for the Person table; the second retrieves just the one record that has the unique, primary key 1, and the third retrieves the single record that has the unique handle of 'gh71234dhf3746347734'. Note that we never connected onto a database... Django is (currently) define to connect on to one database, and it does it on import. The database is set in src/webwebapp/
An alternative method of interactively talking to the database is to use '''':
% cd trunk/src/web webapp
% PYTHONPATH=../../src python shell
>>> from webwebapp.grampsdb.models import *
>>> Person.objects.filter(gender_type=1)
[<Person>, <Person>, ...]
To see more graphical representations of the data, run "make docs" in the src/webwebapp/ directory, and then look in src/webwebapp/docs/.
=== Templates ===

Navigation menu