Merge ssh://holoscopio.com/var/www/cascardo/eventmanager
[cascardo/eventmanager.git] / get_data.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8; -*-
3 """
4 Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public
17 License along with this program; if not, write to the
18 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.
20 """
21 import sys
22 import os
23
24 if '-h' in sys.argv or '--help' in sys.argv:
25     print 'Usage: %s\n' \
26           'Script used to extract data from Trabalho and ' \
27           'Palestrante entities.' % sys.argv[0]
28     sys.exit(0)
29
30 # hackish django setup...
31 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
32 os.environ['DJANGO_SETTINGS_MODULE'] = 'eventmanager.settings'
33
34 from eventos.models import *
35
36 for i in Trabalho.objects.all():
37     for j in i.palestrante.all():
38         print i.titulo + ':' + j.nome + ':' + j.email