geruest fuer sql connect

This commit is contained in:
age 2008-01-06 14:20:10 +00:00
parent 5a4c3805d0
commit 71d00b5d12

View file

@ -3,6 +3,28 @@
import sys
import MySQLdb
prepare_event:
'''hiermit wird eine neue Veranstaltung in passender Form
fuer die VCE Extension vorbereitet'''
#uid = zuletzt in der DB vergebene um eine erhöhen
#pid = haengt von der Elternkategorie ab
#tstamp = mktime(datetime.now().timetuple())
#startdate =
#stat_time =
#wholeday = 0|1
#enddate =
#end_time =
#link =
#description =
#category =
#organizer =
#location =
insert_event:
'''den MySQL Befehl absetzen'''
#INSERT INTO `tx_skcalendar_event` ( `uid` , `pid` , `tstamp` , `crdate` , `cruser_id` , `t3ver_oid` , `t3ver_id` , `t3ver_wsid` , `t3ver_label` , `t3ver_state` , `t3ver_stage` , `t3ver_count` , `t3ver_tstamp` , `t3_origuid` , `sys_language_uid` , `l18n_parent` , `l18n_diffsource` , `deleted` , `hidden` , `fe_group` , `title` , `startdate` , `start_time` , `wholeday` , `enddate` , `end_time` , `link` , `description` , `recurring` , `recurr_until` , `cost` , `targetgroup` , `category` , `organizer` , `location` , `exeptions` , `image` , `dam_image` ) VALUES (self.uid, self.pid, '0', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '', '0', '0', '0', self.title, self.startdate, self.start_time, self.wholeday, self.enddate, self.end_time, self.link, self.description, '0', '0', '0.00', '0', self.category, self.organizer, self.location, '', '', '0');
if __name__ == '__main__':
try:
@ -19,3 +41,14 @@ if __name__ == '__main__':
print "Verbindung getrennt"
sys.exit(0)
'''
## zur Umwandlungs von unix timestamps in mysql un umgekehrt
from time import *
from datetime import *
# von mysql (unix) timestamp in python datetime umwandeln
datetime.fromtimestamp(1199142000)
# und zurueck
mktime((datetime(2008,01,31,21,8,00)).timetuple())
'''