[web2py] Re: REF: Change order of fields in a form??!
Probably the easiest way to change order of fields in a form is change the order in which the fields are declared in the db.define_table(Field()...) model. On Friday, January 4, 2013 3:22:51 PM UTC+8, software.ted wrote: How do you change the order of the form after it has been created using: form = SQLFORM(db.table) Also how do you change the font of the web2py editor??? -- ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ --
Re: [web2py] geodal
Hi Massimo, I have just tried a few examples but there is a bug in the getPoint function, please find attached a simple patch to fix it. Paolo On Monday, December 24, 2012 7:21:12 PM UTC+1, Massimo Di Pierro wrote: Thank you Denes. Would you please check my changes. I do not think I broke anything but I tried to make it so that it always returns st_astext if not specified and created Python functions to generate geoPoint/geoLine/geoPolygon. I think it makes code more readable. On Monday, 24 December 2012 12:13:39 UTC-6, DenesL wrote: The original post (Spatial / GIS support in DAL): https://groups.google.com/d/topic/web2py/feh1ksfdkGk/discussion -- diff --git a/gluon/dal.py b/gluon/dal.py index e0bf056..00db5f0 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -9736,7 +9736,7 @@ DAL.Table = Table # was necessary in gluon/globals.py session.connect # Geodal utils -def geoPoint(*line): +def geoPoint(x, y): return POINT (%f %f) % (x,y) def geoLine(*line):
Re: [web2py] geodal
Thanks, will test it tomorrow. Examples with long/lat inserts, extracts and distance comparisons would also be handy for the book. On Sun, Dec 23, 2012 at 4:50 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I made some changes to the DAL geo APIs. This is an experimental feature so we are allowed to make changes. Anyway, the changes should be backward compatible. The only issue is that I am documenting the geodal api in the book and I would not want to change them later. Can you please check them: The DAL supports geographical APIs using PostGIS (for PostgreSQL), spatialite (for SQLite), and MSSQL and Spatial Extensions. DAL provides geometry and geography fields types and the following functions: st_asgeojson (PostGIS only) st_astext st_contained st_contains st_distance st_equals st_intersects st_overlaps st_simplify (PostGIS only) st_touches st_within examples: from gluon.dal import DAL, Field, geoPoint, geoLine, geoPolygon db = DAL(mssql://user:pass@host:db) sp = db.define_table('spatial',Field('loc','geometry()')) sp.insert(loc=geoPoint(1,1)) sp.insert(loc=geoLine((100,100),(20,180),(180,180))) sp.insert(loc=geoPolygon((0,0),(150,0),(150,150),(0,150),(0,0))) print db(sp.id0).select() spatial.id,spatial.loc 1, POINT (1 2) 2, LINESTRING (100 100, 20 180, 180 180) 3, POLYGON ((0 0, 150 0, 150 150, 0 150, 0 0)) query = sp.loc.st_intersects(geoLine((20,120),(60,160))) query = sp.loc.st_overlaps(geoPolygon((1,1),(11,1),(11,11),(11,1),(1,1))) query = sp.loc.st_contains(geoPoint(1,1)) print db(query).select(sp.id,sp.loc) spatial.id,spatial.loc 3,POLYGNON ((0 0, 150 0, 150 150, 0 150, 0 0)) dist = sp.loc.st_distance(geoPoint(-1,2)).with_alias('dist') print db(sp.id0).select(sp.id, dist) spatial.id, dist 1 2.0 2 140.714249456 3 1.0 -- --
[web2py] RESTful authentication with web2py?
How do I set the registration key on registration; or do I need to manually process the form and do it that way? The concept is to be able to grab data statelessly, i.e.: curl -X GET http://localhost/api/my_profile.json?token=stored in REST client from previous login or register Any suggestions on how to do this would be appreciated. Thanks, Alec Taylor --
[web2py] Re: RESTful authentication with web2py?
Try these 2 threads https://groups.google.com/forum/?fromgroups=#!topic/web2py/YVYQHRJmcos -- This is my PhoneGap to web2py experiment https://groups.google.com/forum/?fromgroups=#!topic/web2py/-QPh73Ge2tk -- Native Android to web2py discussion On Saturday, January 5, 2013 7:07:27 AM UTC-6, Alec Taylor wrote: How do I set the registration key on registration; or do I need to manually process the form and do it that way? The concept is to be able to grab data statelessly, i.e.: curl -X GET http://localhost/api/my_profile.json?token=stored in REST client from previous login or register Any suggestions on how to do this would be appreciated. Thanks, Alec Taylor --
[web2py] jQuery function not working in index.html
Hi when using the following functions in index.html only the last one works: {{extend 'layout.html'}} h2index.html/h2 div class=one id=aHello 2/d div class=two id=bWorld 2/d script jQuery('.one').click(function(){ jQuery('.two').slideToggle() }); /script div class=one id=a onclick=jQuery('.two').slideToggle()Hello 3/div div class=two hidden id=bWorld 3/div but when using the first function in layout.html it suddenly works. why is not div class=one id=aHello 2/d div class=two id=bWorld 2/d script jQuery('.one').click(function(){ jQuery('.two').slideToggle() }); /script working in index.html? I thougth jQuery lib was inherited from layout.html? --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
This is a meta-comment regarding the behavior of this group. Last night, when i was answering Massimo's question, i noticed that my post that Massimo was asking about [Jan 4 Hi Derek, ...] showed a* blank line*between the *title item* and the beginning of the *data items* *for each *csv. I don't remember putting those blank lines in. I checked the files from which i copied and pasted and they don't have blank lines either. I don't know how those blank lines got in there. ALSO if you click show quoted text on my answer to Massimo, you will see the way i originally made the post Massimo was asking about. It DOES NOT SHOW THOSE BLANK LINES. Here is how it looked originally. I hope this doesn't change. = begin = Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe = end = Was my post edited somehow? I don't know how to edit a post once it has been posted. Very Strange. I hope one of the web2py group managers can clear this up for me. Thanks for the help in advance. Love and peace, Joe On Friday, January 4, 2013 9:01:58 PM UTC-8, JoeCodeswell wrote: Dear Massimo, You asked: What's the difference between the two? * * *Answer: * *Double quotes* on the one that *worked*. *Single quotes* on the one that *didn't work*. Love and peace, Joe On Friday, January 4, 2013 4:54:01 PM UTC-8, Massimo Di Pierro wrote: What's the difference between the two? On Friday, 4 January 2013 13:36:25 UTC-6, JoeCodeswell wrote: Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860'
[web2py] I installed instaqnt press runing win 8 , I get a page asking wh at i want to search for
I am running windows 8. I have web2py installed and can run some examples. I coded some basic examples and they run. I installed instant press. I get a page in instant press that tells me to enter some search words. When I do, it says it is not found. I cannot find a way to get theinstant press pages that i see in the demo. What is the matter??? --
[web2py] Re: error in mysql ?
thank you all, I look more code to see where the problem originates https://github.com/rochacbruno/Movuca/blob/master/modules/datamodel/setup.py El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please --
[web2py] Re: jQuery function not working in index.html
solved the problem, missing /div closing statement, although I think that was included in the real code On Saturday, January 5, 2013 3:23:00 PM UTC+1, jonas wrote: Hi when using the following functions in index.html only the last one works: {{extend 'layout.html'}} h2index.html/h2 div class=one id=aHello 2/d div class=two id=bWorld 2/d script jQuery('.one').click(function(){ jQuery('.two').slideToggle() }); /script div class=one id=a onclick=jQuery('.two').slideToggle()Hello 3/div div class=two hidden id=bWorld 3/div but when using the first function in layout.html it suddenly works. why is not div class=one id=aHello 2/d div class=two id=bWorld 2/d script jQuery('.one').click(function(){ jQuery('.two').slideToggle() }); /script working in index.html? I thougth jQuery lib was inherited from layout.html? --
Re: [web2py] geodal
I made some changes in trunk. Can you please try again? On Saturday, 5 January 2013 07:05:48 UTC-6, Paolo valleri wrote: Hi, I made a few more tests: from gluon.dal import geoPoint, geoLine, geoPolygon db.define_table('test_geo', Field('loc_test','geometry()')) db.test_geo.insert(loc_test=geoPoint(45.89096,11.0401399)) db.test_geo.insert(loc_test=geoPolygon((0,0),(150,0),(150,150),(0,150),(0, 0))) query = db.test_geo.loc_test.st_contains(geoPoint(1,1)) print db(query).select(db.test_geo.id, db.test_geo.loc_test) dist = db.test_geo.loc_test.st_distance(geoPoint(45.0,11.0)).with_alias( 'dist') print db(db.test_geo.id0).select(db.test_geo.id, dist) dist = db.test_geo.loc_test.st_distance(geoPoint(45.0,11.0)) print db(db.test_geo.id0).select(db.test_geo.id, dist) The results are the following: The first query worked The second query failed with the following error: Traceback (most recent call last): File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/paolo/Dropbox/git/web2py/applications/bikend/models/db.py http://127.0.0.1:8000/admin/default/edit/bikend/models/db.py, line 589, in module print db(db.test_geo.id0).select(db.test_geo.id, dist) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 8975, in select return adapter.select(self.query,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1636, in select return self._select_aux(sql,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1601, in _select_aux self.execute(sql) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1714, in execute return self.log_execute(*a, **b) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1708, in log_execute ret = self.cursor.execute(*a, **b) ProgrammingError: syntax error at or near AS LINE 1: ...GeomFromText('POINT (45.00 11.00)',4326)) AS dist) F... The third one failed with the following error: Traceback (most recent call last): File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/paolo/Dropbox/git/web2py/applications/bikend/models/db.py http://127.0.0.1:8000/admin/default/edit/bikend/models/db.py, line 586, in module print db(db.test_geo.id0).select(db.test_geo.id, dist) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 8975, in select return adapter.select(self.query,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1636, in select return self._select_aux(sql,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1601, in _select_aux self.execute(sql) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1714, in execute return self.log_execute(*a, **b) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1708, in log_execute ret = self.cursor.execute(*a, **b) ProgrammingError: function st_astext(double precision) does not exist LINE 1: SELECT test_geo.id, ST_AsText(ST_Distance(test_geospan style=color: #660;... Show original https://groups.google.com/group/web2py/msg/6ff54d463de23269?dmode=sourceoutput=gplainnoredirect --
Re: [web2py] geodal
If something still fails, can you place post the result of print db(...) _select(...) On Saturday, 5 January 2013 18:45:26 UTC-6, Massimo Di Pierro wrote: I made some changes in trunk. Can you please try again? On Saturday, 5 January 2013 07:05:48 UTC-6, Paolo valleri wrote: Hi, I made a few more tests: from gluon.dal import geoPoint, geoLine, geoPolygon db.define_table('test_geo', Field('loc_test','geometry()')) db.test_geo.insert(loc_test=geoPoint(45.89096,11.0401399)) db.test_geo.insert(loc_test=geoPolygon((0,0),(150,0),(150,150),(0,150),(0 ,0))) query = db.test_geo.loc_test.st_contains(geoPoint(1,1)) print db(query).select(db.test_geo.id, db.test_geo.loc_test) dist = db.test_geo.loc_test.st_distance(geoPoint(45.0,11.0)).with_alias( 'dist') print db(db.test_geo.id0).select(db.test_geo.id, dist) dist = db.test_geo.loc_test.st_distance(geoPoint(45.0,11.0)) print db(db.test_geo.id0).select(db.test_geo.id, dist) The results are the following: The first query worked The second query failed with the following error: Traceback (most recent call last): File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/paolo/Dropbox/git/web2py/applications/bikend/models/db.py http://127.0.0.1:8000/admin/default/edit/bikend/models/db.py, line 589, in module print db(db.test_geo.id0).select(db.test_geo.id, dist) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 8975, in select return adapter.select(self.query,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1636, in select return self._select_aux(sql,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1601, in _select_aux self.execute(sql) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1714, in execute return self.log_execute(*a, **b) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1708, in log_execute ret = self.cursor.execute(*a, **b) ProgrammingError: syntax error at or near AS LINE 1: ...GeomFromText('POINT (45.00 11.00)',4326)) AS dist) F... The third one failed with the following error: Traceback (most recent call last): File /home/paolo/Dropbox/git/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /home/paolo/Dropbox/git/web2py/applications/bikend/models/db.py http://127.0.0.1:8000/admin/default/edit/bikend/models/db.py, line 586, in module print db(db.test_geo.id0).select(db.test_geo.id, dist) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 8975, in select return adapter.select(self.query,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1636, in select return self._select_aux(sql,fields,attributes) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1601, in _select_aux self.execute(sql) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1714, in execute return self.log_execute(*a, **b) File /home/paolo/Dropbox/git/web2py/gluon/dal.py, line 1708, in log_execute ret = self.cursor.execute(*a, **b) ProgrammingError: function st_astext(double precision) does not exist LINE 1: SELECT test_geo.id, ST_AsText(ST_Distance(test_geospan style=color: #660;... Show original https://groups.google.com/group/web2py/msg/6ff54d463de23269?dmode=sourceoutput=gplainnoredirect --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Hello Joe, I do not have an answer. I do not have the ability to edit posts therefore I assume none of the other managers has that ability either. I have found some strange behavior with google groups, for example some posts (including mine) have disappeared. In particular I responded to your last posts and commented that web2py expects CSV in the Excel format and escaped strings are supposed to be double quoted, not single quoted. This post somehow never appeared but googlegroup told me it was posted. Massimo On Saturday, 5 January 2013 10:57:16 UTC-6, JoeCodeswell wrote: This is a meta-comment regarding the behavior of this group. Last night, when i was answering Massimo's question, i noticed that my post that Massimo was asking about [Jan 4 Hi Derek, ...] showed a* blank line* between the *title item* and the beginning of the *data items* *for each *csv. I don't remember putting those blank lines in. I checked the files from which i copied and pasted and they don't have blank lines either. I don't know how those blank lines got in there. ALSO if you click show quoted text on my answer to Massimo, you will see the way i originally made the post Massimo was asking about. It DOES NOT SHOW THOSE BLANK LINES. Here is how it looked originally. I hope this doesn't change. = begin = Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe = end = Was my post edited somehow? I don't know how to edit a post once it has been posted. Very Strange. I hope one of the web2py group managers can clear this up for me. Thanks for the help in advance. Love and peace, Joe On Friday, January 4, 2013 9:01:58 PM UTC-8, JoeCodeswell wrote: Dear Massimo, You asked: What's the difference between the two? * * *Answer: * *Double quotes* on the one that *worked*. *Single quotes* on the one that *didn't work*. Love and peace, Joe On Friday, January 4, 2013 4:54:01 PM UTC-8, Massimo Di Pierro wrote: What's the difference between the two? On Friday, 4 January 2013 13:36:25 UTC-6, JoeCodeswell wrote: Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear
[web2py] Re: I installed instaqnt press runing win 8 , I get a page asking wh at i want to search for
If you do not get an answer I suggest you email the author of InstanPress or submit a big report there. On Saturday, 5 January 2013 12:19:44 UTC-6, jayvandal wrote: I am running windows 8. I have web2py installed and can run some examples. I coded some basic examples and they run. I installed instant press. I get a page in instant press that tells me to enter some search words. When I do, it says it is not found. I cannot find a way to get theinstant press pages that i see in the demo. What is the matter??? --
[web2py] Re: preferred solution for parsing {xht,ht,x}ml
page = a keypress=1 href=kp1.htmlThis is some text 1/a a keypress=2 href=kp2.htmlThis is some text 2/a a keypress=3 href=kp3.htmlThis is some text 3/a html = TAG(page) print html.element('a',_keypress=1)[0] print html.element('a',_keypress=2)[0] print html.element('a',_keypress=3)[0] This should work but web2py parser is based on the built-in Python XML parser which chokes in two cases: invalid XML, non utf8 characters. Massimo On Saturday, 5 January 2013 13:46:49 UTC-6, rh wrote: Hello, After using fetch to get a web page in any of xhtml,html,xml and using the functions/features of web2py what is the preferred and most future-proof way to extract the data from that page? Suppose the page has these within: a keypress=1 href=kp1.htmlThis is some text 1/a a keypress=2 href=kp2.htmlThis is some text 2/a a keypress=3 href=kp3.htmlThis is some text 3/a And if I use web2py what's the preferred way to do it? use web2pyHTMLParser or use DIV, etc. An example would be very helpful too. Should I do this purely with python? --
[web2py] Re: Running web2py on Hostgator Shared hosting!
Sorry revive so late the post, but I need help, I want to run web2py in a subdomain from a dedicated server in Hostgator, now how make to configure a virtualhost with mod_wsgi ? if anyone has any idea how I would appreciate help Thank --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Dear Massimo, Thanks for the reply. Strange behavior indeed. O well. At least we all as individuals seem communicate on this group clearly and respectfully. Thanks for your leadership, Massimo. Love and peace, Joe. On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Dear Massimo, Thanks for the reply. Strange behavior indeed. O well. At least we all as individuals seem communicate on this group clearly and respectfully. Thanks for your leadership, Massimo. Love and peace, Joe. On Saturday, January 5, 2013 4:50:04 PM UTC-8, Massimo Di Pierro wrote: Hello Joe, I do not have an answer. I do not have the ability to edit posts therefore I assume none of the other managers has that ability either. I have found some strange behavior with google groups, for example some posts (including mine) have disappeared. In particular I responded to your last posts and commented that web2py expects CSV in the Excel format and escaped strings are supposed to be double quoted, not single quoted. This post somehow never appeared but googlegroup told me it was posted. Massimo On Saturday, 5 January 2013 10:57:16 UTC-6, JoeCodeswell wrote: This is a meta-comment regarding the behavior of this group. Last night, when i was answering Massimo's question, i noticed that my post that Massimo was asking about [Jan 4 Hi Derek, ...] showed a* blank line* between the *title item* and the beginning of the *data items* *for each *csv. I don't remember putting those blank lines in. I checked the files from which i copied and pasted and they don't have blank lines either. I don't know how those blank lines got in there. ALSO if you click show quoted text on my answer to Massimo, you will see the way i originally made the post Massimo was asking about. It DOES NOT SHOW THOSE BLANK LINES. Here is how it looked originally. I hope this doesn't change. = begin = Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe = end = Was my post edited somehow? I don't know how to edit a post once it has been posted. Very Strange. I hope one of the web2py group managers can clear this up for me. Thanks for the help in advance. Love and peace, Joe On Friday, January 4, 2013 9:01:58 PM UTC-8, JoeCodeswell wrote: Dear Massimo, You asked: What's the difference between the two? * * *Answer: * *Double quotes* on the one that *worked*. *Single quotes* on the one that *didn't work*. Love and peace, Joe On Friday, January 4, 2013 4:54:01 PM UTC-8, Massimo Di Pierro wrote: What's the difference between the two? On Friday, 4 January 2013 13:36:25 UTC-6, JoeCodeswell wrote: Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the