Been reading the tutorial for pycon 2010. Fantastic! Very clear!
I have a few questions though, this is my session (some questions have
been inserted between code lines) :

------------------------------------------------------------------------------------------------------------
>>> ci = dabo.db.dConnectInfo(Host='dabodev.com',
...     DbType='MySQL', Database='webtest',
...     User='webuser', PlainTextPassword='foxrocks')
Dabo Error Log: Sun Mar 21 13:44:40 2010: The 'cryptoKey' value has not
been configured in dabo
>>> conn = dabo.db.dConnection(ci)
Dabo Error Log: Sun Mar 21 13:45:12 2010: The 'cryptoKey' value has not
been configured in dabo
Dabo Error Log: Sun Mar 21 13:45:16 2010: The 'cryptoKey' value has not
been configured in dabo

*********************************************************************************
This I have read about it in the list, but I'm not clear. Should I
install PyCrypto and the message will go? I'm guessing no. How should I
configure the cryptoKey value?
*********************************************************************************

>>> biz = dabo.biz.dBizobj(conn)
>>> biz.DataSource = 'zipcodes'
>>> biz.KeyField = 'iid'
>>> biz.addField('iid')
'`iid`'
>>> biz.addField('ccity')
'`iid`,\n       `ccity`'
>>> biz.addField('czip', 'postalcode')
'`iid`,\n       `ccity`,\n       `czip` as `postalcode`'
>>> biz.addWhere("czip like '145%'")
"czip like '145%'"
>>> biz.requery()
>>> print biz.RowCount
65
>>> for rownum in biz.bizIterator() :
...     rec = biz.Record
...     print rownum, rec.ccity, rec.postalcode
...    
0 Penfield 14526
1 Macedon 14502
2 Manchester 14504
3 Marion 14505
4 Mendon 14506
5 Middlesex 14507
6 Morton 14508
7 Mount Morris 14510
8 Mumford 14511
9 Naples 14512
10 Newark 14513
11 North Chili 14514
12 North Greece 14515
13 North Rose 14516
14 Nunda 14517
15 Oaks Corners 14518
16 Ontario 14519
17 Ontario Center 14520
18 Ovid 14521
19 Palmyra 14522
20 Pavilion 14525
21 Penfield 14526
22 Penn Yan 14527
23 Perkinsville 14529
24 Perry 14530
25 Phelps 14532
26 Piffard 14533
27 Pittsford 14534
28 Portageville 14536
29 Port Gibson 14537
30 Pultneyville 14538
31 Retsof 14539
32 Romulus 14541
33 Rose 14542
34 Rush 14543
35 Rushville 14544
36 Scottsburg 14545
37 Scottsville 14546
38 Seneca Castle 14547
39 Shortsville 14548
40 Silver Lake 14549
41 Silver Springs 14550
42 Sodus 14551
43 Sodus Point 14555
44 Sonyea 14556
45 South Byron 14557
46 South Lima 14558
47 Spencerport 14559
48 Springwater 14560
49 Stanley 14561
50 Union Hill 14563
51 Victor 14564
52 Walworth 14568
53 Warsaw 14569
54 Waterport 14571
55 Wayland 14572
56 Webster 14580
57 Webster Cross 14584
58 West Bloomfield 14585
59 West Henrietta 14586
60 Willard 14588
61 Williamson 14589
62 Wolcott 14590
63 Wyoming 14591
64 York 14592
>>> biz.filter('ccity', 'W', 'startswith')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Python25\lib\site-packages\dabo\dabo\biz\dBizobj.py", line
1077, in filter
    self.moveToPK(currPK)
  File "C:\Python25\lib\site-packages\dabo\dabo\biz\dBizobj.py", line
1238, in moveToPK
    raise dabo.dException.RowNotFoundException, _("PK Value %s not found
in the dataset") % pk
TypeError: not enough arguments for format string

*********************************************************************************
What is this Exception? Is it Dabo or am I making some mistake?
And yet the filter gets applied :
*********************************************************************************

>>> for rownum in biz.bizIterator() :
...     rec = biz.Record
...     print rownum, rec.ccity, rec.postalcode
...    
0 Walworth 14568
1 Warsaw 14569
2 Waterport 14571
3 Wayland 14572
4 Webster 14580
5 Webster Cross 14584
6 West Bloomfield 14585
7 West Henrietta 14586
8 Willard 14588
9 Williamson 14589
10 Wolcott 14590
11 Wyoming 14591
------------------------------------------------------------------------------------------------------------

TIA


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to