[web2py] Re: Scheduler - calling functions outside a model?

2013-05-05 Thread Niphlod
Ashley wrote: > > Thanks Niphlod .. > > 1. yes - a 'controller function" scheduled as a task. > 2. routines are in controllers, rather than modules. (some calculations/ > transforms may change regularly) > > On Sunday, 5 May 2013 00:25:30 UTC+10, Niphlod wrote: &g

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-06 Thread Niphlod
On Monday, May 6, 2013 6:51:47 AM UTC+2, Simon Ashley wrote: > > Extending on from my earlier reply, (which hasn't shown up yet), I think > what you're suggesting is to store the code as a module, and import it as > required from a model. Am I correct in assuming that this would have less > per

[web2py] Re: DAL documentation: executesql

2013-05-06 Thread Niphlod
executesql returns you raw data from the table, without applying a "smart parsing" that usually is accomplished by a normal select(). That being said, it's possible that you just need to issue a query that has a weird condition that you can't replicate using standard DAL syntax. E.g. select

Re: [web2py] Re: Limit SQLFORM.grid results

2013-05-06 Thread Niphlod
boys, don't know if you'll use this as a feature or at least a workaround for your requirements, but trunk has for grid a "cache_count" parameter. check this thread https://groups.google.com/d/msg/web2py/yr2z1M2tzIg/iMLP0sKKbjIJ for the docs. -- --- You received this message because you ar

[web2py] Re: trouble ticket shows files as being in mdipiero's home directory?

2013-05-06 Thread Niphlod
it definitely shouldn't be this way. I'll check with Massimo for updating the binary. On Monday, May 6, 2013 8:00:55 PM UTC+2, Anthony wrote: > > The actual files are all in library.zip, which is created by > py2exe. > I'm not sure why it ends up working that way or if i

[web2py] Re: trouble ticket shows files as being in mdipiero's home directory?

2013-05-06 Thread Niphlod
uhm. actually it makes (some) sense. I'll check on my test rig if it's normal or not. On Monday, May 6, 2013 9:07:29 PM UTC+2, Niphlod wrote: > > it definitely shouldn't be this way. I'll check with Massimo for updating > the binary. > > On Monday, May 6, 2

[web2py] Re: trouble ticket shows files as being in mdipiero's home directory?

2013-05-06 Thread Niphlod
ok, the binary I just built shows a path with no reference to where it was compiled File "gluon\restricted.pyc", line 212, in restricted I'll send to Massimo the updated library.zip, it should suffice. On Monday, May 6, 2013 9:15:06 PM UTC+2, Niphlod wrote: > > uhm. ac

Re: [web2py] Re: DAL documentation: executesql

2013-05-07 Thread Niphlod
no problem. you can file a "bug report" so the request for new docs gets "tracked" or (even better) send a patch for updating the book . the source code is on github On Tuesday, May 7, 2013 8:29:38 AM UTC+2, Johann Spies wrote: > Thanks! > > Shouldn't there be something like this explanatio

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-07 Thread Niphlod
this shouldn't be a problem sql.log should be writable . what web2py version are you on ? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+uns

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-07 Thread Niphlod
javascript .. something like $('all a in the menu').click(function(e) { $('all a in the menu').removeClass('highlighted'); $(this).addClass('highlighted'); }) should work . You can even generalize it to highlight the current page url automatically. var path = location.pa

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-07 Thread Niphlod
the page) *[href=$whatever]* - go up in the DOM until you find a li (*closest(li)*) - add a hihglight class (*addclass(highlight)*) On Tuesday, May 7, 2013 6:24:19 PM UTC+2, Omi Chiba wrote: > > Niphlod , thank you for the reply! > > Can you provide me actual code workis on new app? > I&#x

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-07 Thread Niphlod
uhm. funny. I just tested scheduler.py (or any model) def queue_me(): LOAD('default', 'test') default.py controller def test(): db.auth_user.insert(first_name='foo') #just to see if it's db related return 1 and then verified that def anotherindex(): retur

[web2py] Re: Scheduler - calling functions outside a model?

2013-05-08 Thread Niphlod
never never never never run a chdir in web2py environment ... ^_^ Il giorno mercoledì 8 maggio 2013 10:26:49 UTC+2, Simon Ashley ha scritto: > > > Thanks Simone, > > Turned out to be the following: > > path = os.path.join(request.folder, 'data\\') > - os.chdir(path) > - for files in os.l

[web2py] Re: Contribute in book translation - translations sync with original file?

2013-05-08 Thread Niphlod
and there is diffbook to help with that.http://niphlod.github.io/diffbook/ Il giorno mercoledì 8 maggio 2013 17:14:15 UTC+2, Massimo Di Pierro ha scritto: > > It is hard to keep them in sync but you can diff a specific revision/date > and see what has changed in the official edition. > > On Wedn

[web2py] Re: Web Frameworks Performance

2013-05-08 Thread Niphlod
Benchmarks! Time to get some popcorn and sit back... > +1. Don't expect web2py to be the fastest framework. It simply can't, and for a lot of (good) reasons. Nonetheless, it can be improved (as every program out there). > -- --- You received this message because you are subscribed to

[web2py] Re: Why contenttype(".png") is not "image/png" ?

2013-05-08 Thread Niphlod
it's fixed in trunk. if you need it, just copy over the gluon/contenttype.py file, it won't harm your installation. On Wednesday, May 8, 2013 4:36:53 PM UTC+2, Txema Vicente wrote: > > Hello. > > When loading static png, Chrome throws a lot of warnings like: > > Resource interpreted as Image but

[web2py] Re: model not updated in scheduled task

2013-05-08 Thread Niphlod
the task definitely runs in a fresh environment, but as it stands your explanation doesn't give me enough details to build a proof of concept. if you have some - even weird - code that basically looks up the "projects" table to build definitions of tables, then if that piece of code is executed

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-08 Thread Niphlod
gt; 1. Added your javascript code right before tag > 2. Modifiled response.menu in menu.py > > response.menu = [ > (SPAN('Home', _class='highlighted'), False, URL('default', 'index'), > []), > (T('Menu1'), False, URL('defa

[web2py] Re: model not updated in scheduled task

2013-05-08 Thread Niphlod
eduler (i check this by looking at the length of request.env...is there > a better way?) then I just define all the tables. Since it's running on > the scheduler a little overhead isn't going to kill things, but it's not > ideal. > > > > On Wednesday, May 8,

[web2py] Re: How to add class to the TABLE in SQLFORM.grid

2013-05-08 Thread Niphlod
with javascript is the easiest way. You can go on the http://web2py.com/books/default/chapter/29/05#Server-side-DOM-and-parsing method but please do mind that the grid representation may change a bit in the future (it's not yet fixed in stone). Choose carefully your selectors. On Wednesday, May

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-08 Thread Niphlod
t; > > and this is the javascript. No change for CSS. > > > jQuery(function() { > var path = location.pathname.substring(1); > if ( path ) jQuery('ul.nav > a[href$="'+path+'"]').find('span').addClass('highlighted'); >

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-08 Thread Niphlod
ps: if you are on the case where you need to have home highlighted by default no matter what, use this javascript snippet (pretty straightforward) Added also a filter() to exclude the registration/login/etc links from being highlighted jQuery(function() { var path = location.pathname.substring

Re: [web2py] Re: _after_delete callback - how to access info of deleted Set?

2013-05-09 Thread Niphlod
uhm. please take into consideration that you can't hook to the "after_delete" callback if you still want to access the record that has been deleted.. use before_delete for that case. Il giorno giovedì 9 maggio 2013 01:40:49 UTC+2, Jurgis Pralgauskis ha scritto: > > Thanks, > > hm, ok, my u

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-09 Thread Niphlod
> Menu1 highlihgted > Menu2 > > User click Home again... > > Home highlihgted > Menu1 > Menu2 > > > > > > On Wednesday, May 8, 2013 4:34:07 PM UTC-5, Niphlod wrote: >> >> ps: if you are on the case where you need to have home high

[web2py] Re: What would be the best way to optimize/resize images after upload

2013-05-09 Thread Niphlod
there's also a /contrib/imageutils.py ready to use. Il giorno giovedì 9 maggio 2013 07:22:06 UTC+2, weheh ha scritto: > > There are numerous ways to resize uploaded images. Some are done via the > web server. Others are done within the app. For a couple of my apps I use > the python PIL package

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-09 Thread Niphlod
hlight the menu at all. > > Can you quickly check my attached app? > > > On Thursday, May 9, 2013 8:19:31 AM UTC-5, Omi Chiba wrote: >> >> Worked! Thank you~! >> >> On Thursday, May 9, 2013 3:38:41 AM UTC-5, Niphlod wrote: >>> >>> it's exa

[web2py] Re: Dynamically change highlighted class for response.menu

2013-05-09 Thread Niphlod
jQuery(function() { var path = location.pathname.substring(1); if ( path ) { var els = jQuery('ul.nav a[href$="'+path+'"]').filter( "[rel!=nofollow]"); if (els.length != 0) { els.find('span').addClass('highlighted'); } else { jQuery('#default

[web2py] Re: How can Web2py prevent web scraping?

2013-05-09 Thread Niphlod
for "kind" agents a robots.txt suffice. for inconsiderate harvester, usually that kind of work is addressed by either the firewall or the webserver. in web2py either you evaluate the user agent for every request and cut it to a "HTTP(500)" in models or you implement your own rate-limiting, that

[web2py] Re: JQUERY as response in Ajax call?

2013-05-09 Thread Niphlod
if you're using components, use response.js . http://web2py.com/books/default/chapter/29/12?search=response.js On Friday, May 10, 2013 7:10:31 AM UTC+2, Mika Sjöman wrote: > > Hi > > I am trying to close a window title dialog with JQUERY after sucessuflly > updating a clients phone number. Th

[web2py] Re: jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Niphlod
the default function that you're using (ajax()) defined in web2py.js can't handle the "please restrict only to this formname" scenario. it's a bad design choice to have the same input names for different forms. It's a bad design choice to have the same formname for different forms (because of po

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread Niphlod
assuming that your filter is indeed myfilter = db(db.thefilter.name == 'Tops') all_products_that_are_tops = db(db.products.thefilter.belongs(myfilter. _select(db.thefilter.id))) this basically searches all the ids of the "thefilter" table that have a "name" == Tops. Then passes those id to th

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread Niphlod
sorry, I didn't understood what you model was. So, let's say you have products table: id name 1 "foo" 2 "bar" and filters table: id name 1 "top" 2 "sweatshirt" 3 "hoodie" and a product_filter table id product_id filter_id 1 1 1 2 1 2 3 2 3 so, basically, wh

[web2py] Re: Number format using represent

2013-05-10 Thread Niphlod
represent is used in widgets only, it doesn't get called for "raw" representations such as {{=record.column}} if you want to leverage your model's represent, you have to call it {{=db.table.column.represent(record.column, record)}} On Friday, May 10, 2013 6:57:48 PM UTC+2, Omi Chiba wrote: > > I

[web2py] Re: Number format using represent

2013-05-10 Thread Niphlod
locale.format("%.*f", (places, num), True) > > view > -- > {{=number_format(lists.ShipQty,0)}} > > > On Friday, May 10, 2013 2:10:21 PM UTC-5, Niphlod wrote: >> >> represent is used in widgets only, it doesn't get called for "raw" >>

[web2py] Re: Bootstrap tooltip

2013-05-11 Thread Niphlod
are you sure that bootstrap.js is loaded when you call that line ? On Saturday, May 11, 2013 8:53:43 AM UTC+2, Annet wrote: > > In an application created in a previous version of web2py, the Boostrap > tooltip works fine. > > When create an application in web2py 2.4.6 the exact same code no longe

[web2py] Re: IS_IN_DB orderby natural sort?

2013-05-11 Thread Niphlod
IS_IN_DB accepts a "orderby" parameter. On Saturday, May 11, 2013 6:11:41 AM UTC+2, rppowell wrote: > > I have pre-populated a table of types by name: > db.item_type.insert(name='Type1'...) > db.item_type.insert(name='Type2'...) > db.item_type.insert(name='Type3'...) > ... > db.item

Re: [web2py] Re: Voting system not working

2013-05-11 Thread Niphlod
at least you must include web2py.js that includes the javascript function you're using On Saturday, May 11, 2013 1:09:13 AM UTC+2, sasogeek wrote: > > nothing happens, and i think it's because i didn't include layout... > because when i do the exact same thing in the book, it works fine, but

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-11 Thread Niphlod
ok. it adds a layer on top. Basically you want to have all products matching all product_filters that have AT LEAST 2 rows for the same product. here we go. myfilter = ("top", "sweatshirt") top_and_sweatshirts = all_in_one( db.filters.name.belongs(myfilter) ).select(db.products.id, db.pr

[web2py] Re: Bootstrap tooltip

2013-05-11 Thread Niphlod
summing up, whatever you need to use leveraging some js library, that library needs to be loaded already. Probably it will be better to include the bootstrap to the head, so you're sure it will be loaded no matter what. -- --- You received this message because you are subscribed to the Google

[web2py] Re: extra_fields not created

2013-05-12 Thread Niphlod
where did you put this snippet ? make sure it's before auth.define_tables() On Sunday, May 12, 2013 4:05:27 PM UTC+2, Robin Manoli wrote: > > I was trying on a pretty much empty copy of a welcome app to create my own > extra fields. Mainly I want to keep track of when a user registers and > cha

Re: [web2py] Re: (1/2 OT) Bug in production? [nginx + uwsgi]

2013-05-13 Thread Niphlod
url needs to be a valid url. Documentation is ok, but if you "hardcode" fixed values you need to be sure that the routes are always exactly as in your development server. If you're not messing with default applications and/or redirection, the same code that ran on lighttpd needs to run on nginx

Re: [web2py] Re: SQLFORM.grid how to link a entire row?

2013-05-13 Thread Niphlod
I may be missing something but without javascript there's no way to turn a TR into a "clickable something". jQuery or not, it's easier to handle a click on a tr and make it working as a uber-button with javascript (at most 5 lines of code with a framework like jquery) than turning all the marku

[web2py] Re: attach .vcf file to mail

2013-05-14 Thread Niphlod
do you need to send the email within web2py or you want to open the user's email program with that vcf attached ? Il giorno martedì 14 maggio 2013 09:45:40 UTC+2, Annet ha scritto: > > I have a download vCard button in one of my views. Instead of downloading > the vCard to the vistors addressbook

[web2py] Re: Regarding update query question

2013-05-14 Thread Niphlod
update() takes a mapping that reflect column names, not fields db(db.md5.md5==md5_update).update(db.md5.status=True) The red part needs to be eliminated db(db.md5.md5==md5_update).update(status=True) On Tuesday, May 14, 2013 7:14:03 PM UTC+2, Nam Soo In wrote: > > Hi, I am trying to updat

Re: [web2py] login form registration problem with encoding

2013-05-15 Thread Niphlod
for all intents and purposes AVOID inlining content if it's meant to be a binary ^_^. Attachments are there for a reason (and also for text files > 0.5 KB)... -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group

Re: [web2py] user comments

2013-05-15 Thread Niphlod
I was planning on writing a more updated plugin with some badass features but as all the things is currently "backlogged" On Wednesday, May 15, 2013 3:37:26 AM UTC+2, marco mansilla wrote: > > El Tue, 14 May 2013 12:33:51 -0700 (PDT) > BlueShadow > escribió: > > > Hi, > > I like to add c

[web2py] Re: web2py not working

2013-05-15 Thread Niphlod
are you sure it's not a problem on starting firefox ? what happens if you try to start web2py with web2py.py -a arandompassword ? Il giorno mercoledì 15 maggio 2013 10:42:28 UTC+2, goome ha scritto: > > Hello > i use ubuntu 13.04 (server version) > uname -a > Linux ubu 3.2.0-29-generic-pae #46-U

Re: [web2py] user comments

2013-05-15 Thread Niphlod
won't be there for the next few weeks, though. Il giorno mercoledì 15 maggio 2013 10:41:53 UTC+2, BlueShadow ha scritto: > > I would love to see your badass coments plugin Niphlod. > > On Wednesday, May 15, 2013 9:39:21 AM UTC+2, Niphlod wrote: >> >> I was plann

[web2py] Re: Self reference select

2013-05-15 Thread Niphlod
http://web2py.com/books/default/chapter/29/06?search=self+reference#Self-Reference-and-aliases Il giorno mercoledì 15 maggio 2013 14:31:26 UTC+2, Domagoj Kovač ha scritto: > > Hi, > > i have a table of locations: > > db.define_table('entry_location', > Field('name', 'string', >

[web2py] Re: How to limit user votes

2013-05-15 Thread Niphlod
either you update the session with a counter and forbid voting if that variable is > some limit (but as soon as the session is erased (e.g. a clean cookie operation) the user will be able to vote again) or you build up on request.env.remote_addr (that is the ip address requesting the page) some

[web2py] Re: sitemap.xml

2013-05-15 Thread Niphlod
automatically from what list ? it's needed at least a list of urls to generate it On Wednesday, May 15, 2013 4:59:01 PM UTC+2, Omi Chiba wrote: > > Do we have the way to generate sitemap.xml automatically? -- --- You received this message because you are subscribed to the Google Groups "

[web2py] Re: REF: Generate XML/JSON IN WEB2PY

2013-05-15 Thread Niphlod
for a resultset or what else ? def test(): resultset = db(query).select() return resultset.as_xml() #return resultset.as_json() On Wednesday, May 15, 2013 4:54:17 PM UTC+2, software.ted wrote: > > Is there a way of generating XML or JSON in web2py say from a database. > > -- >

[web2py] Re: define_table: deletable, editable, create

2013-05-15 Thread Niphlod
wouldn't the normal writable = False on the fields work out ? On Wednesday, May 15, 2013 9:59:16 PM UTC+2, bapster wrote: > > Similar to the deletable/editable/create arguments for grids, would it > make sense to have those same arguments for table definitions: > db.define_table(...) ? > > I hav

[web2py] Re: sitemap.xml

2013-05-15 Thread Niphlod
Wednesday, May 15, 2013 9:39:27 PM UTC+2, Omi Chiba wrote: > > I was thinking like this website where it will search for the directly > under the domain and generate sitemap.xml. > http://www.xml-sitemaps.com/ > > > > On Wednesday, May 15, 2013 1:59:26 PM UTC-5, Niphlod wr

[web2py] Re: sitemap.xml

2013-05-15 Thread Niphlod
PS: the problem with this approach is that your site needs to include some page where all the urls that it can generate are listed. e.g. you make a /app/default/showme/ controller that takes an integer and returns the representation of a product, that you previously saved in a database.. (/

[web2py] Re: Modifying auth_users table with field in another table

2013-05-15 Thread Niphlod
that you need to define the office table before the auth ones ^_^ On Wednesday, May 15, 2013 9:29:44 PM UTC+2, Naujpr wrote: > > Hello everyone. This is probably simple (noob here) but I'm kinda lost > here. I am trying to establish a one to many relationship between the > auth_user table and an

[web2py] Re: Regarding update count

2013-05-15 Thread Niphlod
aside from the code that generates it, you MUST post also what error comes up ^_^ On Wednesday, May 15, 2013 10:59:41 PM UTC+2, Nam Soo In wrote: > > I am trying to update count depend on url exists in the DB > urlcount is integer type in database > It keeps giving me an error. > > Here is my cod

[web2py] Re: Regarding update count

2013-05-15 Thread Niphlod
boys. a select returns a list of rows. check_count=db(db.phalanx_request.url==single_md5_url[1]).select(db. phalanx_request.urlcount) returns something like [ {'urlcount' : 2 } ] assuming you url is unique (because of the logic expressed in your snippet), then you'd like to fetch just the fir

[web2py] Re: Testing your app using py.test

2013-05-16 Thread Niphlod
the time taken to write something that mocks a database is orders of magnitude more than just testing on a separate database instance. As for "decoupling", I'm a big believer that webapp tests should need to be executed with behavioural tests, not unit-tests. Of course business logic core modules

[web2py] Re: Testing your app using py.test

2013-05-16 Thread Niphlod
Il giorno giovedì 16 maggio 2013 13:03:33 UTC+2, Arnon Marcus ha scritto: > > > On Thursday, May 16, 2013 11:37:59 AM UTC+3, Niphlod wrote: >> >> the time taken to write something that mocks a database is orders of >> magnitude more than just testing on a separate dat

[web2py] Re: SQLFORM.grid() custom view

2013-05-16 Thread Niphlod
the widget argument is for forms. the grid doesn't generate widgets for displaying records, but you can customize the representation using the represent attribute. Il giorno mercoledì 15 maggio 2013 12:36:53 UTC+2, Vlasov Vitaly ha scritto: > > Hello all! I need help about SQLFORM.grid > > I

[web2py] Re: Bootstrap aria-hidden="true"

2013-05-16 Thread Niphlod
same thing that you previously did for data attributes (before web2py handled them natively) use BUTTON(, **{'_aria-hidden' : 'true'}) On Thursday, May 16, 2013 10:22:47 PM UTC+2, Annet wrote: > > In a function I use the following code to add Bootstrap's close button > for a modal window

[web2py] Re: change dal connection string user

2013-05-19 Thread Niphlod
if you didn't change any table, the best way is to set migrate=False and fake_migrate=True. pass those arguments also to the auth.define_table() call, as in auth.define_table(db, fake_migrate=True) On Sunday, May 19, 2013 11:55:32 AM UTC+2, yashar wrote: > > hi, > > i want to change connection

[web2py] Re: SQLFORM.grid() custom view

2013-05-19 Thread Niphlod
then it'll be hard. ruling out making those transformations with javascript, the only way is to change the represent attribute for all fields and reload the grid (reloading the page or the part where the grid is) On Sunday, May 19, 2013 11:14:57 AM UTC+2, Vlasov Vitaly wrote: > > Thanks. I wi

[web2py] Re: Testing your app using py.test

2013-05-19 Thread Niphlod
me and vinicius are working on having a base start for testing applications with web2py. PS: in either way, web2py will not help you write tests with selenium, web2py will just provide a simpler integration for running whatever test you like (i.e. if you chose selenium you will have to write t

[web2py] Re: write place for a sql query

2013-05-19 Thread Niphlod
it depends if this "event" is bound to the user pressing the submit on a form, maybe the best place is the onvalidation callback of the accepts() or process() method http://web2py.com/books/default/chapter/29/07?search=onvalidation#onvalidation On Sunday, May 19, 2013 8:37:32 PM UTC+2, Chri

[web2py] Re: write place for a sql query

2013-05-19 Thread Niphlod
submitted by the user (based upon a > check of the database) then their row in the table is updated as having > been correct. > > > On Sunday, 19 May 2013 15:39:05 UTC-4, Niphlod wrote: >> >> it depends if this "event" is bound to the user pressing t

[web2py] Re: Save selected option after form submission

2013-05-19 Thread Niphlod
when you receive the form value, it's probably inside a form.vars.name_of_the_field . save it somewhere (database, session, cache, etc) and use db.tablename.name_of_the_field.default = your previously saved value On Monday, May 20, 2013 6:04:27 AM UTC+2, Denis Rykov wrote: > > I have SELEC

[web2py] Re: Referencing auth_user custom field in another table

2013-05-19 Thread Niphlod
uhm. what do you want (as examples) in auth_user.team_name and what on t_teams.name ? if you want e.g. "a-team" in auth_user.team_name and "a-team" in t_teams.name, and a record in t_teams must exist only with a "name" that is one of the team_name values of the auth_user table (i.e. you have to

[web2py] Re: Bulk insert: how to improve performances?

2013-05-20 Thread Niphlod
there's a bulk_insert method too. http://web2py.com/books/default/chapter/29/06?search=bulk Il giorno lunedì 20 maggio 2013 10:36:32 UTC+2, Rocco ha scritto: > > Dear all, > > I've a loop to insert about 2K records into a postgres database (running > on same host). > > This is the used code: > >

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread Niphlod
honestly I don't get what you want. When you use ssh to connect to the host you have the same exact speed than connecting through http to that host. Accessing the admin app with or without the ssh tunnelling can't generate problems on the speed side: the required bandwith is roughly the same. So

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread Niphlod
n appmin panel with uwsgi? > i know i have to use ssh for connecting at last. when i run it with uwsgi > it replys : no password was set for appadmin > > On Monday, May 20, 2013 2:06:28 PM UTC+4:30, Niphlod wrote: >> >> honestly I don't get what you want. >> Whe

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread Niphlod
May 20, 2013 2:44:53 PM UTC+4:30, Niphlod wrote: >> >> so the problem is that you can't reach the >> https://yourhost/appname/appadmin page ? >> >> >> Il giorno lunedì 20 maggio 2013 11:58:48 UTC+2, yashar ha scritto: >>> >>> thanks for th

[web2py] Re: Query not supported, but it generates a valid SQL-level query

2013-05-20 Thread Niphlod
probably the bit that tries to count how many records are in it. Just to try it out, in trunk there's a new cache_count argument to the grid. can you try adding cache_count=100 to your grid instantiation ? If it doens't say "query not supported" we'll know that the failing part is in fact the

[web2py] Re: Referencing auth_user custom field in another table

2013-05-20 Thread Niphlod
explaining well is to have > t_teams.name to be a foreign key for the field custom field in auth_users. > > Does that explain it any better? > > On Monday, 20 May 2013 02:59:00 UTC-4, Niphlod wrote: >> >> uhm. >> what do you want (as examples) in auth_user.team_name

Re: [web2py] Re: Query not supported, but it generates a valid SQL-level query

2013-05-20 Thread Niphlod
recently the code to count the records changed... did you try trunk without the cache_count argument ? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web

[web2py] Re: admin panle with uwsgi

2013-05-20 Thread Niphlod
when you started web2py for the first time you should have created it. The password is stored in a file that is called parameters_portnumber.py If you don't have that file, then log on the server with ssh, go into the web2py folder and do python from gluon.main import save_password save_password

[web2py] Re: Bulk insert: how to improve performances?

2013-05-20 Thread Niphlod
this is the implementation def bulk_insert(self, table, items): return [self.insert(table,item) for item in items] no limits there, but it doesn't leverage any native BULK operation, so, don't pass a list of 1 zillion dicts. -- --- You received this message because you are subscribed

[web2py] Re: Bulk insert: how to improve performances?

2013-05-20 Thread Niphlod
ows to speed up the performance, see: > http://stackoverflow.com/questions/1711631/how-do-i-improve-the-performance-of-sqlite > could we do something like that in our bulk_insert? > > Paolo > > On Monday, May 20, 2013 2:57:30 PM UTC+2, Niphlod wrote: >> >> this is

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Niphlod
if you have an smtp server on your server ready to be used, why not ? Il giorno lunedì 20 maggio 2013 15:14:03 UTC+2, Lamps902 ha scritto: > > At the moment, my custom domain is associated with Outlook, and my page's > email settings are configured this way: > > settings.email_server = 'smtp.live

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Niphlod
even with that piece of code there has to be an "host" :D Mail servers are easy to install. The not so easy part is configuring them to be secure (avoiding being used as spam relays) and correctly identified (reverse dns, mx, etc), so you don't get included in a blacklist as soon as you start us

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Niphlod
I really don't think that smtp.live.com accepts happily more than a few emails per day (same thing goes for google's SMTPs using a personal account). They're not meant to be used by servers :P Il giorno lunedì 20 maggio 2013 17:14:29 UTC+2, Lamps902 ha scritto: > > correctly identified (rev

[web2py] Re: A more concise way to update or insert?

2013-05-20 Thread Niphlod
given that you wrote your own parser, why are you having problems with updates ? just pass only the columns you need to update to the update_or_insert statement On Monday, May 20, 2013 5:41:11 PM UTC+2, David S wrote: > > I've got some csv files which need to be imported to a table. However

[web2py] Re: Mercurial not found

2013-05-20 Thread Niphlod
that's because the binary distribution doesn't ship with mercurial... if you fiddle with source code (and need version control) you're kinda "required" to use the source code distribution. On Monday, May 20, 2013 5:34:20 PM UTC+2, tim spear wrote: > > I had the same error with the web2py.exe ver

[web2py] Re: Save selected option after form submission

2013-05-20 Thread Niphlod
. > What I have to do in this case? > > On Monday, May 20, 2013 1:52:06 PM UTC+7, Niphlod wrote: >> >> when you receive the form value, it's probably inside a >> form.vars.name_of_the_field . >> >> save it somewhere (database, session, cache, etc)

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Niphlod
without the code you use to load them, it's quite impossible to figure out why it doesn't work. On Monday, May 20, 2013 8:53:06 PM UTC+2, Lamps902 wrote: > > I have a few pages (about, FAQ, terms of service) that are loaded from > text files in the static folder. The setup is basically like this

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Niphlod
request.folder never changes. There's surely some bug in the code cause if you try to put , e.g. STATIC_SOMETHING = 'never changes' in models, and in a layout.html you do {{=STATIC_SOMETHING}} it gets printed in every page. PS: why the "dinamically" in the title ? it's pretty much static ^_^

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Niphlod
ages, and I click on 'about', the page looks for > 'default/user/about' instead of 'default/about' as it should. In > layout.html. the links are along the lines of: > > > > > > > On Monday, May 20, 2013 2:09:16 PM UTC-5, Niphlod wrote:

[web2py] Re: Add ondelete restriction

2013-05-20 Thread Niphlod
unless you drop the column and recreate it, web2py will not enforce a redefinition on ondelete actions cause they can end up in exceptions. On Monday, May 20, 2013 10:14:10 PM UTC+2, Denis Rykov wrote: > > I have field defenition: > > Field('company', 'reference company', notnull=True, label=

[web2py] Re: Database Triggers

2013-05-21 Thread Niphlod
there's no functionality to write triggers . They're too much dependant (syntax-wise) on the db backend. But, web2py exposes some nice callbacks that can deal with most of the corner-cases where you'd need a database triggers http://web2py.com/books/default/chapter/29/06#before-and-after-callbac

[web2py] Re: Error page with ticket in iframe -- no need for extra click each time ;)?

2013-05-21 Thread Niphlod
there are routes to manage custom error pages. http://web2py.com/books/default/chapter/29/04#Routes-on-error Il giorno martedì 21 maggio 2013 09:40:09 UTC+2, Jurgis Pralgauskis ha scritto: > > Hi, > > clicking ticket link each time becomes frustrating (time wasting) [SOLVED] > :) > > I look

Re: [web2py] Re: Query not supported, but it generates a valid SQL-level query

2013-05-21 Thread Niphlod
create a ticket so it gets tracked. Please post an example complete with models and a few records to test it out. Il giorno martedì 21 maggio 2013 11:21:29 UTC+2, Johann Spies ha scritto: > > On 20/05/2013 12:53, Niphlod wrote: > > if it doens't say "query not supporte

[web2py] Re: Hey Massimo, how do you market and watch for web2py news, and other metrics and tricks.

2013-05-21 Thread Niphlod
lol, we all love human minions ^_^ Il giorno martedì 21 maggio 2013 11:54:43 UTC+2, Massimo Di Pierro ha scritto: > > Actually no. I used to watch web2py using google alerts but I have not > done so recently. Usually if something interesting comes up people from > this list email me about it.

[web2py] Re: friendly URL for user profile

2013-05-21 Thread Niphlod
PS: BASE is '' by default in recent routes.example.py distribution. Il giorno martedì 21 maggio 2013 13:49:04 UTC+2, Massimo Di Pierro ha scritto: > > Hello Julia, > you have lines like > (BASE + '/admin', '/admin/default/index'), > what is the value of BASE? > > > On Monday, 20 May 2013 19:48:16

[web2py] Re: update_or_insert doesn't always return the corresponding row id

2013-05-21 Thread Niphlod
Il giorno martedì 21 maggio 2013 16:42:46 UTC+2, Robin Manoli ha scritto: > > is it really another query? isn't there already a query to see if there is > a post to update? come up with a SQL syntax that returns the PK of updated records and we'll try it. I'm pretty sure there isn't any but I

[web2py] Re: Scaling + performance tips to prepare for launch

2013-05-21 Thread Niphlod
the session.forget(response) will render all session related features useless. Use wisely. I'd add lazy_tables=True to your points, as well as a good cache backend and possibily the use of wise cache headers in the response. On Tuesday, May 21, 2013 7:34:28 PM UTC+2, smoggy wrote: > > Hi folks,

[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-21 Thread Niphlod
500k records for 2 tables (total 1M) on SQLite, heavy update scenario.. I really hope you'll manage that outside the normal web environment to avoid timeout issues that are likely to happen. I'll try to reproduce though. On Tuesday, May 21, 2013 6:35:14 PM UTC+2, Simon Ashley wrote: > > Expe

[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-21 Thread Niphlod
using the first method without cache (see below, it seems unuseful) no leaks at least in ubuntu. 30k records updated/inserted in a little less than 5 minutes. storage.db is roughly 2 GB. Memory usage is 400MB, give or take. the second method is incorrect as posted ... maybe there are a few typos

[web2py] Re: Please explain how this query works

2013-05-21 Thread Niphlod
all those (query) just add a bit of "where" clause in the select that you pass to the db. you can use them with db((query) & (query) & (query)) or with db(query)(query)(query) ... the resulting select passed to the db would be the same! On Tuesday, May 21, 2013 10:43:48 PM UTC+2, brac...@gmail.

[web2py] Re: Memory leak, SQLite, Windows (7, 2008)

2013-05-21 Thread Niphlod
Wednesday, May 22, 2013 12:34:18 AM UTC+2, Simon Ashley wrote: > > Thanks Niphlod > > Yep, sorry for the typos (@ 4am the brain doesn't function correctly). > Main point was to describe the 2 methods. > (*update_or_insert *and *row.update_record*) > Actual code would have b

<    6   7   8   9   10   11   12   13   14   15   >