Go Back   Wolfdog.org forum > Česky > Setkání a cestování

Setkání a cestování Velká a malá - oficiální a soukromá.. Jak a kam cestovat s vlčákem...

 
 
Thread Tools Display Modes
Old 03-07-2012, 19:25   #3
elf
Member
 
Join Date: Oct 2006
Posts: 766
Post

The DB is just plain Python dictionnary dump in a file (WDDB_utf8 ) through pickle, you can convert it to SQLite or MySQL if needed, if you want to see the structure of the DB you can do a DB print with:

import cPickle as pck

f = file("WDDB_utf8", 'rb')
db = pck.load(f)
f.close()

for key in db:
print db[key]

You would see all the entries like e.g.:

{'COIFA': '24.1711914539%', 'BIRTHDAY': '1999.12.27', 'LIVING COUNTRY': 'Slovakia', 'INDEX_FORMAT': 'data not available', 'HIP': 'A(0/0)', 'TRAINING': 'VZ 40km', 'BONITATION':
'A69 C2 K1 Of R1 P1', 'PRA': 'data not available', 'GENDER': 'Male', 'PIC': 'Arek_Maly_Bystrec.jpg', 'FATHER': 'd1184.html', 'COI5G': '18.9611494541%', 'INDEX_HEIGHT': 'data not a
vailable', 'MOTHER': 'd1185.html', 'AVK5G': '54.8387096774%', 'OFFSPRING': ['d6430.html', 'd5187.html', 'd7404.html', 'd5291.html', 'd5189.html', 'd5710.html', 'd5579.html', 'd5184
.html', 'd14438.html', 'd5185.html', 'd8180.html', 'd5186.html', 'd6418.html', 'd7405.html', 'd5709.html', 'd8359.html', 'd8367.html', 'd6426.html', 'd5188.html', 'd5290.html', 'd8
368.html', 'd8323.html', 'd6429.html', 'd5575.html', 'd5288.html', 'd5287.html', 'd5289.html', 'd7410.html', 'd8358.html', 'd6427.html', 'd5292.html', 'd5580.html', 'd5293.html', '
d5576.html', 'd7409.html', 'd5577.html', 'd5286.html', 'd6424.html', 'd7412.html', 'd8360.html', 'd6428.html', 'd5574.html', 'd7407.html', 'd6431.html', 'd5711.html', 'd5578.html',
'd6425.html', 'd7408.html'], 'COAT_LENGHT': 'data not available', 'ED': 'data not available', 'COAT_COLOR': 'data not available', 'ORIGIN COUNTRY': 'Slovakia', 'BREEDER': 'Medveck
\xc3\xbd, Lubo\xc5\xa1 (Mal\xc3\xbd Bysterec )', 'NAME': 'Arek Mal\xc3\xbd Bysterec', 'AVK8G': '30.9803921569%', 'OWNER': 'Lupt\xc3\xa1k, Pavol (od Starkej )', 'LIVING CITY': '\n97
6 44 M\xc3\xbdto pod ?umbierom'}

Then you get each field accessing by key: NAME, HIP, ED, BIRTHDAY etc... Note usage of UTF-8 encoded string.

Quote:
Or is there any other option how to add a new dog into the database other then just add him to the file?
With the source you can easily clone the csv stat site on a server with Python installed (just change in the files SERVER = "http://www.amicale-chien-loup-tchecoslovaque.com/cgi-bin" by you server hostname (yeah lame I know, I never refactor the code...)), and then add a facade to add dogs etc.

Last edited by elf; 03-07-2012 at 19:35.
elf jest offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:12.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
(c) Wolfdog.org