test = pyp_newclasses.loadPedigree(options,pedsource='db') test.metadata.printme()
Metadata for DB Stream ()
Records: 7
Unique Sires: 3
Unique Dams: 3
Unique Gens: 1
Unique Years: 1
Unique Founders: 4
Unique Herds: 1
Pedigree Code: ASDx
It is possible to load pedigrees from a databse with a format different than that exected by PyPedal, but it requires that you make changes to the NewPedigree class's load method. Consider the database-loading code that is located at about line 250 of pyp_newclasses.py:
251 elif pedsource == 'db': 252 self.kw['pedformat'] = 'ASDx' 253 self.kw['sepchar'] = ',' ... 259 try: 260 # Connect to the database 261 if pyp_db.doesTableExist(self): 262 conn = pyp_db.connectToDatabase(self) 263 if conn: 264 sql = 'SELECT * FROM %s' % ( self.kw['database_table'] ) 265 dbstream = conn.GetAll(sql)
Please note that while I will try and answer questions about the way in which PyPedal handles loading pedigrees from databases, I cannot answer detailed questions about databases to which I do not ave access. You should carefully test your custom queries in SQL to ensure that they are working correctly before adding them to PyPedal. Also, please check your pedigree format string to make sure that it matches your query.
See About this document... for information on suggesting changes.