LoveWeb2py | 25 Apr 05:05 2014
Picon

init.js Images not Loading initially

Hello,

I'm running www.syntheticturfdrs.com

I'm using web2py to control the back end and the site is hosted on pythonanywhere.

For some reason my images don't load intially, but if I browse to another site (lets say products) and then go back to "welcome" the images load. Does anyone have any thoughts why this could be happening? Is it something with web2py?

I've tried refreshing init.js and I'm at a loss why this could be happening. Any advice is greatly appreciated!

-AT

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Manuele Pesenti | 24 Apr 20:58 2014
Picon

parallel shell cause portal block

Hi!
I want to notify a strange behaviour. If I run any kind of parallel
command, such as calling web2py.py with -K option to run my scheduled
task or with -S <app> -M to test manually some function in my
environment it cause a portal block. The portal will reply again only
from the moment I kill the parallel process. Any idea??

Thank you very mutch
Cheers

    Manuele

--

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Richard | 24 Apr 18:37 2014
Picon

expert_search=True

Hello,

I would improve default search widget a bit like that :

                if expert_search:
                   search_widget = lambda sfield, url: CAT(FORM(
                       TEXTAREA(_name='keywords',
                                _class='expert_search',
                                _value=request.vars.keywords,
                                _id=skeywords_id,
                                _onfocus="jQuery('#%s').change();jQuery('#%s').slideDown();" % (spanel_id, sfields_id) if advanced_search else ''
                       ),
                       INPUT(_type='submit', _value=T('Search'), _class="btn btn-default"),
                       INPUT(_type='submit', _value=T('Clear'), _class="btn btn-default",
                             _onclick="jQuery('#%s').val('');" % skeywords_id),
                       _method="GET", _action=url), search_menu)
               else:
                   search_widget = lambda sfield, url: CAT(FORM(
                       INPUT(_name='keywords',
                             _value=request.vars.keywords,
                             _id=skeywords_id,
                             _onfocus="jQuery('#%s').change();jQuery('#%s').slideDown();" % (spanel_id, sfields_id) if advanced_search else ''
                       ),
                       INPUT(_type='submit', _value=T('Search'), _class="btn btn-default"),
                       INPUT(_type='submit', _value=T('Clear'), _class="btn btn-default",
                             _onclick="jQuery('#%s').val('');" % skeywords_id),
                       _method="GET", _action=url), search_menu)

So the search query is easier to write for an "expert"...

But I didn't find where the search form get parsed... We need to strip line break of the textarea in order to have this feature.

Thanks

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Ruud Schroen | 24 Apr 18:20 2014
Picon

:eval not working

Al of a sudden my callbacks aren't working. Whenever i specify :eval as the target, i get this error:

Uncaught Error: Syntax error, unrecognized expression: #:eval

which comes from jquery.js

This is my callback trigger, returned from a function:

return A(T('Send friend request'), callback=URL('default', 'friendship', args=['request', user.id]), _class='button white friendship', _id='friendship_button', target=':eval')

I am using the web2py.js and jquery.js from the welcome app.

What am i doing wrong?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Massimo Di Pierro | 24 Apr 17:20 2014
Picon

web2py conference, next week!

There is one more to the first web2py conference

http://www.experts4solutions.com/web2py_conference

We got a bigger room and we can take 10-15 more people. register now!

Massimo

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Josyula Krishna | 24 Apr 16:46 2014
Picon

Skip fields in registration

Hi, I'm new to web2py, I'm trying to build an authentication system where the user can skip his email, firstname, lastname, How can i do this other than creating a custom table for authentication? 

I did try 
auth.settings.registration_requires_email = False
auth.define_tables(username=True, signature=False,email=False)

doing that but it doesnt seem to work, please help. 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard | 24 Apr 16:18 2014
Picon

.grid() my own search widget possible? How?

Hello,

Is it possible to create my own search widget? How does I get the grid to use it?

Thanks

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Greg Vaughan | 24 Apr 15:05 2014
Picon

pass current page id to load function in sidebar

Hi everyone...

I am using a LOAD function for a notes field in the sidebar of my app. I am able to load the notes for a specific business by hardcoding the id of the business in the controller like so...

<at> auth.requires_login()
def note():
    current==1
    notes=db(db.notes.business==current).select()
    return dict(notes=notes)

What I would like to do is have the value of current set to the id var of the current page eg... welcome/default/leads?id=17 <<< THIS

No request.vars are available to the LOAD function however...

How do I achieve this?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Fabiano Almeida | 24 Apr 02:50 2014
Picon

master detail form

Hi,

I'm trying to do a master detail form. It is possible that the details form is grid style? How?

Thanks,

Fabiano.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Rene Dohmen | 24 Apr 14:39 2014
Picon

Migrating from sqlite to postgres?

Hi Web2py users,

we are struggling, for some time now, with a migration of our apps from sqlite to postgres. We tried a couple of approaches: first we tried doing it with cp_db.py but that had problems with relations and seems broken. Our current approach consist of these steps:

1) export data with:
def export_all():
   db.export_to_csv_file(open('export_all.csv', 'w'))

2) change conenction string from sqlite:
db = DAL('sqlite://storage.sqlite', migrate=settings.migrate)
TO:
db = DAL('postgres://user:pass <at> localhost/project', migrate=settings.migrate, check_reserved=False, entity_quoting=True)

3) remove contents of database/ folder and let web2py create the DB

4) import data from the csv
def import_all():
   db.import_from_csv_file(open('export_all.csv', 'r'))


The import then runs for a very long time and after 10 minutes or so a ticket is served:
-----

Ticket ID

127.0.0.1.2014-04-24.13-38-52.6c7d2674-34e2-4968-9526-ee78b83fda76

Versie

web2py™Python
Version 2.9.5-stable+timestamp.2014.03.16.02.35.39
Python 2.7.5: /usr/bin/python (prefix: /System/Library/Frameworks/Python.framework/Versions/2.7)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
Traceback (most recent call last):
File "/Users/acidjunk/GIT/formatics.web2py/gluon/main.py", line 539, in wsgibase
BaseAdapter.close_all_instances('rollback')
File "/Users/acidjunk/GIT/formatics.web2py/gluon/dal.py", line 600, in close_all_instances
db._adapter.close(action)
File "/Users/acidjunk/GIT/formatics.web2py/gluon/dal.py", line 580, in close
getattr(self, action)()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/dal.py", line 1923, in rollback
return self.connection.rollback()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/dbapi.py", line 455, in _fn
return fn(self, *args, **kwargs)
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/dbapi.py", line 551, in rollback
self.conn.rollback()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/interface.py", line 622, in rollback
self._rollback.execute()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/interface.py", line 166, in execute
self.c.close_portal(self._portal_name)
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py", line 1326, in close_portal
reader.handle_messages()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py", line 906, in handle_messages
msg = self._conn._read_message()
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py", line 1033, in _read_message
bytes = self._read_bytes(5)
File "/Users/acidjunk/GIT/formatics.web2py/gluon/contrib/pg8000/protocol.py", line 1021, in _read_bytes
self._sock_buf = self._sock.recv(1024)
timeout: timed out

Error snapshot 

<class 'socket.timeout'>(timed out)

-----

Is there a better way to do this kind of migrate, or to have better debug info about where it goes wrong?

Any help is appreciated.

Kind Regards

Rene

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
M Bailey | 24 Apr 14:31 2014

Newbie - SQLFORM ordering of reference fields

I'm trying to migrate a django project to web2py. I have defined a search form with <select><option> fields populated from the database and using code similar to below, but I can't see a way of changing the ordering of the SQLFORM fields:

db.define_table('pet_type',
    Field('description', 'string', required=True, notnull=True, length=75),
    format = '%(description)s')

db.define_table('colour_type',
    Field('description', 'string', required=True, notnull=True, length=75),
    format = '%(description)s')


db.define_table('search_form',
    Field('pet_type_ref', 'reference pet_type', label='Pet'),
    Field('colour_type_ref', 'reference colour_type', label='Pet colour'))

In index controller:
form = SQLFORM(db.search_form)
return dict(form=form)

In the view:
{{=form}}


In the admin section, I add some pets into the pet_type table but not in alphabetical order, e.g. Dog, Budgie, Cat

All works brilliantly in the view with <select> controls being used for the reference fields. 

However I can't see a way of changing the ordering of the pets for the select. Currently it defaults to pet_type.description ASC but how would I change it to the pet_type.id so that the records are displayed in the order they are inserted?

Thanks for any advice
Mark

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane