[web2py] One form for two tables

2016-04-28 Thread Andrea Marin
Hi all,

I'm trying to setup a form to manage two tables:

db.define_table('pratiche',
Field('nome', requires=IS_NOT_EMPTY()),
Field('descrizione', 'text', requires=IS_NOT_EMPTY()),
Field('stato_pratica', requires=IS_IN_SET(['aperta', 
'attesa', 'chiusa'])),
auth.signature)

db.define_table('allegati',
Field('tipo_allegato', requires=IS_IN_SET(['mandato', 
'comparsa preliminare', 'relazione ctu', 'parcella'])),
Field('doc_filename'),
Field('doc', 'upload'),
Field('pratica', 'reference pratiche', writable = False, 
readable = False))


Table allegati contain uploaded file referred to record in pratiche.
My controller form create a new record is:

@auth.requires_login()
def create():
form = SQLFORM.factory(db.pratiche, db.allegati)
form.vars.stato_pratica = 'aperta'
form.vars.tipo_allegato = 'mandato'
form.add_button('Back', URL('index'))
if form.process(onvalidation=create_form_process).accepted:
"""TODO
   trovare il modo di non far inserire un nome di file
   ma di salvare almeno la categoria a cui si associa
   presa dal menu a tendina del tipo di file
"""
id = db.pratiche.insert(**db.pratiche._filter_fields(form.vars))
form.vars.pratiche=id
id = db.allegati.insert(**db.allegati._filter_fields(form.vars))
form.vars.allegati=id
session.flash = T('Posted')
redirect(URL('index'))
elif form.errors:
session.flash = T('Il form ha degli errori')
return locals()

def create_form_process(form):
form.vars.doc_filename = form.vars.tipo_allegato


And my views is

{{extend 'layout.html'}}

Nuova pratica
{{=form}}


The form is show well but when I try su submit I receive this error that I 
don't understand

Error ticket for "studiolegale"Ticket ID

127.0.0.1.2016-04-28.23-56-24.d61a1296-63cc-4f78-9a35-ec021d430d86
 you must specify a Field(..., 
uploadfolder=...)Versione
web2py™ Version 2.14.5-stable+timestamp.2016.04.14.03.26.16
Python Python 2.7.3: 
/Users/andrea/Desktop/web2py/web2py.app/Contents/MacOS/python (prefix: 
/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

Traceback (most recent call last):
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/restricted.py",
 line 227, in restricted
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/applications/studiolegale/controllers/default.py"
 
, 
line 95, in 
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/globals.py", 
line 417, in 
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/tools.py", 
line 4258, in f
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/applications/studiolegale/controllers/default.py"
 
, 
line 13, in create
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/html.py", 
line 2300, in process
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/html.py", 
line 2238, in validate
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/sqlhtml.py", 
line 1662, in accepts
  File 
"/Users/andrea/Desktop/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/objects.py",
 line 1519, in store
RuntimeError: you must specify a Field(..., uploadfolder=...)


What are my errors?
I perform the right way to do this?

Thanks a lot

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How can I pre populate a option column of a form?

2016-04-28 Thread Andrea Marin
Thanks for this method

Il giorno giovedì 28 aprile 2016 20:10:46 UTC+2, Val K ha scritto:
>
> 'form.vars.field = any'  must be placed before form.process()
> So, in your case:
> form = SQLFORM(db.pratiche)
> form.vars.stato_pratica = 'aperta'
> 
> if form.process().accepted:
>
> ...
> form.add_button('Back', URL('index'))  #  it's a DOM-manipulation - 
> place it after form.process()
>
>
>
>
> On Friday, April 22, 2016 at 12:23:59 AM UTC+3, Andrea Marin wrote:
>>
>> Trans a lot 
>>
>> Il giorno 21 apr 2016, alle ore 05:22, Michael Beller <mjbe...@gmail.com> 
>> ha scritto:
>>
>> before you call SQLFORM, insert:
>> db.pratiche.stato_pratica.default = 'aperta'
>>
>>
>>
>> On Wednesday, April 20, 2016 at 6:05:06 PM UTC-4, Andrea Marin wrote:
>>>
>>> Hi I have this type of form in my model file:
>>>
>>> db.define_table('pratiche',
>>> Field('nome', requires=IS_NOT_EMPTY()),
>>> Field('descrizione', 'text', requires=IS_NOT_EMPTY()),
>>> Field('tipo_allegato', requires=IS_IN_SET(['mandato', 
>>> 'comparsa preliminare', 'relazione ctu', 'parcella'])),
>>> Field('doc_filename'),
>>> Field('doc', 'upload'),
>>> Field('stato_pratica', requires=IS_IN_SET(['aperta', 
>>> 'attesa', 'chiusa'])),
>>> auth.signature)
>>>
>>>
>>> I want to setup a default value for field stato_pratica to 'aperta' 
>>> every time a user create a new record
>>> This is my controller function to create a new record
>>>
>>> def create():
>>> form = SQLFORM(db.pratiche).process()
>>> form.vars.stato_pratica = 'aperta'
>>> form.add_button('Back', URL('index'))
>>> if form.accepted:
>>> session.flash = T('Posted')
>>> redirect(URL('index'))
>>> elif form.errors:
>>> session.flash = T('Il form ha degli errori')
>>> return locals()
>>>
>>> I try to set form.values.stato_pratica = 'aperta' but it not works.
>>>
>>> Thanks.
>>>
>>> -- 
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/QJ1aaP5Febo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How can I pre populate a option column of a form?

2016-04-21 Thread Andrea Marin
Trans a lot 

> Il giorno 21 apr 2016, alle ore 05:22, Michael Beller <mjbel...@gmail.com> ha 
> scritto:
> 
> before you call SQLFORM, insert:
> db.pratiche.stato_pratica.default = 'aperta'
> 
> 
> 
>> On Wednesday, April 20, 2016 at 6:05:06 PM UTC-4, Andrea Marin wrote:
>> Hi I have this type of form in my model file:
>> 
>> db.define_table('pratiche',
>> Field('nome', requires=IS_NOT_EMPTY()),
>> Field('descrizione', 'text', requires=IS_NOT_EMPTY()),
>> Field('tipo_allegato', requires=IS_IN_SET(['mandato', 
>> 'comparsa preliminare', 'relazione ctu', 'parcella'])),
>> Field('doc_filename'),
>> Field('doc', 'upload'),
>> Field('stato_pratica', requires=IS_IN_SET(['aperta', 
>> 'attesa', 'chiusa'])),
>> auth.signature)
>> 
>> 
>> I want to setup a default value for field stato_pratica to 'aperta' every 
>> time a user create a new record
>> This is my controller function to create a new record
>> 
>> def create():
>> form = SQLFORM(db.pratiche).process()
>> form.vars.stato_pratica = 'aperta'
>> form.add_button('Back', URL('index'))
>> if form.accepted:
>> session.flash = T('Posted')
>> redirect(URL('index'))
>> elif form.errors:
>> session.flash = T('Il form ha degli errori')
>> return locals()
>> 
>> I try to set form.values.stato_pratica = 'aperta' but it not works.
>> 
>> Thanks.
> 
> -- 
> 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 a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/QJ1aaP5Febo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How can I pre populate a option column of a form?

2016-04-20 Thread Andrea Marin
Hi I have this type of form in my model file:

db.define_table('pratiche',
Field('nome', requires=IS_NOT_EMPTY()),
Field('descrizione', 'text', requires=IS_NOT_EMPTY()),
Field('tipo_allegato', requires=IS_IN_SET(['mandato', 
'comparsa preliminare', 'relazione ctu', 'parcella'])),
Field('doc_filename'),
Field('doc', 'upload'),
Field('stato_pratica', requires=IS_IN_SET(['aperta', 
'attesa', 'chiusa'])),
auth.signature)


I want to setup a default value for field stato_pratica to 'aperta' every 
time a user create a new record
This is my controller function to create a new record

def create():
form = SQLFORM(db.pratiche).process()
form.vars.stato_pratica = 'aperta'
form.add_button('Back', URL('index'))
if form.accepted:
session.flash = T('Posted')
redirect(URL('index'))
elif form.errors:
session.flash = T('Il form ha degli errori')
return locals()

I try to set form.values.stato_pratica = 'aperta' but it not works.

Thanks.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Show a value only if there is in the db

2016-04-06 Thread Andrea Marin
Hi all,

I have a db table where I store some information and sometime a file like 
*.doc or *.pdf 
This is my model file

db.define_table('pratiche',
Field('nome', requires=IS_NOT_EMPTY()),
Field('descrizione', 'text', requires=IS_NOT_EMPTY()),
Field('data_creazione', 'date'),
Field('doc_filename'),
Field('doc', 'upload'))

I have a controller to insert, list and show the data into the table 
default.py

def index():
rows = db(db.pratiche).select()
return locals()

@auth.requires_login()
def create():
db.pratiche.data_creazione.default = request.now
db.pratiche.data_creazione.writable=False
db.pratiche.data_creazione.readable=False
"""
record = db.pratiche(request.args(0)) or redirect(URL('index'))
url = URL('download')
form = SQLFORM(db.pratiche, record, deletable=True,
   upload=url)
if request.vars.image!=None:
form.vars.doc_filename = request.vars.doc.filename
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
return dict(form=form)
"""

form = SQLFORM(db.pratiche).process()
if form.accepted: redirect(URL('index'))
return locals()

def show():
pratica = db.pratiche(request.args(0,cast=int))
return locals()

def download():
return response.download(request, db)

And I have a view to show the data index.html

{{extend 'layout.html'}}

Pratiche


Nome pratica
Allegati
Data Creazione

{{for row in rows:}}

{{=row.nome}}
{{=row.doc}}
{{=row.data_creazione}}

{{pass}}


My problem is that in the view index.html i show row.doc value that is 
retrive from db but is not alway set.
How can I configure a if statement to say 
if "there is the upload file" show the name 
else "show label no attached file"

Thank a lot.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Preventing hackers from exploiting web2py with wsgi

2016-02-25 Thread Marin Pranjić
Wow, some people are soo easily offended.

I don't see a single rude word here, it's helpful and informative answer,
and it should help you unmix things :)
His answer could be the best thing you read today, so I hope you don't just
discard it because it's not wrapped up with fake politeness.

Regards,

Marin

On Thu, Feb 25, 2016 at 9:40 AM, Robin Manoli <ramat...@gmail.com> wrote:

> They recommended not to use wsgi, and so far I've been using mod_wsgi.
> Sorry if I didn't know everything about wsgi.
>
> Thanks for the tips! Maybe I can amuse myself with some rude people on
> help forums too?
>
> You know Niphlod, this is not the first time you're answering to me in a
> rude way. Are you here to discourage people from learning, or one of those
> experts who can't handle that people can mix things up before learning? All
> the other people who have been helping me in these forums have been really
> nice. I hope you would like to be nice too.
>
>
>
>
>
> Den torsdag 25 februari 2016 kl. 10:09:13 UTC+2 skrev Niphlod:
>>
>> IMHO you're really confused. or got names wrong. or got things wrong.
>>
>> wsgi IS THE ONLY WAY to run python code for webservers. It's the only
>> standardized spec to do so.
>>
>> Nooow, if you're instead talinkg about mod_wsgi on apache, it's another
>> matter entirely. Securing apache needs to be done by expertsif you're
>> not, you can amuse yourself reading docs and chatting to peoples, but if
>> you're really concerned the best option is to leave it to professionals.
>>
>> BTW, we "sponsor" nginx+uwsgi over apache for some time now.
>>
>> On Thursday, February 25, 2016 at 8:33:57 AM UTC+1, Robin Manoli wrote:
>>>
>>> Hello!
>>>
>>> I was recommended by #ubuntu-server on Freenode not to use wsgi. I
>>> wonder if you recommend this as well (which means not using web2py with
>>> apache)?
>>>
>>> I'm wondering if there is certain type of web2py code I can look for to
>>> prevent unauthorized access. In particular, how to prevent apache to send
>>> GET requests to other domains than the actual web2py web site being
>>> requested in the first place.
>>>
>>> I'd really appreciate your help on this :)
>>>
>>> - Robin
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: DAL is dropping column when not supposed to

2016-02-07 Thread Marin Pranjić
Hey Alex,

could it be that you define the table twice in the code?


Marin

On Mon, Feb 8, 2016 at 6:56 AM, Alex Glaros <alexgla...@gmail.com> wrote:

> If that model is consistent with the current state of the database, run
> the code once with fake_migrate so web2py will update the migration
> metadata.
>
> Well,, I forced it to be consistent with model by creating the field on
> Postgres side.  When ran fake_migrate, I received
>  column "reputation_comments" of relation "reputation" does not exist
>
> If that model is not consistent with the database, then delete the
> relevant *.table file and run the code with a regular migration so web2py
> will create any missing fields.
>
> To test in this situation, I deleted the file in the web2py databases
> folder, and, dropped the table from the Postgres side. Ran migrate=True,
> and for some reason it remembered the old table model, not the version with
> the new field.  It created the old table with no errors on the Postgres
> side.  Why would it remember the old model? I clearly saved the new model
> version in db.py.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web2py Update

2016-02-07 Thread Marin Pranjić
On Sun, Feb 7, 2016 at 4:49 PM, Ron Chatterjee <achatterjee...@gmail.com>
wrote:

> You forgot to mention explicit vs. implicit Niphlod but pretty much you
> sum it up well. One thing I didn't understand is:
>
> "DAL is certainly improved in 6 years but still it won't ever be an ORM"
>
> In other words, ORM is better than DAL?  If that's the case, someone can
> also use sqlalchemy like they can use with django. Am I correct?
>
>
No, it doesn't mean ORM is better. It just means they are different.
Some people like DAL more, some like ORM.
And sure, you can use sqlalchemy if you prefer an ORM.

Marin


>
>
> On Sunday, February 7, 2016 at 5:42:15 AM UTC-5, Maurice Waka wrote:
>>
>> Thanks@Niphlod
>>
>> On Sun, Feb 7, 2016 at 12:21 PM, Niphlod <nip...@gmail.com> wrote:
>>
>>> honestly you can find it yourself, but for the sake of recaps:
>>> - small or none support for application's unittesting. up until now
>>> there have been a few experiments but no one landed in the code
>>> - routes_onerror can be used to cook something that will display the
>>> error right away, and I'm not so sure it'll work fine but there was an
>>> extension for google chrome or firefox that opened errors right away. That
>>> being said nobody is telling that the admin app can't be improved, it's an
>>> app and totally customizable
>>> - DAL is certainly improved in 6 years but still it won't ever be an
>>> ORM. That's the whole point of choosing a DAL over an ORM
>>> - we can't faster IDE adoption but there are a few that work fine with a
>>> little trick (web2pyslices holds the recipe)
>>> - web2py is completely multiprocess-aware. I'm not a big user of other
>>> frameworks but they smell less multiprocess-friendly than web2py (e.g. the
>>> cache and sessions). Because of those choices it's probably a little slower
>>> in single-process performances but nowadays production always requires
>>> multiple processes.
>>>
>>>
>>> On Sunday, February 7, 2016 at 9:26:02 AM UTC+1, Maurice Waka wrote:
>>>>
>>>> Hi
>>>> I have been using web2py for about 1 yr now. I love it. I recently came
>>>> acros this crazy article about web2py advantages and disadvantages.
>>>> My question is that have, these disadvantages been addressed since 6
>>>> yrs ago in your updates?
>>>> Am working on and app and would love to launch it soon, in web2py and I
>>>> dont want programmers to come and discredit my work.
>>>> Here is the link:
>>>> http://ahmedsoliman.com/2010/07/29/the-good-and-bad-about-web2py/
>>>> Kind regards
>>>>
>>> --
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/Ol4YRkIsuew/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] oauth2 for google

2016-01-21 Thread Marin Pranjić
from gluon.storage import Storage

On Thu, Jan 21, 2016 at 3:51 PM, dirman  wrote:

> I am getting
>
>  global name 'Storage' is not defined
>
> when using Storage(json.load(f)['web'])
>
> I need 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Why I'm unable to login my gmail in web2py for mailing and getting "sign in prevented messages"?

2016-01-09 Thread Marin Pranjić
This has nothing to do with web2py, it is completely google related.

Have you tried clicking on "Learn more" or "Review your devices now"?
You might find your answers...

Marin

On Sat, Jan 9, 2016 at 12:35 PM, RAGHIB R <raghib@iiits.in> wrote:

> I want to do this for my app on pythonanywhere.
>
>
> On Saturday, January 9, 2016 at 4:59:25 PM UTC+5:30, RAGHIB R wrote:
>>
>> How to tackle this?
>> my code is:
>> mail = auth.settings.mailer
>> mail.settings.server = 'smtp.gmail.com:587'
>> mail.settings.sender = 'mym...@gmail.com'
>> mail.settings.login =  'mym...@gmail.com:secret'
>>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Why this doesn't work as expected?

2016-01-03 Thread Marin Pranjić
Change your expectations :P

You are inserting into database while generating the view, before view even
gets to the client (browser).

Your "href" needs to point to a controller, for example:

{{=
x.name}}

Then, in "mycontroller.py" file you need to have a "my_insert_function"
like this:

def my_insert_function():
  _id = request.args(0)
  db.store.insert(stuff = _id)
  redirect(URL('othercontroller', 'otherfunction)) # <-- you can use this
to go back to original page

On Sun, Jan 3, 2016 at 3:36 PM, RAGHIB R  wrote:

> {{for x in uu:}}
> 
> {{=x.name}}
> 
> {{pass}}
> This doesn't work as expected. How to fix it?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] DAL alternatives

2015-10-28 Thread Marin Pranjić
Hey!

Bootstrap was never a constraint, I am removing it from every single
project and adding foundation/semantic/custom - I can't stand it.
I am also manually writing forms (everything in between of
form.custom.begin and form.custom.end) while using the power of SQLFORMs on
backend.

What do you mean by lacks proper data binding? You mean between client and
server?
If you're going with pyDAL, you are using python on backend. So, what are
your stack goals that can't be achieved with web2py?

If you can explain your issues a bit more, I would like to help/suggest,
but I don't quite understand what's the problem.
It might be I am missing something, but...

1. You can remove bootstrap from /static and from layout.html
2. Add semantic /static and include it in layout.html
3. You can even write your own layout.html and get rid of everything web2py
related.
If you remove web2py.js, you can't use LOAD, web2py_ajax and few other
things. But it seems you don't really need those.
4. Add vue/angular into /static and include it into layout.html (or use cdn)

You can use JSON to talk with the client:

def my_controller_function():
  data = 123
  return response.json(data=data)

So what pieces of the puzzle are missing here?

Regards,
Marin


On Wed, Oct 28, 2015 at 4:07 PM, António Ramos <ramstei...@gmail.com> wrote:

> my inconvenients:
>
> 1 - Bootstrap, i need layout.html but dont want bootstrap. How do i get
> rid of bootstrap or change it to semantic ?
>  Bootstrap should not be a constraint but just an add-on.
>
> 2 - web2py custom forms and tables. Are nice tools but if they dont do
> what you want you will have a big mess of code/style to customize it.
> I prefer doing it frontend side with angular/Vuejs/etc. Gives me more
> tools for my personal CV and the code looks better, however it lacks proper
> data binding with web2py and i end up having 2 separate apps, one frontend
> and one backend via REST. I dont like it.
>
> Regards
>
>
>
>
> 2015-10-28 11:28 GMT+00:00 Bernard Letourmy <bernard.letou...@gmail.com>:
>
>> Hi Ramos,
>> What's your project ?
>> Because if you do some console, desktop or Python notebook doc.
>> standalone pydal is there.
>> But if you're looking at developing a web app or rest api
>> Web2py Is quite good at it and quite well integrated with pydal  ;)
>>
>> Or what  inconvenience do you see with web2py for this project?
>>
>> Thanks
>> Bernard
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py job in Florida

2015-09-08 Thread Marin Pranjić
Here it is:

https://jobs.brassring.com/tgwebhost/jobdetails.aspx?jobId=1158965=25326=5443=mail=1=1=5443=1158965_5443=823

:)

On Tue, Sep 8, 2015 at 10:58 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> Seems a private link...
>
> 2015-09-08 10:45 GMT+02:00 Jason (spot) Brower :
>
>> Hmm, I went to the link but couldn't get anything.  Gave me some kind of
>> email access system.
>>
>> On Sun, Sep 6, 2015 at 7:58 AM Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> A new opportunity as an Application Software Developer is now available
>>> with Harris Corporation (Exelis)
>>> 
>>>  in
>>> Panama City Beach, Florida.  Harris Corporation is an industry innovator
>>> providing advanced communications and information systems to both
>>> government and commercial markets.  This position is in support of a
>>> Government contract (ability to obtain a US security clearance is
>>> required).  Primary responsibilities will include code development for
>>> emerging technology integration.  Desired skills include Python, Web2Py,
>>> JavaScript, Frameworks, HTML, .NET, and Java.  To view the full job
>>> description and to apply, please visit the following link:  18272BR –
>>> Applications Software/Development Engineer II
>>> 
>>> .
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Absolute URLs

2015-06-09 Thread Marin Pranjić
You don't need to force it. Use functools.partial to make your own URL
helper instead.

Marin

On Tue, Jun 9, 2015 at 12:21 PM, Francisco Costa m...@franciscocosta.com
wrote:

 How to force web2py to make all URL's absolute instead of having to write

 URL(..., scheme=True, host=True)

 in every link?


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Absolute URLs

2015-06-09 Thread Marin Pranjić
Ok, sorry. I don't think there is a way to do it like that. Looking for
something similar to auth.settings, right?

Marin

On Tue, Jun 9, 2015 at 3:32 PM, Francisco Tomé Costa 
m...@franciscocosta.com wrote:

 I was looking for a classy way to change the default, didn't want to
 rewrite the URL() function

 Francisco Tomé Costa
 +351 918412636 +351918412636
 https://www.linkedin.com/in/franciscocosta​

 On Tue, Jun 9, 2015 at 1:14 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 Ok, as you wish...

 Put this in model file:

 default_URL = URL
 URL =  new code here 


 Marin

 On Tue, Jun 9, 2015 at 1:30 PM, Francisco Tomé Costa 
 m...@franciscocosta.com wrote:

 but that way I would have to rewrite all my apps code, can't I change
 the default variables in models?
 I would like to have host=True by default

 Francisco Tomé Costa
 +351 918412636 +351918412636
 https://www.linkedin.com/in/franciscocosta​

 On Tue, Jun 9, 2015 at 12:26 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 You don't need to force it. Use functools.partial to make your own URL
 helper instead.

 Marin

 On Tue, Jun 9, 2015 at 12:21 PM, Francisco Costa 
 m...@franciscocosta.com wrote:

 How to force web2py to make all URL's absolute instead of having to
 write

 URL(..., scheme=True, host=True)

 in every link?


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/OuIouXnxTOQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/OuIouXnxTOQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Absolute URLs

2015-06-09 Thread Marin Pranjić
Ok, as you wish...

Put this in model file:

default_URL = URL
URL =  new code here 


Marin

On Tue, Jun 9, 2015 at 1:30 PM, Francisco Tomé Costa 
m...@franciscocosta.com wrote:

 but that way I would have to rewrite all my apps code, can't I change the
 default variables in models?
 I would like to have host=True by default

 Francisco Tomé Costa
 +351 918412636 +351918412636
 https://www.linkedin.com/in/franciscocosta​

 On Tue, Jun 9, 2015 at 12:26 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 You don't need to force it. Use functools.partial to make your own URL
 helper instead.

 Marin

 On Tue, Jun 9, 2015 at 12:21 PM, Francisco Costa m...@franciscocosta.com
  wrote:

 How to force web2py to make all URL's absolute instead of having to
 write

 URL(..., scheme=True, host=True)

 in every link?


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/OuIouXnxTOQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] is this a pydal issue?

2015-06-08 Thread Marin Pranjić
You should be able to just write:
if not (op_rec and op_rec2 and op_rec3 and op_rec4)

Marin

On Mon, Jun 8, 2015 at 1:03 PM, Auden RovelleQuartz oves@gmail.com
wrote:

 What does this error mean - I never got it pre-pydal...

 {
 Ticket ID

 24.211.17.122.2015-06-08.05-34-25.9f6361e2-d387-4cf8-adef-2216ad5c6476
 type 'exceptions.AttributeError' 'NoneType' object has no attribute
 'records'Versionweb2py™Version 2.11.2-stable+timestamp.2015.05.30.16.33.24
 PythonPython 2.7.3: /usr/bin/python (prefix: /usr)Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 3343, in module
   File /home/www-data/web2py/gluon/globals.py, line 412, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 920, in signup_captcha
 (op_rec == None) or (op_rec2 == None) or (op_rec3 == None) or (op_rec4 == 
 None)):
   File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py, line 
 2506, in __eq__
 return (self.records == other.records)
 AttributeError: 'NoneType' object has no attribute 'records'

 }

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Restricting Access to database based on roles at the Database level.

2015-05-14 Thread Marin Pranjić
Hey Jason,
you'll need to create database and setup users/roles[1].
Then use proper user in database URI string[2].

1 http://www.postgresql.org/docs/current/static/sql-createuser.html
2
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter-

On Thu, May 14, 2015 at 11:58 AM, Jason (spot) Brower encomp...@gmail.com
wrote:

 I am building a database that needs to be very secure for all those just
 in case situations.
 I want to restrict the database access based on roles that I setup.  Does
 web2py even have this functionality or is this something I have to do with
 SQLAlchemy or something?
 BR,
 Jason Brower

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: idea: new helpers

2015-04-01 Thread Marin Pranjić
Dmitry, you can create your own custom helpers and use them in your app.

On Wed, Apr 1, 2015 at 8:30 AM, Niphlod niph...@gmail.com wrote:

 hell no!


 On Wednesday, April 1, 2015 at 7:51:26 AM UTC+2, Dmitry Ermolaev wrote:

  DIV( _class='row my_class') = ROW(_class='my_class')

  DIV( _class='col-sm-4 my_class') = COL4(_class='my_class')

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] you mean me?

2015-03-31 Thread Marin Pranjić
Hehe, it seems that my name is written twice but both are wrong so maybe
that's not me either :D

Marin

On Tue, Mar 31, 2015 at 5:34 PM, Manuele Pesenti manuele.pese...@gmail.com
wrote:

 I noticed a Manuele Presenti is mentioned here:
 http://www.web2py.com/books/default/chapter/29/01/introduction
 but if you mean to mention me (and I would be VERY proud of it!!) my
 correct surname is Pesenti :)

 but I have always correct the spelling till I was a child :)

 maybe I can correct my self the error... if you confirm you really mean
 me :)

 M. Pesenti

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py framework as iOS app backend

2015-02-25 Thread Marin Pranjić
I have apps that run as android/ios backend services.
It's REST, there's nothing special about it.
You can use web2py if you like it, I would definitely reccomend it :)

Marin


On Wed, Feb 25, 2015 at 5:22 PM, Amit Kumar amt.ku...@gmail.com wrote:

 Hi,

 We are deciding backend layer for our iOS and Android mobile app. The app
 will interact with MySQL DB via REST JSON service. The implementation is
 not really complex.

 I wanted to check if web2py is a good option for our app. We have been
 looking at multiple python framework - Django, Flask and Web2Py... based on
 the documents it appears that web2py is a good fit. I wanted to check in
 the group if anyone has used web2py for iOS backend. These are going to be
 native iOS and Android apps.

 thanks for your time.

 amit

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] SQLite, or some other database?

2015-01-03 Thread Marin Pranjić
The latter one works only with postgres:
https://groups.google.com/forum/#!topic/web2py/1_DHUrrg6O8

What's the error message?

On Sat, Jan 3, 2015 at 5:30 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:



 On Friday, 2 January 2015 16:03:16 UTC-6, mweissen wrote:

 I have tried to convert an application from SQLite to Postgresql and I
 have found two differences:

 (1):
 q = some query like db.table.field3
 b = some boolean like a3
 db(q  b)

 SQLite needs to convert b to '0' or '1', Postgresql to 'FALSE' or 'TRUE'


 yes but web2py does it for you. you should not need to change your code.



 (2): orderby generates some difficult error messages. I have found the
 following solution
 SQLite
 db(db.table.field==x).select(orderby=db.table.field2,
 groupby=db.table.field2)

 Postgresql:
 db(db.table.field==x).select(orderby=db.table.field2,
 distinct=db.table.field2)


 Are you sure? I think they both work on both databases. The problems arise
 when you groupby some fields and records are not sorted by those fields.
 Some engines allow it and some don't.


 Does somebody has similar experiences?

 Regards, Martin


 2015-01-02 16:29 GMT+01:00 Michele Comitini michele.comit...@gmail.com:

 SQLite is by design an excellent embedded database,  better suited for
 single user implementation and targeted at small datasets.
 For larger datasets there is no reason not to use PostgreSQL, it's free,
 well supported by web2py,
 handles very large datasets and it's easy to setup.

 Migration from SQLite to any other db supported by web2py is very easy
 and explained on the web2py book

 2015-01-02 6:49 GMT+01:00 Eric Taw tawe...@gmail.com:

 From reading a lot of web2py tutorials and guides, they always say
 SQLite is good for small implementations of databases, whereas other SQL
 flavors are better suited for larger uses. Is there any reason why? Can I
 still use SQLite if I have a lot of information to store?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



   --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py error on cygwin

2014-11-23 Thread Marin Pranjić
You don't need a gui, just type the password in the console (as in
screenshot)

Marin

On Sun, Nov 23, 2014 at 6:40 AM, Jorge Molongua jorge.molon...@gmail.com
wrote:

 Hi. I'm using cygwin on Windows 8. I'm new to this. It reports a warning
 when I try to load web2py: WARNING:web2py:GUI not available because Tk
 library is not installed. How can I work round this?

 I not literate in Linux. Attached is s screen shot.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] if else if in views

2014-10-31 Thread Marin Pranjić
Why don't you use elif?

On Wed, Oct 29, 2014 at 6:23 PM, Sriram Gudimella 
sriramsgudime...@gmail.com wrote:

 Why does this ..
 table
 {{for i in range(0,3):}}
 tr
 {{if i==0:}}
 td
 Email :
 /td
 td
 {{=form[i]}}
 /td
 br/
 /tr
 {{else if i==1:}}
 tr
 td
 Passkey :
 /td
 td
 {{=form[1]}}
 /td
 /tr
 {{else :}}
 tr
 td
 /td
 td
 {{=form[2]}}
 /td
 /tr
 {{pass}}
 {{pass}}
 /table
 translate to

 for i in range(0,3):
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\ttr\n\t', 
 escape=False)
 if i==0:
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\t\ttd\n\t\tEmail
  :\n\t\t/td\n\t\ttd\n\t\t', escape=False)
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write(form[i])
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\t\t/td\n\t\tbr/\n\t/tr\n\t',
  escape=False)
 else if i==1:
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\ttr\n\t\ttd\n\t\tPasskey
  :\n\t\t/td\n\t\ttd\n\t\t', escape=False)
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write(form[1])
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\t\t/td\n\t/tr\n\t',
  escape=False)
 else :
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\ttr\n\t\ttd\n\t\t/td\n\t\ttd\n\t\t',
  escape=False)
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write(form[2])
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\t\t/td\n\t/tr\n\t',
  escape=False)
 pass
 response 
 http://127.0.0.1:8000/examples/global/vars/response.write('\n\t', 
 escape=False)
 pass


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Making a DevBar to develop faster in web2py.

2014-09-18 Thread Marin Pranjić
Hi!

Interesting. Basically you want to time how long does it take for
response.render(...).

Easiest way would be to use a decorator:
- your function returns dict(data=data)
- you decorate it, call response.render(response.view, return_dict) and
time it
- return the result (it will be a string so it will bypass web2py's magic
with dicts)

Next step would be to decorate the functions automatically (without using
decorators ^_^). You can monkeypatch response._caller(...). It takes a
function to be called [if you have def index():, it will be called as
response._caller(index)].
This way you can also time execution of the function, not just the view
rendering :). You don't change anything inside web2py code. You can just
disable it in production.
Btw, I didn't try it, but it should work.
Note that in web2py you can do whatever you want in views (including db
queries) so it's not just rendering.

Marin

On Thu, Sep 18, 2014 at 7:56 AM, Encompass solutions encomp...@gmail.com
wrote:

 Yes, this is something that should only be used in a local setup.  It's to
 help development.  If there are ways to stop this from showing up
 accidently anyway, I fully intend on using it.
 As for the page load time feature, that was for the loading of the
 document from the browsers perspective.  I hope to avoid that one, I think
 some timing for how long it took python to render the page would be more
 appropriate.  Let's see if I can figure that out. :/
 Here is my update of the UI in video format. Please, anyone, comment.
 BR,
 Jason Brower



 On Thursday, September 18, 2014 6:24:40 AM UTC+3, Massimo Di Pierro wrote:

 You would have to pass that information but mind that they may contain
 data that is sensitive and private.

 globals() contains all the global variables. db._timings is a list of
 (SQL, time) for all the queries. For the loading time look into window
 performance client-side: http://stackoverflow.com/questions/
 13045767/page-load-time-with-javascript


 On Tuesday, 16 September 2014 14:28:16 UTC-5, Encompass solutions wrote:


 I am working on a feature for web2py and would like to gather the
 following information:

- How long did it take to render html for the page.
- What database calls occured with this page render.
- What were the calls that were made in SQL and DAL format.
- What Global variables are set in the model.

 The idea I am working on is a bar that would render if locally run, or
 requested, that would display information about content sent to the page.
 Like the generic page but a little more informative and able to pulled up
 without interfering with the page at all.

 How would I get what I have stated above?

 Is there other content you would want for this DevBar, as I call it?  I
 don't want to try to make my own firebug or anything, just stuff
 specifically about web2py's and the things that might be needed in making
 sure the page loads properly and developed quickly.

 Attached are my beginnings of it.  It would pull out from the left with
 an html widget in the top right.  Then selecting a tab on the right would
 load content on the left with the original page in the background.

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Trying to post a small improvement to web2py source.

2014-09-13 Thread Marin Pranjić
Hi,

you need to fork web2py project on github, then you'll have your own repo
in which you can push your change.
(you need a github account)

Clone your own fork, make a change there and push it back to github.

When you push the change, you can open a pull request from your fork to
web2py's repo. You should be able to figure it out in the github UI. Let me
know if you need more help.

Marin

On Sat, Sep 13, 2014 at 8:39 AM, Encompass solutions encomp...@gmail.com
wrote:

 How do I submit a small change I have made the the Web2py source?
 It's a small improvement.  But when I try to git push I get a 403 error.
 I also don't know much about pull requests, but I think those are involved
 too.
 BR,
 Jason Brower

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread Marin Pranjić
Make sure to read Authorization chapter in book:

http://web2py.com/books/default/chapter/29/09/access-control#Authorization

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: a proposal for form improvement

2014-09-06 Thread Marin Pranjić
On Sat, Sep 6, 2014 at 9:52 AM, Robin Manoli ramat...@gmail.com wrote:

 Great idea!
 I think definitely web2py should be optimized towards ajax and javascript.

 I do not use SQLFORM because fixing the html it generates often takes more
 time than to write my own html. I think there are some improvements that
 can be done to forms anyway, which can be implemented in a new standard.For
 example that it's a bit tricky to remove colons from form labels.

 SQLFORM is precious for what it does on server side, not because of html.
You should still use it even if you write your own html. :)

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Reasoning behind dict objects, such as request.vars, session, etc

2014-09-06 Thread Marin Pranjić
Hi!

The whole pythonic or not pythonic is silly IMO.
Python gives us freedom. Yes, you can do stupid things, but this feature is
cool and useful, so why not?
And it's not pythonic is not an argument at all. They should point out
bad things that could happen.
Maybe there are some bad edge cases, maybe you care about performance hits,
maybe something else, maybe, but if no one has a valid point, not
pythonic shouldn't be either.


Now, two things:

1. In web2py, you can use Storage (from gluon.storage import Storage).
2. In regular python world, there are other implementations, such as
attrdict: https://pypi.python.org/pypi/attrdict/0.5.1 (haven't tried, but
should work very similar)

Marin

On Sat, Sep 6, 2014 at 9:31 AM, Robin Manoli ramat...@gmail.com wrote:


 Hey,
 It is much more clean to write *session.var* than *session['var']* when I
 can, as well as *if session.var* instead of *if hasattr(session, 'var')*,
 and I would like to use this style of coding generally in python, if it can
 remain pythonic.

 I've been looking into using classes to store values, just like for
 example session does in web2py. I found on stack overflow that it might not
 be pythonic, it is not recommended by some experienced programmers. After
 trying many ways to do this, none of the ways I tried created classes with
 instances. In other words, if I would make two instances of my class they
 would share attribute values. Setting *myobject2.var* would also set
 *myobject.var* to the same value.

 Now in web2py these objects (session, request.vars) are used as predefined
 instances -- they are not normally used for making your own instances. This
 way they could be their own type of class (I didn't look into it). Perhaps
 this keeps things pythonic, or did you web2py developers find a pythonic
 and sustainable way to create your own dict objects?

 Ps. Even though I could think of ways to deal with the issue of shared
 attributes, I wouldn't really like to write a new class, as there are many
 cases which need to be handled.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: type 'exceptions.RuntimeError' File.../databases/c8b....sales.table appears corrupted

2014-09-05 Thread Marin Pranjić
It can happen if you run out of disk space. You should check it.

Btw, maybe just .table got corrupted... Make sure to backup everything, and
then do a fake migrate.

Marin


On Fri, Sep 5, 2014 at 6:51 PM, Greg Vaughan greg.s.vaug...@gmail.com
wrote:

 I wasn't working on the site at the time... I was notified by some of the
 employees... yes it looks like the table has been dropped... I cannot for
 the life of me work out how that could have happened though.


 On Saturday, 6 September 2014 02:41:30 UTC+10, Leonel Câmara wrote:

 Err wait a minute the table has actually been dropped?

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py 2.9.6 is out!

2014-09-02 Thread Marin Pranjić
Home key doesn't work for you?


On Tue, Sep 2, 2014 at 5:31 PM, António Ramos ramstei...@gmail.com wrote:

 Speaking about documentation...

 In the English online book, the Table of Contents should be fixed.

 I HATE having to scroll to the top to select another topic.

 I suppose other peolpe should/must hate it also.

 Regards


 2014-09-02 16:10 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:

 Thank you Tim for all your hard work, specifically in keeping the
 documentation updated.


 On Tuesday, 2 September 2014 07:00:54 UTC-5, Tim Richardson wrote:

 thank you all.

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] How can I prevent a user from pressing the browser's back button?

2014-08-30 Thread Marin Pranjić
You can't. This is something you should take care of on server side.
Use session to store user's state, or store it in DB.


On Tue, Aug 26, 2014 at 11:36 PM, Fotis Gioulekas gioule...@gmail.com
wrote:

 Hello to everybody,

 I have built a quiz that randomlycreates questions.
 Each time a user submits it's answer, the app redirects to another
 question.
 When the user does not want to continue to another question it presses a
 button exit quiz and the app redirects to another url.
 When the user presses the browser's back button, it can return back to the
 quiz.
 How can I prevent this?
 Is there a solution that either closes the browser's tab or redirects to a
 default html page when the user presses the back broswer's button or

 My app does not requires user registratrion and login.

 Thank you in advance,
 Fotios

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: float usage; 2 decimals

2014-08-15 Thread Marin Pranjić
Can you show us your table definition?
Web2py doesn't have float. There are double and decimal field types.
You don't need to use postgres.

Marin


On Fri, Aug 15, 2014 at 10:22 AM, Stefan van den Eertwegh 
stefan.eertw...@gmail.com wrote:

 I use in the model the type float and MySQL as backend database and MySQL
 uses INT() as datatype for that field

 So i must use decimal(10,2) as field type in the model and as backand db
 postgres?

 Op donderdag 14 augustus 2014 21:39:56 UTC+2 schreef Cliff Kachinske:

 What database?

 Web2py has a decimal datatype which, in my use cases, mimics the Python
 decimal datatype. I use Postgresql and the adapter turns Python decimal
 into Postgres numeric. Both of these types act like real world decimal
 numbers. In other words, .2 + .1 comes out to .3. Of course a different db
 backend may work differently.

 Just google python decimal.

 On Friday, July 11, 2014 5:50:30 AM UTC-4, Stefan van den Eertwegh wrote:

 Hi,

 I have a float type in the define tables and when he inserts 3.50 into
 the database he makes 4.0 off it.
 How comes that it rounds off the float? And not uses the usage of 2
 decimals?

 Thank you!

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: float usage; 2 decimals

2014-08-15 Thread Marin Pranjić
Can you change float to double and try if it fixed the issue?

Marin


On Fri, Aug 15, 2014 at 10:31 AM, Stefan van den Eertwegh 
stefan.eertw...@gmail.com wrote:

 db.define_table(
 'invoice_rule',
 Field('invoice', db.invoice, label=T('Invoice no.')),
 Field('amount', 'float', label=T('Amount')),
 Field('product', 'float', label=T('Product'),
 requires=IS_EMPTY_OR(IS_IN_DB(db, db.product.id, db.product._format))),
 Field('description', 'string', label=T('Description')),
 Field('date', 'date', label=T('Date')),
 Field('vat_percentage', 'string',
 requires=IS_IN_SET(settings.vat_percentage), label=T('VAT')),
 Field('quantity', 'float', label=T('Quantity'))
 )


 Met vriendelijke groet,
 Stefan van den Eertwegh


 2014-08-15 10:26 GMT+02:00 Marin Pranjić marin.pran...@gmail.com:

  Can you show us your table definition?
 Web2py doesn't have float. There are double and decimal field types.
 You don't need to use postgres.

 Marin


 On Fri, Aug 15, 2014 at 10:22 AM, Stefan van den Eertwegh 
 stefan.eertw...@gmail.com wrote:

 I use in the model the type float and MySQL as backend database and
 MySQL uses INT() as datatype for that field

 So i must use decimal(10,2) as field type in the model and as backand db
 postgres?

 Op donderdag 14 augustus 2014 21:39:56 UTC+2 schreef Cliff Kachinske:

 What database?

 Web2py has a decimal datatype which, in my use cases, mimics the Python
 decimal datatype. I use Postgresql and the adapter turns Python decimal
 into Postgres numeric. Both of these types act like real world decimal
 numbers. In other words, .2 + .1 comes out to .3. Of course a different db
 backend may work differently.

 Just google python decimal.

 On Friday, July 11, 2014 5:50:30 AM UTC-4, Stefan van den Eertwegh
 wrote:

 Hi,

 I have a float type in the define tables and when he inserts 3.50 into
 the database he makes 4.0 off it.
 How comes that it rounds off the float? And not uses the usage of 2
 decimals?

 Thank you!

  --
 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+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/IUs0Zjgmseo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: float usage; 2 decimals

2014-08-15 Thread Marin Pranjić
Do you need to keep existing data?

If you don't, the easiest solution would be to drop affected tables, remove
their *.table files (stored in databases directory), and let web2py
recreate it.

If you need to keep the data, but you don't care about those float/double
fields, you can manually change those fields.

[I wonder why web2py didn't automigrate...]


On Fri, Aug 15, 2014 at 10:42 AM, Stefan van den Eertwegh 
stefan.eertw...@gmail.com wrote:

 Yes, that fixed the issue. but only for a new field, it adds the new field
 in mysql as type double.
 If i change a current field in the model to double than it stays as int in
 mysql.

 Shall i change the fields manually in mysql?

 Op vrijdag 15 augustus 2014 10:35:49 UTC+2 schreef Marin Pranjić:

 Can you change float to double and try if it fixed the issue?

 Marin


 On Fri, Aug 15, 2014 at 10:31 AM, Stefan van den Eertwegh 
 stefan@gmail.com wrote:

 db.define_table(
 'invoice_rule',
 Field('invoice', db.invoice, label=T('Invoice no.')),
 Field('amount', 'float', label=T('Amount')),
 Field('product', 'float', label=T('Product'),
 requires=IS_EMPTY_OR(IS_IN_DB(db, db.product.id, db.product._format))),
 Field('description', 'string', label=T('Description')),
 Field('date', 'date', label=T('Date')),
 Field('vat_percentage', 'string', 
 requires=IS_IN_SET(settings.vat_percentage),
 label=T('VAT')),
 Field('quantity', 'float', label=T('Quantity'))
 )


 Met vriendelijke groet,
 Stefan van den Eertwegh


 2014-08-15 10:26 GMT+02:00 Marin Pranjić marin@gmail.com:

  Can you show us your table definition?
 Web2py doesn't have float. There are double and decimal field types.
 You don't need to use postgres.

 Marin


 On Fri, Aug 15, 2014 at 10:22 AM, Stefan van den Eertwegh 
 stefan@gmail.com wrote:

 I use in the model the type float and MySQL as backend database and
 MySQL uses INT() as datatype for that field

 So i must use decimal(10,2) as field type in the model and as backand
 db postgres?

 Op donderdag 14 augustus 2014 21:39:56 UTC+2 schreef Cliff Kachinske:

 What database?

 Web2py has a decimal datatype which, in my use cases, mimics the
 Python decimal datatype. I use Postgresql and the adapter turns Python
 decimal into Postgres numeric. Both of these types act like real world
 decimal numbers. In other words, .2 + .1 comes out to .3. Of course a
 different db backend may work differently.

 Just google python decimal.

 On Friday, July 11, 2014 5:50:30 AM UTC-4, Stefan van den Eertwegh
 wrote:

 Hi,

 I have a float type in the define tables and when he inserts 3.50
 into the database he makes 4.0 off it.
 How comes that it rounds off the float? And not uses the usage of 2
 decimals?

 Thank you!

  --
 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/web2py/IUs0Zjgmseo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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

Re: [web2py] Nginx and uwsgi Internal Server Error

2014-08-04 Thread Marin Pranjić
Did you copy wsgihandler.py inside web2py root?

Marin


On Mon, Aug 4, 2014 at 11:50 PM, Jim S j...@qlf.com wrote:

 Clean install with all dependencies in place before installing
 nginx/uwsgi/web2py yields the same results.  It works if I don't have
 pyodbc installed.

 Any more thoughts on what I could do for debugging?

 -Jim

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Nginx and uwsgi Internal Server Error

2014-08-04 Thread Marin Pranjić
Is uwsgi running after restart? ps aux | grep uwsgi


On Tue, Aug 5, 2014 at 12:08 AM, Jim Steil ato.st...@gmail.com wrote:

 I did not.  I used the script in the web2py/scripts directory.


 On Mon, Aug 4, 2014 at 5:07 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 Did you copy wsgihandler.py inside web2py root?

 Marin


 On Mon, Aug 4, 2014 at 11:50 PM, Jim S j...@qlf.com wrote:

 Clean install with all dependencies in place before installing
 nginx/uwsgi/web2py yields the same results.  It works if I don't have
 pyodbc installed.

 Any more thoughts on what I could do for debugging?

 -Jim

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/Fkaz9N8bMh0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Nginx and uwsgi Internal Server Error

2014-08-04 Thread Marin Pranjić
Can you check again if there is wsgihandler.py inside web2py root directory?
Can you make sure sockets are created inside /tmp and www-data owns them?
What does nginx error log say when you try to make a request?

I had a 5-hour fight with uwsgi last week. It's really hard to debug it
because logs don't say much about the issue. :(


On Tue, Aug 5, 2014 at 12:27 AM, Jim Steil ato.st...@gmail.com wrote:

 appears to be.  Also, keep in mind that all of this works with the rocket
 server...

 administrator@web1-14:/home/www-data/web2py$ ps aux | grep uwsgi
 root   788  0.0  0.1  39256  6380 ?Ss   17:15   0:00 uwsgi
 --master --die-on-term --emperor /etc/uwsgi --logto /var/log/uwsgi/uwsgi.log
 root   892  0.0  0.0  36612  1112 ?S17:15   0:00 uwsgi
 --master --die-on-term --emperor /etc/uwsgi --logto /var/log/uwsgi/uwsgi.log
 www-data   893  0.0  0.4  84564 19308 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   996  0.0  0.3  84564 14704 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   997  0.0  0.3  84564 14704 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   998  0.0  0.3  84564 15088 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   999  0.0  0.3  84564 14840 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 adminis+  1258  0.0  0.0  11748   916 pts/0S+   17:26   0:00 grep
 --color=auto uwsgi
 administrator@web1-14:/home/www-data/web2py$



 On Mon, Aug 4, 2014 at 5:12 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 Is uwsgi running after restart? ps aux | grep uwsgi


 On Tue, Aug 5, 2014 at 12:08 AM, Jim Steil ato.st...@gmail.com wrote:

 I did not.  I used the script in the web2py/scripts directory.


 On Mon, Aug 4, 2014 at 5:07 PM, Marin Pranjić marin.pran...@gmail.com
 wrote:

 Did you copy wsgihandler.py inside web2py root?

 Marin


 On Mon, Aug 4, 2014 at 11:50 PM, Jim S j...@qlf.com wrote:

 Clean install with all dependencies in place before installing
 nginx/uwsgi/web2py yields the same results.  It works if I don't have
 pyodbc installed.

 Any more thoughts on what I could do for debugging?

 -Jim

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/Fkaz9N8bMh0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/Fkaz9N8bMh0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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

Re: [web2py] Re: Radio widget not working as a Boolean

2014-06-28 Thread Marin Pranjić
Boolean field is meant to be used with checkbox.
Checkbox doesn't even submit if it's not checked and that's how False is
identified.

You can use filter_in or SQLCustomType to modify the behavior and to map
one into another.

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types--experimental-


On Sat, Jun 28, 2014 at 12:46 AM, Carlos Zenteno cmzent...@gmail.com
wrote:

 OK, my IS_IN_SET should be: IS_IN_SET([(True, T('Yes')),(False, T('No'))])
 and now the selection shows in the form.

 Still:
 - it does not enforce default=False
 - no matter if I choose Yes or No (True or False), it puts True in db

 Having a feeling that this does not work with boolean ( a shame)
 I have found thread where it works with integers or with 1 char strings...
 !!!

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Do not mask password field

2014-06-13 Thread Marin Pranjić
Can you try if this works?

db.auth_user.password.type = 'string'


On Sat, Jun 14, 2014 at 12:26 AM, Dave S snidely@gmail.com wrote:



 On Friday, June 13, 2014 2:09:59 PM UTC-7, Robert O'Connor wrote:

 You could do it via js likely...but better question is why do you want
 this?

 --Rob
 Sent from my phone...excuse any typos please!

 Well, that there points to one reason   ;-)

 (It's not unusual for mobile apps to briefly show the last character
 entered before the masking character covers it.)

 /dps


 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py password encryption/decryption

2014-05-30 Thread Marin Pranjić
You can change current behavior by changing db.auth_user.password.requires.

This is a default validator:
https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1786-L1787

it's being used here:
https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1850-L1852


Check if you can get desired fromat from CRYPT validator:
https://github.com/web2py/web2py/blob/master/gluon/validators.py#L2850

If not, just create your own:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-validators

Marin


On Fri, May 30, 2014 at 4:22 PM, farmy zdrowia bi...@farmyzdrowia.pl
wrote:

 Hello,
 I'm trying to integrate web2py users to be stored in joomla  _users
 database instead of auth_user. I can see joomla and web2py use different
 algorithm do code/decode passwords.
 Joomla password looks like:
   $P$DryHu7D3LgdPOK//FPvuVMcMR13HgU1
 , while web2py

 pbkdf2(1000,20,sha512)$a76b573005c73906$01f33be064bd2a283350206fd29355f9fa2b30fe

 I'd like to change web2py default algorithm to code/decode passwords to be
 similar to joomla simply to have common users database.
 Could you help a bit and guide me where this function is located and how
 to change it?



 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Issue about ,user_signature=True

2014-05-14 Thread Marin Pranjić
are you logged in?

Marin


On Wed, May 14, 2014 at 5:28 PM, António Ramos ramstei...@gmail.com wrote:

 Hello i use user_signature=True in an app.

 I recently moved it to a linux(centos)box at webfaction

 suddenly i get Not authorized when clicking a link to page B in a page A
 that has a signed url

 the link to page B is  not a signed url

 http://xxx.pt//myapp/default/equip/97?emp=131


 It shows the error flash message and directs me to the page A.

 Strange, why is this?

 Any help please?

 Thank you

 António

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Issue about ,user_signature=True

2014-05-14 Thread Marin Pranjić
So you are on page A. You click the link on page B that is not signed.
Which one is signed then?

Do you have any decorators on function B?

Are you using the same host name on both pages? (you might be missing www.
in a link for example)


On Wed, May 14, 2014 at 5:47 PM, António Ramos ramstei...@gmail.com wrote:

 yes!!


 2014-05-14 16:45 GMT+01:00 Marin Pranjić marin.pran...@gmail.com:

 are you logged in?

 Marin


 On Wed, May 14, 2014 at 5:28 PM, António Ramos ramstei...@gmail.comwrote:

 Hello i use user_signature=True in an app.

 I recently moved it to a linux(centos)box at webfaction

 suddenly i get Not authorized when clicking a link to page B in a page
 A that has a signed url

 the link to page B is  not a signed url

 http://xxx.pt//myapp/default/equip/97?emp=131


 It shows the error flash message and directs me to the page A.

 Strange, why is this?

 Any help please?

 Thank you

 António

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] strange problem with DAL

2014-05-05 Thread Marin Pranjić
Well, nothing unusual with my table definitions. Everything by the specs.
I just removed all .table files and started with new sqlite file, and that
problem is gone.
(i still have copies)

Seems that files were stuck in some state.

However, main.message error still confuses me, because sql query that's
created by DAL is valid.
And this happens even after migrations are fixed.

So it's probably SQLite that's broken/corrupted and I'm not sure if those
issues are somehow related.

Marin




On Sun, May 4, 2014 at 8:58 PM, Niphlod niph...@gmail.com wrote:

 how are your table defined ? the fact that 'main.message' gets into the
 error seems a little weird for a table named message_receiver. Also, that
 success repeated into sql.log means that something really strange is
 going on with your migrations.


 On Sunday, May 4, 2014 3:22:19 PM UTC+2, Marin Pranjić wrote:

 To confirm...
 https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262

 This gets executed on every request.

 However I still don't understand why sqlite fails on insert.

 It fails on testing server but it works on my local instance.

 Marin


  On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić marin@gmail.comwrote:

  Hi.

 I have application hosted on EC2. It is a testing server. It's like
 production environment except it uses SQLite.

 I have a table called message_receiver. When I fetch records (for ex. in
 appadmin) it works, but when I try to insert something (appadmin or in-app)
 i get the following error:

 OperationalError: no such table: main.message



 I got the actual SQL query from the error ticket:



 INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES 
 (NULL,93,1);



 That seems correct.

 However, I noticed that my sql.log is bigger than sqlite database file. It 
 has lots of success! messages inside.
 And it seems that migration for some tables is triggered on every request 
 but nothing changes in .table files.



 There are 6 tables that are affected by migration but I don't see a pattern.

 Can someone suggest how to trace/debug 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] strange problem with DAL

2014-05-05 Thread Marin Pranjić
I copied broken database locally so I can test it.
I also added print
herehttps://github.com/web2py/web2py/blob/master/gluon/dal.py#L1353to
get actual queries.

Queries are fine. Actually if I just c/p those queries into SQLite Database
Browser, it works (on the same database file).

So it's not web2py, it's not sqlite, but it doesn't work.

-__-



On Mon, May 5, 2014 at 9:05 AM, Marin Pranjić marin.pran...@gmail.comwrote:

 Well, nothing unusual with my table definitions. Everything by the specs.
 I just removed all .table files and started with new sqlite file, and that
 problem is gone.
 (i still have copies)

 Seems that files were stuck in some state.

 However, main.message error still confuses me, because sql query that's
 created by DAL is valid.
 And this happens even after migrations are fixed.

 So it's probably SQLite that's broken/corrupted and I'm not sure if those
 issues are somehow related.

 Marin




 On Sun, May 4, 2014 at 8:58 PM, Niphlod niph...@gmail.com wrote:

 how are your table defined ? the fact that 'main.message' gets into the
 error seems a little weird for a table named message_receiver. Also, that
 success repeated into sql.log means that something really strange is
 going on with your migrations.


 On Sunday, May 4, 2014 3:22:19 PM UTC+2, Marin Pranjić wrote:

 To confirm...
 https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262

 This gets executed on every request.

 However I still don't understand why sqlite fails on insert.

 It fails on testing server but it works on my local instance.

 Marin


  On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić marin@gmail.comwrote:

  Hi.

 I have application hosted on EC2. It is a testing server. It's like
 production environment except it uses SQLite.

 I have a table called message_receiver. When I fetch records (for ex.
 in appadmin) it works, but when I try to insert something (appadmin or
 in-app) i get the following error:

 OperationalError: no such table: main.message




 I got the actual SQL query from the error ticket:




 INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES 
 (NULL,93,1);




 That seems correct.

 However, I noticed that my sql.log is bigger than sqlite database file. It 
 has lots of success! messages inside.
 And it seems that migration for some tables is triggered on every request 
 but nothing changes in .table files.




 There are 6 tables that are affected by migration but I don't see a 
 pattern.

 Can someone suggest how to trace/debug 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Querying Tables from Private Folder

2014-05-05 Thread Marin Pranjić
The command written in previous message is meant to be run along with
web2py server, not instead.

If that's what you mean by isolation. Not sure if I understand the question.


Marin



On Sun, May 4, 2014 at 5:35 PM, jaw...@gmail.com wrote:

 Thanks Marin

 Is there any way to tun the script in isolation so that it can detect
 the tables?

 My current setup is that I have the web2py.py server already running and
 then running each Private script in isolation (general web scraping).


 On Sunday, 4 May 2014 09:58:38 UTC+2, Marin Pranjić wrote:

 Tables are in there but if you don't call db.define_table(...) DAL will
 not know about them.

 How are you running the script in private?


 You can do something like this:
 python web2py.py -S appname -M -R applications/appname/private/
 scriptname.py

 This will run your models before running the script, so scriptname.py
 will have access to DAL and everything.
 Of course, this expects table definitions in application's model files.

 Marin


 On Sat, May 3, 2014 at 2:03 PM, jaw...@gmail.com wrote:

  I'm trying to query my tables from the private folder:

 from gluon.tools import DAL

 db = DAL(sqlite://../databases/storage.sqlite)
 print db.tables

 However none of my tables can be seen.

 The idea is to have a better manner of extracting data rather than the
 old-school:

 with sqlite3.connect('../databases/storage.sqlite') as conn:
 c = conn.cursor()
 etc

 What am I missing?

 --
 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] strange problem with DAL

2014-05-05 Thread Marin Pranjić
default DAL configuration that is shipped with welcome app.
I also searched for solution but didn't find anything.

sqlite path is fine. There are at least 10 queries in the same transaction
before this one breaks.
i have no idea what's wrong...


On Mon, May 5, 2014 at 11:40 PM, Derek sp1d...@gmail.com wrote:

 What I've read says that you need to specify the full path to the sqlite
 data file or you will get this error. What's your db.py look like?


 On Monday, May 5, 2014 12:31:35 AM UTC-7, Marin Pranjić wrote:

 I copied broken database locally so I can test it.
 I also added print 
 herehttps://github.com/web2py/web2py/blob/master/gluon/dal.py#L1353to get 
 actual queries.

 Queries are fine. Actually if I just c/p those queries into SQLite
 Database Browser, it works (on the same database file).

 So it's not web2py, it's not sqlite, but it doesn't work.

 -__-



 On Mon, May 5, 2014 at 9:05 AM, Marin Pranjić marin@gmail.comwrote:

 Well, nothing unusual with my table definitions. Everything by the specs.
  I just removed all .table files and started with new sqlite file, and
 that problem is gone.
 (i still have copies)

 Seems that files were stuck in some state.

 However, main.message error still confuses me, because sql query that's
 created by DAL is valid.
 And this happens even after migrations are fixed.

 So it's probably SQLite that's broken/corrupted and I'm not sure if
 those issues are somehow related.

 Marin




 On Sun, May 4, 2014 at 8:58 PM, Niphlod nip...@gmail.com wrote:

 how are your table defined ? the fact that 'main.message' gets into the
 error seems a little weird for a table named message_receiver. Also, that
 success repeated into sql.log means that something really strange is
 going on with your migrations.


 On Sunday, May 4, 2014 3:22:19 PM UTC+2, Marin Pranjić wrote:

 To confirm...
 https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262

 This gets executed on every request.

 However I still don't understand why sqlite fails on insert.

 It fails on testing server but it works on my local instance.

 Marin


  On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić marin@gmail.comwrote:

  Hi.

 I have application hosted on EC2. It is a testing server. It's like
 production environment except it uses SQLite.

 I have a table called message_receiver. When I fetch records (for ex.
 in appadmin) it works, but when I try to insert something (appadmin or
 in-app) i get the following error:

 OperationalError: no such table: main.message






 I got the actual SQL query from the error ticket:






 INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES 
 (NULL,93,1);






 That seems correct.

 However, I noticed that my sql.log is bigger than sqlite database file. 
 It has lots of success! messages inside.
 And it seems that migration for some tables is triggered on every 
 request but nothing changes in .table files.






 There are 6 tables that are affected by migration but I don't see a 
 pattern.

 Can someone suggest how to trace/debug 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] strange problem with DAL

2014-05-05 Thread Marin Pranjić
File can't just dissapear in the middle of transaction :)
And my table is not called main.message anyway.
And it's not blank, I have data stored in there that I can read.
I can't write into one specific table. Other tables work.

Marin


On Tue, May 6, 2014 at 12:21 AM, Derek sp1d...@gmail.com wrote:

 well, it will be fine until it can't find the file, creates it again blank.


 http://stackoverflow.com/questions/14262771/why-am-i-suddenly-getting-operationalerror-no-such-table


 On Monday, May 5, 2014 3:12:31 PM UTC-7, Marin Pranjić wrote:

 default DAL configuration that is shipped with welcome app.
 I also searched for solution but didn't find anything.

 sqlite path is fine. There are at least 10 queries in the same
 transaction before this one breaks.
 i have no idea what's wrong...


 On Mon, May 5, 2014 at 11:40 PM, Derek sp1...@gmail.com wrote:

 What I've read says that you need to specify the full path to the sqlite
 data file or you will get this error. What's your db.py look like?


 On Monday, May 5, 2014 12:31:35 AM UTC-7, Marin Pranjić wrote:

 I copied broken database locally so I can test it.
 I also added print 
 herehttps://github.com/web2py/web2py/blob/master/gluon/dal.py#L1353to 
 get actual queries.

 Queries are fine. Actually if I just c/p those queries into SQLite
 Database Browser, it works (on the same database file).

 So it's not web2py, it's not sqlite, but it doesn't work.

 -__-



 On Mon, May 5, 2014 at 9:05 AM, Marin Pranjić marin@gmail.comwrote:

 Well, nothing unusual with my table definitions. Everything by the
 specs.
  I just removed all .table files and started with new sqlite file, and
 that problem is gone.
 (i still have copies)

 Seems that files were stuck in some state.

 However, main.message error still confuses me, because sql query
 that's created by DAL is valid.
 And this happens even after migrations are fixed.

 So it's probably SQLite that's broken/corrupted and I'm not sure if
 those issues are somehow related.

 Marin




 On Sun, May 4, 2014 at 8:58 PM, Niphlod nip...@gmail.com wrote:

 how are your table defined ? the fact that 'main.message' gets into
 the error seems a little weird for a table named message_receiver. 
 Also,
 that success repeated into sql.log means that something really strange 
 is
 going on with your migrations.


 On Sunday, May 4, 2014 3:22:19 PM UTC+2, Marin Pranjić wrote:

 To confirm...
 https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262

 This gets executed on every request.

 However I still don't understand why sqlite fails on insert.

 It fails on testing server but it works on my local instance.

 Marin


  On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić 
 marin@gmail.comwrote:

  Hi.

 I have application hosted on EC2. It is a testing server. It's like
 production environment except it uses SQLite.

 I have a table called message_receiver. When I fetch records (for
 ex. in appadmin) it works, but when I try to insert something 
 (appadmin or
 in-app) i get the following error:

 OperationalError: no such table: main.message








 I got the actual SQL query from the error ticket:








 INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES 
 (NULL,93,1);








 That seems correct.

 However, I noticed that my sql.log is bigger than sqlite database 
 file. It has lots of success! messages inside.
 And it seems that migration for some tables is triggered on every 
 request but nothing changes in .table files.








 There are 6 tables that are affected by migration but I don't see a 
 pattern.

 Can someone suggest how to trace/debug 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



  --
 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+un...@googlegroups.com

Re: [web2py] if statement always true in view

2014-05-04 Thread Marin Pranjić
You have a typo in there. funciton  should be function.

That's why it always returns None.


Marin


On Sat, May 3, 2014 at 5:15 PM, john smith lukaszbur...@gmail.com wrote:

 Hello!
 I have a problem with 'reddit-clone' app from this tutorial. I'm stuck at
 moment in 2:28:00. My problem is with if statement that is supposed to
 change the button responsible for changing the view.
 For me the condition is always false, even though when printed, the
 request.function shows 'list_posts_by_votes' which is the condition.
 Here is the code:
 {{if request.funciton=='list_posts_by_votes':}}
 {{=A('sort by datetime', _class='btn', _href=URL('list_posts_by_datetime',args
 =category.name))}}
 h3this part never works for me/h3
 {{else:}}
 {{=A('sort by votes', _class='btn', _href=URL('list_posts_by_votes', args=
 category.name))}}
 h3{{=request.function}}/h3
 {{pass}}


 You can find the whole code 
 here:linkhttps://bitbucket.org/badn3wz/reddit_clone/src/8adf342f8683fb7d1f15c073bfee1a13e5d24e21/views/default/list_posts_by_votes.html?at=default

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Querying Tables from Private Folder

2014-05-04 Thread Marin Pranjić
Tables are in there but if you don't call db.define_table(...) DAL will not
know about them.

How are you running the script in private?


You can do something like this:
python web2py.py -S appname -M -R applications/appname/private/scriptname.py

This will run your models before running the script, so scriptname.py will
have access to DAL and everything.
Of course, this expects table definitions in application's model files.

Marin


On Sat, May 3, 2014 at 2:03 PM, jaw...@gmail.com wrote:

 I'm trying to query my tables from the private folder:

 from gluon.tools import DAL

 db = DAL(sqlite://../databases/storage.sqlite)
 print db.tables

 However none of my tables can be seen.

 The idea is to have a better manner of extracting data rather than the
 old-school:

 with sqlite3.connect('../databases/storage.sqlite') as conn:
 c = conn.cursor()
 etc

 What am I missing?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Virtual Field not working anymore?

2014-05-04 Thread Marin Pranjić
In general, Virtual field will try to calculate it's value. It can fail
(for example, you didn't select all the fields that are needed to do the
calculation, or your calculation is buggy). If it fails, it won't be there.

Which database are you using?

I suspect that .count() returns None and thus it fails on +. But it is
backend-specific, I am not sure.

Marin


On Sun, May 4, 2014 at 6:02 AM, Leonardo Pires Felix 
leona...@piresfelix.com wrote:


 I've created a virtualfield on my table as this:
 db.define_table(alunos,
   SQLField(nome, string, length=255, label=Nome, notnull=True,
 requires=IS_UPPER())
   SQLField(data_nascimento, date, label=Data de
 nascimento,represent=campoDataNascimento, notnull=True),
   SQLField.Virtual('mediaFreq',lambda linha:
 db(db.entrada_cartao_alunos.id_aluno == 
 linha.aluno.id).count()+db(db.faltas_alunos.id_aluno
 == linha.aluno.id).count())
   )
   singular=Aluno,
   plural=Alunos,
   format=%(nome)s)

 And on the smartgrid the virtual field doesn't show.

 I've tried from command line, but:
 Traceback (most recent call last):
   File console, line 1, in module
   File /home/leonardo/domains/homo.com/arquivos/web2py/gluon/dal.py,
 line 7343, in __getitem__
 raise ae
 AttributeError: 'Row' object has no attribute 'mediaFreq'

 But on dir(db.alunos) the virtualfield is there, on db.alunos.fields isn't.
 So, the virtualfield isn't working anymore?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Howto deploy web2py on a shared host?

2014-05-04 Thread Marin Pranjić
Hi,


It's really hard to tell. You should ask them. How do they setup python
websites?
You have to upload web2py but the issue is how to configure web server.

You only need to configure to your virtual host file but I'm not sure if
they allow that.
Just email them and ask :)

If they support python 2.6 or 2.7 and have mod_wsgi you are able to run
web2py.

Marin


On Sat, May 3, 2014 at 1:28 AM, jansende janusendi...@gmail.com wrote:

 Hi guys,
 I am searching for a web-framework for my website, and are currently
 trying several option.
 I would be interested in using web2py, but I do not have any idea how to
 install it.

 The manual is for servers with ssh access. However I do not have this
 option with my provider.
 The host has apache, python, mod_wsgi, ... already installed. So all what
 should be missing is some configuration and the data.

 What do I have to upload? And what are the important configurations
 missing?

 Greetings
 jansende

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] strange problem with DAL

2014-05-04 Thread Marin Pranjić
Hi.

I have application hosted on EC2. It is a testing server. It's like 
production environment except it uses SQLite.

I have a table called message_receiver. When I fetch records (for ex. in 
appadmin) it works, but when I try to insert something (appadmin or in-app) 
i get the following error:

OperationalError: no such table: main.message

I got the actual SQL query from the error ticket:

INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES (NULL,93,1);

That seems correct.

However, I noticed that my sql.log is bigger than sqlite database file. It has 
lots of success! messages inside.
And it seems that migration for some tables is triggered on every request but 
nothing changes in .table files.
There are 6 tables that are affected by migration but I don't see a pattern.

Can someone suggest how to trace/debug 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] strange problem with DAL

2014-05-04 Thread Marin Pranjić
To confirm...
https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262

This gets executed on every request.

However I still don't understand why sqlite fails on insert.

It fails on testing server but it works on my local instance.

Marin


On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić marin.pran...@gmail.comwrote:

 Hi.

 I have application hosted on EC2. It is a testing server. It's like
 production environment except it uses SQLite.

 I have a table called message_receiver. When I fetch records (for ex. in
 appadmin) it works, but when I try to insert something (appadmin or in-app)
 i get the following error:

 OperationalError: no such table: main.message

 I got the actual SQL query from the error ticket:

 INSERT INTO message_receiver(time_seen,user_id,message_id) VALUES (NULL,93,1);

 That seems correct.

 However, I noticed that my sql.log is bigger than sqlite database file. It 
 has lots of success! messages inside.
 And it seems that migration for some tables is triggered on every request but 
 nothing changes in .table files.

 There are 6 tables that are affected by migration but I don't see a pattern.

 Can someone suggest how to trace/debug 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] parallel shell cause portal block

2014-04-24 Thread Marin Pranjić
It might be that database is blocking because you never end a transaction.
Do you have db.commit() in your task?

Marin


On Thu, Apr 24, 2014 at 8:58 PM, Manuele Pesenti
manuele.pese...@gmail.comwrote:

 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Admin is disabled because insecure channel error Hosting web2py app on Amazon EC2 Linux server

2014-04-21 Thread Marin Pranjić
http is insecure. you need to use https to access admin app.

Marin (mobile)
On Apr 21, 2014 5:02 AM, Pawan Gupta pawangupt...@gmail.com wrote:

 Hi Everyone

 We are having serious problem with our website 911india.com. We have
 hosted it on Amazon EC2 server and there is a ticket that is issued which
 redirects us to the admin interface that shows Admin is disabled because
 insecure channel

 I tried searching on the website but nothing seems to make sense probably
 because we are somewhat beginners.

 Can someone please help us with what could be done to resolve this.


 Cheers

 Pawan

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Login ajax component

2014-04-21 Thread Marin Pranjić
This sounds like a bug.

Marin (mobile)
On Apr 18, 2014 9:10 PM, Louis Amon moo...@msn.com wrote:

 I'm trying to build an Ajax-based login form using web2py's LOAD() helper.

 I made a controller named 'users.py', in which I defined a 'signin()'
 function :

 def signin():
 form=auth.login()
 if form.process(formname=None).accepted: #hideerrors=True
 response.flash = 'form accepted'
 print form.vars
 elif form.errors:
 print form.errors
 return dict(login_form=form)


  The corresponding view ('users/signin.load') is as follows:

 h2 class=form-login-sign-up_titleS'identifier/h2
 p class=form-login-sign-up_subtitleJ'ai déjà un compte/p
 {{ =login_form.custom.begin }}
 {{ =login_form.custom.widget.email }}
 {{ =login_form.custom.widget.password }}
 {{ =login_form.custom.end }}


 Now if I go to the url : [...]/users/signin.load, my form displays
 correctly but validation doesn't occur upon submitting the form. It's as
 though the displayed form isn't linked to the one defined in the controller.


 After some research, I found that if I change my view to

 {{=login_form}}


 Then validation occurs correctly. My form isn't customized correctly
 though (obviously).

 Further research indicates that, using the first view, the rendered html
 code actually contains two signatures for the FORM (just before the /form
 tag):

 div style=display:none;
 input name=_next type=hidden value=/
 input name=_formkey type=hidden
 value=c33c0072-ac25-461f-8e37-0ba48cc53dc2
 /div


 And:

 div style=display:none;
 input name=_next type=hidden value=/
 input name=_formkey type=hidden
 value=553bae82-7864-4620-93ee-d54eeea366bf
 input name=_formname type=hidden value=login
 /div



 My guess is that, having two different signatures, web2py gets confused
 about how to manage this form.
 I tried several things like putting formname=None in the process()
 function, but the only way I got my ajax component to work so far is by not
 customizing my form.

 Any workaround ?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] autodelete(?) on computed field

2014-04-15 Thread Marin Pranjić
Ok, I'll just code it by myself. I was hoping there is better solution.

Marin


On Mon, Apr 14, 2014 at 11:49 AM, Marin Pranjić marin.pran...@gmail.comwrote:

 db.define_table(...,
   Field('image', 'upload', autodelete=True),
   Field('thumbnail', 'upload', autodelete=True, compute=create_thumbnail),
  ...)

 This is not working because on _before_update/_before_delete callbacks
 thumbnail is not one of the upload_fields.
 I am talking about delete_uploaded_files defined inside gluon/dal.py.

 Is there an easier way or I have to manually do the code?

 Marin

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] autodelete(?) on computed field

2014-04-14 Thread Marin Pranjić
db.define_table(...,
  Field('image', 'upload', autodelete=True),
  Field('thumbnail', 'upload', autodelete=True, compute=create_thumbnail),
 ...)

This is not working because on _before_update/_before_delete callbacks 
thumbnail is not one of the upload_fields.
I am talking about delete_uploaded_files defined inside gluon/dal.py.

Is there an easier way or I have to manually do the code?

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Password feild type seems to save in plain text for me.

2014-03-26 Thread Marin Pranjić
This is how auth_user.password is defined internally:

https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1753

is_crypted = CRYPT(key=settings.hmac_key, min_length=settings.
password_min_length)
Field(passfield, 'password', length=512,readable=False, label=self.messages.
label_password,
requires=[is_crypted]),




so, yeah, you need to add CRYPT validator by yourself.

Marin


On Wed, Mar 26, 2014 at 1:14 PM, Encompass solutions encomp...@gmail.comwrote:

 How do I do this?
 And is this how it is don't in db.auth_user?  Cause it's rather confusing
 that it doesn't do this automatically.
 BR,
 Jason Brower


 On Sunday, March 23, 2014 2:24:24 PM UTC+2, Anthony wrote:

 By default, I think password fields only get an IS_LENGTH validator, so
 you'll have to set the CRYPT validator explicitly.

 Anthony

 On Tuesday, March 18, 2014 1:04:54 PM UTC-4, Encompass solutions wrote:

 I am trying to create a model with an encrypted key so it's harder for
 someone to maliciously screw over my customers.
 I have the following snippet.
 Field('public_gram', 'boolean', default=False),
 Field('tag_name', 'list:string'),
 Field('deletion_key', 'password')
 )
 You can see there the deletion_key is a feild type password which I
 understand is hashed out so you can't get the original code.  However, when
 I try to print it I get this...
 test
 CRYPT()(gram_details.deletion_key)
 (gluon.validators.LazyCrypt object at 0x7f56b8305c10, None)
 CRYPT()(gram_details.deletion_key) == gram_details.deletion_key
 False
 Where test is print gram_details.deletion_key
 If this is the case then my password is not very cryptic.
 Am I doing something wrong?
 BR,
 Jason Brower

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] please help testing windows and mac binary

2014-03-20 Thread Marin Pranjić
windows 8.1


C:\Users\Marin\Desktop\web2pyweb2py.exe
Traceback (most recent call last):
  File string, line 6, in module
  File __main__.py, line 128, in module
  File __main__web2py__.py, line 18, in module
  File /home/mdipierro/make_web2py/web2py/gluon/__init__.py, line 15, in
modu
le
  File /home/mdipierro/make_web2py/web2py/gluon/globals.py, line 21, in
modul
e
  File /home/mdipierro/make_web2py/web2py/gluon/html.py, line 27, in
module
  File HTMLParser.py, line 47, in module
  File re.py, line 190, in compile
  File re.py, line 242, in _compile
sre_constants.error: nothing to repeat


On Thu, Mar 20, 2014 at 5:16 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 problems have been reported with the windows and mac binaries for 2.9.x.

 Can you please help?

 Download the nightly builds:
 http://web2py.com/examples/static/nightly/web2py_win.zip
 http://web2py.com/examples/static/nightly/web2py_osx.zip

 and let us know if they work/do-not-work for you. Which OS version?

 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Password feild type seems to save in plain text for me.

2014-03-18 Thread Marin Pranjić
How did you insert test into database?

If you use db.tablename.insert(..., deletion_key='test') it will store it
plain text because you are bypassing validators.


You should:

1. use .validate_and_insert(...) instead
or
2. use .insert(deletion_key=db.tablename.deletion_key.validate('test'))

If you use SQLFORM(db.tablename...) it will automatically validate (=hash
the password)


Marin


On Tue, Mar 18, 2014 at 6:04 PM, Encompass solutions encomp...@gmail.comwrote:

 I am trying to create a model with an encrypted key so it's harder for
 someone to maliciously screw over my customers.
 I have the following snippet.
 Field('public_gram', 'boolean', default=False),
 Field('tag_name', 'list:string'),
 Field('deletion_key', 'password')
 )
 You can see there the deletion_key is a feild type password which I
 understand is hashed out so you can't get the original code.  However, when
 I try to print it I get this...
 test
 CRYPT()(gram_details.deletion_key)
 (gluon.validators.LazyCrypt object at 0x7f56b8305c10, None)
 CRYPT()(gram_details.deletion_key) == gram_details.deletion_key
 False
 Where test is print gram_details.deletion_key
 If this is the case then my password is not very cryptic.
 Am I doing something wrong?
 BR,
 Jason Brower

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to use multiple SQLALL objects in groupby

2014-03-04 Thread Marin Pranjić
I guess I never did it before, which is weird because it looks like usual 
requirement.

I have a DB query where I need to get a join of two tables and aggregate 
from third table.
That means I need to set two tables in groupby.

To describe what *doesn't *work but you'll get the idea what I want:

count = db.table3.id.count()
left = db.table3.on(something)
rows = db(some_query).select(count, db.table1.ALL, db.table2.ALL, left=left, 
*groupby=[db.table1.ALL, 
db.table2.ALL]*)

So the groupby thing is not working and I don't see an easy way to do it. I 
could extract fields from SQLALL object but that's not a way to go. It 
should be easier :)

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: session security issue?

2014-03-03 Thread Marin Pranjić
Isn't this why session.renew() was added?


On Mon, Mar 3, 2014 at 2:29 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I will check and release a patch soon. Please do not discuss possible
 security issues on this mailing list. Report them to the developers
 directly.


 On Monday, 3 March 2014 02:06:05 UTC-6, Kiran Subbaraman wrote:

 I see this in 2.9.2 too (Just tested with the latest release)

 On Monday, March 3, 2014 1:25:14 PM UTC+5:30, Kiran Subbaraman wrote:

 Hello,
 I noticed this issue recently related to user session data.
 In my application I store some user specific session data, so that I do
 not have to hit the database everytime (now, am also looking at using
 the cache for that, instead of session).
 If userA is logged into the application, and then userA auth session
 expires, a login screen is presented. In case login is performed with
 userB's credentials, the session data from userA is still available, and
 is displayed on userB's screen.

 I have created a minimal app to demonstrate the issue that I see. Also
 take a look at the screenshots. Notice the session.userdata variable's
 value.
 Tested this on web2py 2.8.2, on Windows 8.

 This is my controller code:
 @auth.requires_login()
 def index():
 ...

  if session['userdata'] is None:
  session.userdata = auth.user.first_name

 I am suspecting this is an issue / bug. Can anyone confirm?
 This issue does not arise, if the user explicitly logs out of a session,
 or the browser window is closed (I have set my browser to clear all
 cookies data when it is closed)

 --

 
 Kiran Subbaraman
 http://subbaraman.wordpress.com/about/

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: email on logging in is case sensitive. Is this a good idea?

2014-02-24 Thread Marin Pranjić
It is sensitive by default, and by design:
http://email.about.com/od/emailbehindthescenes/f/email_case_sens.htm

:(


but not by implementation, i don't think anyone is using case sensitive
emails.
I'd like to see the above line in welcome app, as I have it in all my apps.

Marin


On Mon, Feb 24, 2014 at 12:40 PM, peter peterchutchin...@gmail.com wrote:

 Okay I see that this is already attended to by the following setting

 auth.settings.email_case_sensitive = False


 So I guess my comment would be - Wouldn't it be better if the default
 setting is False rather than True.

 Peter

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] how login_onaccept works ?

2014-02-20 Thread Marin Pranjić
you are calling the function and assigning the return value

use = lambda: check_production(1)
or just = check_production, without (1)

Marin (mobile)
On Feb 21, 2014 12:56 AM, brushek luk...@chrustek.net wrote:

 Hello web2py users and devs,

 I have simple question: does auth.settings.login_onaccept should fire only
 once after login, or it is normal that it is running in every click after
 login ?

 I have folowing code in default.py:

 def check_production(towar=1):
 if not session.auth:
 return
 user_id = str(session.auth.user.id)
 import datetime

 db.produkcja.update_or_insert((db.produkcja.id_field == 2)  (db.
 produkcja.id_user == user_id),end_time = datetime.datetime.now(),id_towaru
 = towar)

 auth.settings.login_onaccept = check_production(1)

 As I can see, the end_time field is updated in database every time I click
 on site (after login). It is correct behavior ? I would to fire this
 function only once, after user login.


 Regards
 brushek

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Virtual Fields not working on print.

2014-02-19 Thread Marin Pranjić
most likely get_country is failing for some reason

Marin


On Wed, Feb 19, 2014 at 9:40 AM, Jason Brower encomp...@gmail.com wrote:

 I have this in the model...
 import uuid
 import os
 import pygeoip
 gi = pygeoip.GeoIP(os.path.join(request.folder, 'private', 'GeoIP.dat'))
 def get_country(row):
 return gi.country_code_by_addr(row.from_where)
 # -*- coding: utf-8 -*-
 db.define_table('melodigram_play',
 Field('melodigram_id', 'reference melodigram'),
 Field('when_opened', 'datetime', default = request.now),
 Field('from_where', 'string', default = request.client),
 Field.Virtual('from_country', lambda row: get_country(row))
 )
 db.melodigram_play.melodigram_id.requires = IS_NOT_EMPTY()
 db.melodigram_play.when_opened.requires = IS_NOT_EMPTY()

 I can insert data... but when I try to retrieve it, it tells me the row
 doesn't exist:
 h2From: {{=gram_details.from_where}} :
 {{=gram_details.from_country}}/h2
 
 gram_details.from_where has always worked.
 gram_details.from_country doesn't work.


 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Absolute URL issue in PythonAnywhere when using scheduled script

2014-02-15 Thread Marin Pranjić
As explained here:

http://www.web2py.com/books/default/chapter/29/04/the-core#Absolute-urls


You should use:

URL(..., scheme='http', host='www.mysite.com')


Marin


On Sat, Feb 15, 2014 at 4:49 PM, Ykä Marjanen yka.marja...@gmail.comwrote:

 I got the scheduled background script working in PA. The script is started
 in web2py environment with -S app and -M -R parameters. The script
 generates emails, which include links (e.g. registration link with UUID).

 I use scheme=True and host=True to generate absolute URL. This works when
 I generate the emails directly from a website request. But when the
 scheduled script generates it in the background, the URL has local host
 (127.0.0.1) and not the real domain.

 I assume that because I generate the link in a background script, web2py
 instance lives in the local host and doesn't see the outside world (like
 when a website request happens).

 Should I just generate the domain manually, or do I have any better way to
 replace the localhost with the real domain?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Single form for many to many relationship

2014-02-14 Thread Oleg Marin
Hi!

I'm looking for solution for nice single SQLFORM for many to many 
relationship. For example I have such model:

db.define_table('person', Field('name'), Field('position'), Field('office', 
'integer'))
db.define_table('thing', Field('name'), Field('color'))
db.define_table('person_thing', Field('person_id', 'reference person'), 
Field('thing_id', 'reference thing'))

And I want to creeate SQLFORM.grid for table person, with insert/update 
form containing list of checkboxes for things, and ability to add new thing 
from that form, like this:

Name:  [Alex]
Poszition: [CEO]
Office:  [13]
Things:
   Thing1   [v]
   Thing2   [  ]
   Thing3   [v]
   (Add new thing button)

Is it possible?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: [CLOSED] XMLHttpRequest cannot load https://www..... disallowed for cross-origin request ...

2014-02-14 Thread Marin Pranjić
https://groups.google.com/forum/#!topic/web2py/0vqUFdr0cjg


On Tue, Feb 11, 2014 at 7:52 AM, Umed zarrh...@gmail.com wrote:

 why didnt you specify what was a solution


 On Wednesday, December 18, 2013 4:05:43 PM UTC+5, weheh wrote:

 Looks like I got it working. The Apache config file wasn't complete, so
 once I found that issue, the CORS started to function properly. Thanks
 again for your responses.


 On Monday, December 16, 2013 11:16:05 PM UTC+8, Marin Pranjić wrote:

 Well, as I said, try your own jquery.ajax call.

 If it works, then CORS is enabled but component load is failing.
 If it doesn't work, then you didn't enable CORS correctly.

 You should also try $.ajax({crossDomain: true, ...});
 JQuery should add it automatically but maybe it's not detecting it
 properly.


 On Mon, Dec 16, 2013 at 4:12 PM, weheh richard...@verizon.net wrote:

 @Marin: Thanks for your suggestion. I believe that that is precisely
 what is causing this issue. The original call is an HTTP call. It's
 followed by an HTTPS that results in the error message. But still no idea
 how to get the https call to go through.


 On Monday, December 16, 2013 10:45:45 PM UTC+8, Marin Pranjić wrote:

 @weheh can you try a custom jQuery.ajax cross domain call for
 testing/debugging? (just load something from HTTP to HTTPS)

 On Mon, Dec 16, 2013 at 2:38 PM, weheh richard...@verizon.net wrote:

 Hi Anthony, I added CORS stuff to my Apache httpd.conf as per this
 http://enable-cors.org/server_apache.html but I'm still getting the
 same error message. Any ideas about how to push through this?


 On Sunday, December 15, 2013 1:13:55 AM UTC+8, Anthony wrote:

 Is it in fact a cross-origin request, and have you set up CORS on
 the server?

 On Saturday, December 14, 2013 10:39:25 AM UTC-5, weheh wrote:

 I've got a dialog that I pop open and on it is a button that makes
 a web2py_component call. The button code looks like this, after it's 
 gone
 through the XML() helper and jquery UI.

 button class=... onclick=if (confirm('Read?')) {
 web2py_component(quot;https://www.mysite.com/mycontroller/m
 yfunc.load?pc=YGYzlEh6amp;_signature=607e035a239d88bd3ab865
 2814ceff2a9cab92b5quothttps://www.mysite.com/mycontroller/myfunc.load?pc=YGYzlEh6_signature=607e035a239d88bd3ab8652814ceff2a9cab92b5quot;,
 quot;target-divquot;); } role=button aria-disabled=false ...
 /button

 The button works fine when I launch it from my development machine:
 http://127.0.0.1:8000/myapp/...  But, when I migrate the code to
 the server and execute there, I get an error.

 Firebug reports the following:

 XMLHttpRequest cannot load https://www.mysite.com/mycontr
 oller/myfunc.load?pc=YGYzlEh6_signature=https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e
 607e035a239d88bd3ab8652814ceff2a9cab92b5. The request was
 redirected to 'https://www.mysite.com/user/login.load?_next=/
 mycontroller/myfunc.load%https://www.yakitome.com/user/login.load?_next=/store/execute.load%3Fpc%3DHcfnI_pV%26pid%3D7%26qty%3D1
 pc=YGYzlEh6https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e',
 which is disallowed for cross-origin requests that require preflight.


 Anybody have any idea how to deal with 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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+un...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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

Re: [web2py] Re: Javascript runs locally but not when deployed

2014-02-14 Thread Marin Pranjić
Do you use http or https? What if you try another one?

Marin


On Fri, Feb 14, 2014 at 4:31 PM, Leonel Câmara leonelcam...@gmail.comwrote:

 There are no errors at all on the browser javascript console?

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Third-party image grabs being redirected...

2014-02-13 Thread Marin Pranjić
Maybe redirection based on request.env.http_referer ?
Not sure if I understood (not a twitter user) but if you give a link to an
actual tweet it may help :)

Marin

On Thu, Feb 13, 2014 at 2:27 PM, Jason Brower encomp...@gmail.com wrote:

 Is there a way to redirect those that try to download an image directly
 to a new location?
 The reason is this...
 If I for example share this:
 https://melodigram.com/gram/20a40890-949c-11e3-97c0-1231390a0101
 on twitter.  I need to give it an image as well to show the product.
 But the image is clickable and goes to just the image and not the cool
 looking view I am working on that has sound added.
 Is there a way to catch the situation when the image is pulled alone and
 then redirect them to the correct location based on that image or url?
 BR,
 Jason Brower

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Latest thinking -- Bootstrap vs. Foundation?

2014-02-11 Thread Marin Pranjić
At the moment I like Foundation more then any other.
Semantic UI also looks great (and promising).
Bootstrap is still awesome, of course.

Marin


On Tue, Feb 11, 2014 at 3:39 PM, Michele Comitini 
michele.comit...@gmail.com wrote:

 I agree with the article.
 Nothing prevents using Foundation or any other framework on web2py,
 consider bootstrap as a commodity to get your ideas started fast.
 Bootstrap is ubiquitous among developers, because requires less effort,
 IMHO it is the right choice for a welcome app at the moment.
 To get an idea of Foundation in action see Mozilla's sites: they look very
 slick.  Foundation gives top of the notch UX
 designers the power and freedom they need at the expense of readiness to
 use, giving great results in the long run.



 2014-02-11 15:13 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:

 https://medium.com/frontend-and-beyond/8b3812c7007c


 On Monday, 10 February 2014 23:44:46 UTC-6, weheh wrote:

 I'm trying to catch up with the times and migrate to Bootstrap. The
 latest web2py doc says Bootstrap. But a colleague said to me,
 Foundation. Checking the web2py group shows some users on Foundation.

 Would a few experienced users mind chiming in about which they prefer
 with web2py, Bootstrap or Foundation? Any gotchas either way? Both look
 like they'll do the job. Thanks.

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: binary(1024) field truncates to 255

2014-02-08 Thread Oleg Marin
I'm sorry for long silence, I was busy. I solved my problem. At first, I 
didn't specified TDS version in connection string. Then I found that 
connection string at least for mssql not fully URI-compliant, multiple 
parameters after question sign separating by ;  instead of . I think 
it needs to be added to documentation.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Why does redirect() always append '#'?

2014-02-03 Thread Marin Pranjić
We can only guess without seeing the code.

My guess is:

1. redirect doesn't append #, something else does it client side
2. # doesn't break script execution, something else does (probably same
issue that appends #)

Can you check your console for javascript error logs?

Marin


On Mon, Feb 3, 2014 at 3:59 PM, horridohobbyist
horrido.hobb...@gmail.comwrote:

 I have the following added to the end of a view:

 script
 $(function(){

 $(#includedContent).load(/MyApp/static/desc/P+id+_desc.html);
 });
 /script
 div id='includedContent'/div

 This works fine. However, if this page is arrived from a redirect(), the
 URL has a fragment identifier '#' appended. For some reason, this causes
 the script *not* to execute and so I don't get the included content.

 Two questions:

1. Why is the fragment identifier blocking the script?
2. Why is it necessary for redirect() to always append a fragment
identifier? If the fragment identifier is sometimes needed, why can't it be
optional?


 Thanks.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: binary(1024) field truncates to 255

2014-01-30 Thread Oleg Marin

Web2py example from web-based shell
In [2] : len(seus_db.executesql(exec armSpins ?, ?;, (88,bytearray(b
\x89\xa0H\'\x87\x13GF\xb5\xd6z\xe97\x15i\t)))[0].EVT_CONTENT)
*255*

Pyodbc example from interactive python shell
 cur.execute(exec armSpins ?, ?;, 88, bytearray(b
\x89\xa0H\'\x87\x13GF\xb5\xd6z\xe97\x15i\t) )
pyodbc.Cursor object at 0xb6c57e90
 len(cur.fetchone().EVT_CONTENT)
1024




четверг, 30 января 2014 г., 0:06:10 UTC+4 пользователь Niphlod написал:

 post the code please.
 executesql('abc') just does 

 cursor.execute('abc')
 cursor.fetchall()



 On Wednesday, January 29, 2014 12:55:51 PM UTC+1, Oleg Marin wrote:

 Hi!

 I'm using MSSQL2008 in readonly without tables definition, and when I run 
 stored procedure with executesql, it returns field of type binary(1024) 
 truncated to size of 255. Running same procedure directly with pyodbc works 
 well.  Is it a bug, or something I have missed?



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] binary(1024) field truncates to 255

2014-01-29 Thread Oleg Marin
Hi!

I'm using MSSQL2008 in readonly without tables definition, and when I run 
stored procedure with executesql, it returns field of type binary(1024) 
truncated to size of 255. Running same procedure directly with pyodbc works 
well.  Is it a bug, or something I have missed?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] MSSQL binary(1024) field truncated to length of 255

2014-01-29 Thread Oleg Marin
Hi!

I'm using MSSQL 2008, and when I run stored procedure with executesql, 
among other it returns field of type binary(1024) truncated to length of  
255.
Pyodbc directly works well. Is it a bug? Or maybe I have missed something?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] web2py.js disables submit buttons when submitting form with ajax

2014-01-28 Thread Oleg Marin
Hi!

I'm trying to submit form with $.post(), by attaching function handling 
event submit. And when it send ajax request to server some handler from 
web2py.js disables submit button, and changes it's value to Working 
Alright, it is good behavior. But it doesn't re-enable it after ajax 
comletes. What I do wrong, or what need I do to enable form submission 
again?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Form input prolem

2014-01-23 Thread Marin Pranjić
INPUT(_name='password', _type='password')

because INPUT(_password='password') is a nonsense.


On Wed, Jan 22, 2014 at 8:14 PM, Lucas Schreiber 
lucas.schreiber.pri...@gmail.com wrote:

 Hi, i thought the form worked good, but unfortunally i was wrong.
 name = form.vars.name contains the data from 'Name', INPUT(_name='name'),
 but
 passwords = form.vars.password is always none

 here again the code, with the improvements:

 def login():
 form = FORM(
 'Name', INPUT(_name='name'),
 'password', INPUT(_password='password'),
 INPUT(_type='submit'))
 if form.process().accepted:
 name = form.vars.
 name
 passwdb = dba(dba.user.name== name).select(dba.user.password).
 first()
 passwords = form.vars.password
 dba.user.insert(name = 'justtest', password= form.vars.name, email
 = form.vars.password, country= form.vars.name)
 if passwdb == passwords:
redirect(URL('index'))
 else:
redirect(URL('register'))

 return dict(form=form)


 Am Sonntag, 19. Januar 2014 19:28:23 UTC+1 schrieb Lucas Schreiber:

 Hi guys,


 i have this function:

 def login():
 form = FORM(
 'Name', INPUT(_name='name'),
 'password', INPUT(_password='password'),
 INPUT(_type='submit'))
 if form.process().accepted:
 name = form.vars.name
 records = SQLTABLE(dba(dba.user.name== name).select(dba.user.
 password),headers='fieldname:capitalize')
 passworddb = records[1]
 password = form.vars.password
 dba.person.insert(name = 'test', email=password)
 if passworddb == password:
redirect(URL('register'))
 else:
redirect(URL('index'))

 return dict(form=form)


 As you can see, you enter name and password into a form, and from a db it
 choose a password correspondending to the username. that part works fine.
 but the problem is on the part:

 password = form.vars.password

 i think this doesnt work, since the line below


 dba.person.insert(name = 'test', email=password)

 inserts into another db test, none

 Do anyone has an idea how to fix this problem? Or can anyone tell me what
 i did wrong?

 Thanks for the help,
 Darren

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] auth.is_logged_in and @auth.requires_signature() under investigation

2013-12-21 Thread Marin Pranjić
Hello,

I tried to trace down the problem.

If you sign an url on different scheme (http - https) everything works
when opened manually in browser.
But when opening it async, for example using $.ajax, current.session is
empty.
This causes URL.Verify to return False because there is no session.auth
record stored.

CORS requests assign new session ID every time. Why? Because cookies are
not sent.
The jQuery 'fix' is described here:
http://stackoverflow.com/questions/8863571/cors-request-why-are-the-cookies-not-sent

Solution includes adding xhrFields: {withCredentials: true}.

Should this be treated as a bug in JS-part of components load?


Marin


On Sat, Dec 21, 2013 at 3:44 PM, weheh richard_gor...@verizon.net wrote:

 I am dead in the water trying to make an https ajax call from an http
 session. CORS is enabled on server but the web2py_component https URL with
 user_signature=True now triggers an erroneous non-logged-in response to
 auth.is_logged_in() when, in fact, the user is logged in.

 First, thanks to Marin Pranjić's help, I am able to articulate the above
 statement. A little while ago I couldn't have done so.

 The trouble with auth.is_logged_in() is mirrored by an error raised by
 @auth.requires_signature(). In response to an experiment designed by Marin,
 I documented the following:

 If I put the @auth.requires_signature() decorator back into the
 controller and reexecute, I get the Firebug error message:
 XMLHttpRequest cannot load https://www.blah 
 blahhttps://www.yakitome.com/store/checkout.load?pid=1_signature=e5308784ae38c2f5f1a67552b4143bf7b9adeca1.
 The request was redirected to 
 'https://www.mydomain.com/user/login.load?_next=/blah
 blahhttps://www.yakitome.com/user/login.load?_next=/store/checkout.load%3Fpid%3D1',
 which is disallowed for cross-origin requests that require preflight.


 Marin replied,

 As I expected, auth.requires_signature looks broken. Give me some time, I
 am very busy, but I'll try to give you solution.
 Maybe URL.verify instead of decorator.


 Now, I have that auth.is_logged_in() in a critical spot and
 @auth.requires_signature() decorators on many functions that are now
 negatively impacted by this issue. So my sense of urgency is higher than my
 normal constant sense of urgency. I've been stuck on this for many days so
 I think I'm ready to ask for as much help as possible. Please.

 Thank you Marin and the web2py community for all the excellent support.
 Any suggestions about how to proceed, including from Marin, are appreciated.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] auth.is_logged_in and @auth.requires_signature() under investigation

2013-12-21 Thread Marin Pranjić
@weheh, the quick fix would be using custom ajax function instead of using
web2py_component.
It's meant to be used with server-side LOAD helper. Since you can't create
CORS component using LOAD, I'm not sure if web2py_component should work
with CORS either.

So, instead of calling web2py_component, you should write your own
javascript function that, using $.ajax, sends CORS requests and handles it.

Marin


On Sat, Dec 21, 2013 at 4:19 PM, Marin Pranjić marin.pran...@gmail.comwrote:

 Hello,

 I tried to trace down the problem.

 If you sign an url on different scheme (http - https) everything works
 when opened manually in browser.
 But when opening it async, for example using $.ajax, current.session is
 empty.
 This causes URL.Verify to return False because there is no session.auth
 record stored.

 CORS requests assign new session ID every time. Why? Because cookies are
 not sent.
 The jQuery 'fix' is described here:
 http://stackoverflow.com/questions/8863571/cors-request-why-are-the-cookies-not-sent

 Solution includes adding xhrFields: {withCredentials: true}.

 Should this be treated as a bug in JS-part of components load?


 Marin


 On Sat, Dec 21, 2013 at 3:44 PM, weheh richard_gor...@verizon.net wrote:

 I am dead in the water trying to make an https ajax call from an http
 session. CORS is enabled on server but the web2py_component https URL with
 user_signature=True now triggers an erroneous non-logged-in response to
 auth.is_logged_in() when, in fact, the user is logged in.

 First, thanks to Marin Pranjić's help, I am able to articulate the above
 statement. A little while ago I couldn't have done so.

 The trouble with auth.is_logged_in() is mirrored by an error raised by
 @auth.requires_signature(). In response to an experiment designed by Marin,
 I documented the following:

 If I put the @auth.requires_signature() decorator back into the
 controller and reexecute, I get the Firebug error message:
 XMLHttpRequest cannot load https://www.blah 
 blahhttps://www.yakitome.com/store/checkout.load?pid=1_signature=e5308784ae38c2f5f1a67552b4143bf7b9adeca1.
 The request was redirected to 
 'https://www.mydomain.com/user/login.load?_next=/blah
 blahhttps://www.yakitome.com/user/login.load?_next=/store/checkout.load%3Fpid%3D1',
 which is disallowed for cross-origin requests that require preflight.


 Marin replied,

 As I expected, auth.requires_signature looks broken. Give me some time,
 I am very busy, but I'll try to give you solution.
 Maybe URL.verify instead of decorator.


 Now, I have that auth.is_logged_in() in a critical spot and
 @auth.requires_signature() decorators on many functions that are now
 negatively impacted by this issue. So my sense of urgency is higher than my
 normal constant sense of urgency. I've been stuck on this for many days so
 I think I'm ready to ask for as much help as possible. Please.

 Thank you Marin and the web2py community for all the excellent support.
 Any suggestions about how to proceed, including from Marin, are appreciated.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: XMLHttpRequest cannot load https://www..... disallowed for cross-origin request ...

2013-12-16 Thread Marin Pranjić
@weheh can you try a custom jQuery.ajax cross domain call for
testing/debugging? (just load something from HTTP to HTTPS)

On Mon, Dec 16, 2013 at 2:38 PM, weheh richard_gor...@verizon.net wrote:

 Hi Anthony, I added CORS stuff to my Apache httpd.conf as per this
 http://enable-cors.org/server_apache.html but I'm still getting the same
 error message. Any ideas about how to push through this?


 On Sunday, December 15, 2013 1:13:55 AM UTC+8, Anthony wrote:

 Is it in fact a cross-origin request, and have you set up CORS on the
 server?

 On Saturday, December 14, 2013 10:39:25 AM UTC-5, weheh wrote:

 I've got a dialog that I pop open and on it is a button that makes a
 web2py_component call. The button code looks like this, after it's gone
 through the XML() helper and jquery UI.

 button class=... onclick=if (confirm('Read?')) {
 web2py_component(quot;https://www.mysite.com/mycontroller/
 myfunc.load?pc=YGYzlEh6amp;_signature=607e035a239d88bd3ab8652814ceff
 2a9cab92b5quothttps://www.mysite.com/mycontroller/myfunc.load?pc=YGYzlEh6_signature=607e035a239d88bd3ab8652814ceff2a9cab92b5quot;,
 quot;target-divquot;); } role=button aria-disabled=false ...
 /button

 The button works fine when I launch it from my development machine:
 http://127.0.0.1:8000/myapp/...  But, when I migrate the code to the
 server and execute there, I get an error.

 Firebug reports the following:

 XMLHttpRequest cannot load https://www.mysite.com/
 mycontroller/myfunc.load?pc=YGYzlEh6_signature=https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e
 607e035a239d88bd3ab8652814ceff2a9cab92b5. The request was redirected to
 'https://www.mysite.com/user/login.load?_next=/mycontroller/myfunc.load%https://www.yakitome.com/user/login.load?_next=/store/execute.load%3Fpc%3DHcfnI_pV%26pid%3D7%26qty%3D1
 pc=YGYzlEh6https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e',
 which is disallowed for cross-origin requests that require preflight.


 Anybody have any idea how to deal with 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: XMLHttpRequest cannot load https://www..... disallowed for cross-origin request ...

2013-12-16 Thread Marin Pranjić
Well, as I said, try your own jquery.ajax call.

If it works, then CORS is enabled but component load is failing.
If it doesn't work, then you didn't enable CORS correctly.

You should also try $.ajax({crossDomain: true, ...});
JQuery should add it automatically but maybe it's not detecting it properly.


On Mon, Dec 16, 2013 at 4:12 PM, weheh richard_gor...@verizon.net wrote:

 @Marin: Thanks for your suggestion. I believe that that is precisely what
 is causing this issue. The original call is an HTTP call. It's followed by
 an HTTPS that results in the error message. But still no idea how to get
 the https call to go through.


 On Monday, December 16, 2013 10:45:45 PM UTC+8, Marin Pranjić wrote:

 @weheh can you try a custom jQuery.ajax cross domain call for
 testing/debugging? (just load something from HTTP to HTTPS)

 On Mon, Dec 16, 2013 at 2:38 PM, weheh richard...@verizon.net wrote:

 Hi Anthony, I added CORS stuff to my Apache httpd.conf as per this
 http://enable-cors.org/server_apache.html but I'm still getting the
 same error message. Any ideas about how to push through this?


 On Sunday, December 15, 2013 1:13:55 AM UTC+8, Anthony wrote:

 Is it in fact a cross-origin request, and have you set up CORS on the
 server?

 On Saturday, December 14, 2013 10:39:25 AM UTC-5, weheh wrote:

 I've got a dialog that I pop open and on it is a button that makes a
 web2py_component call. The button code looks like this, after it's gone
 through the XML() helper and jquery UI.

 button class=... onclick=if (confirm('Read?')) {
 web2py_component(quot;https://www.mysite.com/mycontroller/m
 yfunc.load?pc=YGYzlEh6amp;_signature=607e035a239d88bd3ab8652814ceff
 2a9cab92b5quothttps://www.mysite.com/mycontroller/myfunc.load?pc=YGYzlEh6_signature=607e035a239d88bd3ab8652814ceff2a9cab92b5quot;,
 quot;target-divquot;); } role=button aria-disabled=false ...
 /button

 The button works fine when I launch it from my development machine:
 http://127.0.0.1:8000/myapp/...  But, when I migrate the code to the
 server and execute there, I get an error.

 Firebug reports the following:

 XMLHttpRequest cannot load https://www.mysite.com/mycontr
 oller/myfunc.load?pc=YGYzlEh6_signature=https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e
 607e035a239d88bd3ab8652814ceff2a9cab92b5. The request was redirected
 to 'https://www.mysite.com/user/login.load?_next=/mycontroller/
 myfunc.load%https://www.yakitome.com/user/login.load?_next=/store/execute.load%3Fpc%3DHcfnI_pV%26pid%3D7%26qty%3D1
 pc=YGYzlEh6https://www.yakitome.com/store/execute.load?pc=HcfnI_pVpid=7qty=1_signature=6c18eb4d880e19d463d85df3f9b02c97b5c8430e',
 which is disallowed for cross-origin requests that require preflight.


 Anybody have any idea how to deal with 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Error with session when user tries to login

2013-12-14 Thread Marin Pranjić
I deleted all session files and asked the customer to delete cookies. He
even upgraded his browser but was still getting the error.



On Sat, Dec 14, 2013 at 12:33 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 have you deleted all sessions or are you using sessions created with a
 previous version?


 On Friday, 13 December 2013 13:40:18 UTC-6, Marin Pranjić wrote:

 This happens when customer tries to login. I have no idea why it happens
 and it works when I try it on localhost.


 web2py™ Version 2.8.2-stable+timestamp.2013.11.28.07.51.37 PythonPython
 2.7.3: /usr/bin/python (prefix: /usr)

 Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.

 9.
 10.
 11.
 12.
 13.

 Traceback (most recent call last):

   File /home/www-data/web2py/gluon/main.py, line 479, in wsgibase

 session._try_store_in_cookie_or_file(request, response)

   File /home/www-data/web2py/gluon/globals.py, line 1089, in 
 _try_store_in_cookie_or_file

 return self._try_store_in_file(request, response)

   File /home/www-data/web2py/gluon/globals.py, line 1096, in 
 _try_store_in_file

 or self._unchanged(response)):

   File /home/www-data/web2py/gluon/globals.py, line 1041, in _unchanged

 session_pickled = cPickle.dumps(self)

   File /usr/lib/python2.7/copy_reg.py, line 84, in _reduce_ex

 dict = getstate()
 TypeError: 'NoneType' object is not callable


 Any ideas? It's urgent so any suggestion is welcome.

 Marin

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Error with session when user tries to login

2013-12-13 Thread Marin Pranjić
This happens when customer tries to login. I have no idea why it happens 
and it works when I try it on localhost.


web2py™Version 2.8.2-stable+timestamp.2013.11.28.07.51.37PythonPython 2.7.3: 
/usr/bin/python (prefix: /usr)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.

Traceback (most recent call last):
  File /home/www-data/web2py/gluon/main.py, line 479, in wsgibase
session._try_store_in_cookie_or_file(request, response)
  File /home/www-data/web2py/gluon/globals.py, line 1089, in 
_try_store_in_cookie_or_file
return self._try_store_in_file(request, response)
  File /home/www-data/web2py/gluon/globals.py, line 1096, in 
_try_store_in_file
or self._unchanged(response)):
  File /home/www-data/web2py/gluon/globals.py, line 1041, in _unchanged
session_pickled = cPickle.dumps(self)
  File /usr/lib/python2.7/copy_reg.py, line 84, in _reduce_ex
dict = getstate()
TypeError: 'NoneType' object is not callable


Any ideas? It's urgent so any suggestion is welcome.

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Error with session when user tries to login

2013-12-13 Thread Marin Pranjić
Ok, let's continue discussion there.

Marin



On Fri, Dec 13, 2013 at 9:16 PM, Leonel Câmara leonelcam...@gmail.comwrote:

 Yes, Lucas and I are having the same problem.
 https://groups.google.com/forum/#!topic/web2py/CSuT_CknD20

 Restarting the webserver temporarily solves the problem for me. Saving
 sessions in db also seems to make the problem take longer to appear.

 For me, it's happening with apache in windows, I've never seen it happen
 with the included rocket server.

 Either way, it's definitely a bug introduced between 2.7 and 2.8, I just
 didn't have the time to look into it properly yet, hopefully one of the
 devs will have time to do it soon.

 What seems to be happening here is that somewhere along the way, an object
 that is not copyable is being saved in the session.

 A potential way to find the bug that I didn't have time to try yet, is to
 define Session __setitem__ and try to cPickle.dumps everything that is put
 there as that should crash instantly and find what's going wrong.


 Sexta-feira, 13 de Dezembro de 2013 19:40:18 UTC, Marin Pranjić escreveu:

 This happens when customer tries to login. I have no idea why it happens
 and it works when I try it on localhost.


 web2py™Version 2.8.2-stable+timestamp.2013.11.28.07.51.37 PythonPython
 2.7.3: /usr/bin/python (prefix: /usr)

 Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.


 9.
 10.
 11.
 12.
 13.

 Traceback (most recent call last):


   File /home/www-data/web2py/gluon/main.py, line 479, in wsgibase


 session._try_store_in_cookie_or_file(request, response)


   File /home/www-data/web2py/gluon/globals.py, line 1089, in 
 _try_store_in_cookie_or_file


 return self._try_store_in_file(request, response)


   File /home/www-data/web2py/gluon/globals.py, line 1096, in 
 _try_store_in_file


 or self._unchanged(response)):


   File /home/www-data/web2py/gluon/globals.py, line 1041, in _unchanged


 session_pickled = cPickle.dumps(self)


   File /usr/lib/python2.7/copy_reg.py, line 84, in _reduce_ex


 dict = getstate()
 TypeError: 'NoneType' object is not callable


 Any ideas? It's urgent so any suggestion is welcome.

 Marin

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: login crash under 2.8.2

2013-12-13 Thread Marin Pranjić
I just found this:

https://groups.google.com/forum/#!searchin/web2py/weird$20auth$20error/web2py/jkqyPM5_zaE/Ve5gy7greuoJ
This is version 2.4.5 so it is NOT something introduced in recent version.

I am also privileged to feel the pain that this issue causes in production.

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Scheduler - observation

2013-12-13 Thread Marin Pranjić
So I have a task queued at 00:02:07.
I have a worker for that group with last_heartbeat 00:07:55.
Task is still QUEUED.
Worker is ACTIVE.
I have TWO is_ticker workers (usually it's one).

Scheduler is up for days, it usually works.


Two days ago I was resetting databases so I dropped most of the tables, 
including scheduler tables.
They got recreated after one minute (when I deleted *.table files, I use 
migrations) so probably in the meantime scheduler tried to read/write table 
that doesn't exist.
I didn't restart scheduler after that. And now it's just hanging around 
minding its own business, not caring about my queued tasks.


Everything works after restart. I am aware that my actions might have 
caused weird scheduler behavior.
I wrote this email because it might help, nothing else. I would be less 
surprised if scheduler just stopped.
But I guess it tried to recover from all the issues as it usually does, but 
somehow failed even if it acts completely ok (has heartbeat, schedules 
tasks).

Scheduler still rocks.

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] session cookie for two subdomains

2013-12-06 Thread Marin Pranjić
up

Marin (mobile)
On Dec 6, 2013 12:12 AM, Marin Pranjić marin.pran...@gmail.com wrote:

 ^bump


 On Thu, Dec 5, 2013 at 8:22 PM, Marin Pranjić marin.pran...@gmail.comwrote:

 Hi,

 I have two subdomains for one app, and I need to use both.
 So I have to set Domain header in session cookie to the domain root (.
 domain.com).
 Where should I put that code? Not sure how exactly to do it for session
 cookie.

 Marin

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: session cookie for two subdomains

2013-12-06 Thread Marin Pranjić
For example, if I login on *www1.example.com*, I also want to be logged in 
*www2.example.com*.

The code that Leonel provided would work. However, I am not setting a 
custom cookie (thanks anyway).
I want to do it for session cookie.
And I'm only asking where should I put that code.

Would it be wrong if I put it in model, so it's executed on every request?

something like:

response.cookies['session_id_appname']['domain'] = '.example.com'

Is there a better place to put this code?

Dana petak, 6. prosinca 2013. 16:48:22 UTC+1, korisnik Massimo Di Pierro 
napisao je:

 I do not understand what you are trying to do.

 On Thursday, 5 December 2013 13:22:08 UTC-6, Marin Pranjić wrote:

 Hi,

 I have two subdomains for one app, and I need to use both.
 So I have to set Domain header in session cookie to the domain root (.
 domain.com).
 Where should I put that code? Not sure how exactly to do it for session 
 cookie.

 Marin



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: session cookie for two subdomains

2013-12-06 Thread Marin Pranjić
Yes, it works.

Marin


On Fri, Dec 6, 2013 at 6:37 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I think putting this in a model file should do it:

 response.cookies['session_id_appname']['domain'] = '.example.com'

 Have you tried it?


 On Friday, 6 December 2013 10:28:44 UTC-6, Marin Pranjić wrote:

 For example, if I login on *www1.example.com http://www1.example.com*,
 I also want to be logged in *www2.example.com http://www2.example.com*.

 The code that Leonel provided would work. However, I am not setting a
 custom cookie (thanks anyway).
 I want to do it for session cookie.
 And I'm only asking where should I put that code.

 Would it be wrong if I put it in model, so it's executed on every request?

 something like:

 response.cookies['session_id_appname']['domain'] = '.example.com'

 Is there a better place to put this code?

 Dana petak, 6. prosinca 2013. 16:48:22 UTC+1, korisnik Massimo Di Pierro
 napisao je:

 I do not understand what you are trying to do.

 On Thursday, 5 December 2013 13:22:08 UTC-6, Marin Pranjić wrote:

 Hi,

 I have two subdomains for one app, and I need to use both.
 So I have to set Domain header in session cookie to the domain root (.
 domain.com).
 Where should I put that code? Not sure how exactly to do it for session
 cookie.

 Marin

  --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] session cookie for two subdomains

2013-12-05 Thread Marin Pranjić
Hi,

I have two subdomains for one app, and I need to use both.
So I have to set Domain header in session cookie to the domain root 
(.domain.com).
Where should I put that code? Not sure how exactly to do it for session 
cookie.

Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] session cookie for two subdomains

2013-12-05 Thread Marin Pranjić
^bump


On Thu, Dec 5, 2013 at 8:22 PM, Marin Pranjić marin.pran...@gmail.comwrote:

 Hi,

 I have two subdomains for one app, and I need to use both.
 So I have to set Domain header in session cookie to the domain root (.
 domain.com).
 Where should I put that code? Not sure how exactly to do it for session
 cookie.

 Marin

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] request.folder

2013-12-04 Thread Marin Pranjić
With trunk (and 2.8.2) I don't get absolute path.

request.folder is applications/appname
Shouldn't it be absolute instead of relative?


Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] request.folder

2013-12-04 Thread Marin Pranjić
update:
It only happens when I use background task (-S appname -M -R ...)
I thought it would also print absolute path.

But this happens with older versions so I guess it's expected?

Marin


On Wed, Dec 4, 2013 at 11:39 AM, Marin Pranjić marin.pran...@gmail.comwrote:

 With trunk (and 2.8.2) I don't get absolute path.

 request.folder is applications/appname
 Shouldn't it be absolute instead of relative?


 Marin

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: admin app killed!

2013-12-02 Thread Marin Pranjić
Clear your sessions, clear existing error tickets and then try again.

Marin


On Mon, Dec 2, 2013 at 4:59 PM, Jonathan Lundell jlund...@pobox.com wrote:

 On 2 Dec 2013, at 7:49 AM, JoeCodeswell joecodesw...@gmail.com wrote:

  Here's a zip of C:\web2py\applications\admin\errors contents.

 Stype 'exceptions.AttributeError' 'dict' object has no attribute
 'is_mobile'

 S'Traceback (most recent call last):\n
 File C:\\web2py\\gluon\\restricted.py, line 217, in restricted\nexec
 ccode in environment\n
 File C:\\web2py\\applications\\admin\\models\\access.py, line 147, in
 module\nis_mobile = request.user_agent().is_mobile\nAttributeError:
 \'dict\' object has no attribute \'is_mobile\'\n'


 
  On Monday, December 2, 2013 7:41:29 AM UTC-8, JoeCodeswell wrote:
  Dear web2py Community,
 
  There were problems for me as well, but now they cleared up. On
 winXpSp3, I had my Firefox-25.0.1 opened while i did an extract into
 C:\web2py. So then [as best as i remember]:
• I checked to see if the upgrade happened by refreshing the admin
 page. result Version did not change.
• So i left the browser open. Turned off the server  turned it on
 again. result new welcome page appeared.
• i clicked on the admin interface button. result:
• ticket appeared  so i clicked on the link result:
• ticket appeared  so i clicked on the link result:
• ticket appeared
• i closed all the browser tabs  shut down   restarted the
 server result:
• ALL IS WELL ??? It seems OK.
• ajax in the startup ???
  The C:\web2py\logs directory is empty.
 
  I hope this adds some light to the subject.
 
  Love and peace,
 
  Joe
 
 
  On Monday, December 2, 2013 5:20:28 AM UTC-8, mweissen wrote:
  Hi,
 
  I have updated my main system to 2.8.2
  Now when I call  my_server/admin  I get an error ticket.
  But I cannot analyze the error ticket, because it  needs admin and I get
 another error.
 
  Afterwards I have copied the whole admin-app from the source over
 my_server/admin - same result.
 
  Any ideas?
  Regards Martin
 

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] auto compiled like in django

2013-11-17 Thread Marin Pranjić
I am not a django user but what happens if you edit a file in django? Do
you need to restart the webserver to make it work?
In web2py you don't (except for modules). Web2py behaves different and it
has its advantages.

But can you tell me why does one need compiled files during development?

(In fact, I don't even compile files in production and no one ever
complained)

It could be possible to make auto compilation in web2py but I don't see why
would anyone need that.
Also ,it is not a django feature, it is a python feature.

pyc files should be created in web2py in /modules automatically. If you
want more django-like behavior, you can write your code inside modules.

Marin


On Sun, Nov 17, 2013 at 9:02 AM, 黄祥 steve.van.chris...@gmail.com wrote:

 hi,

 just wondering, why web2py didn't have auto compiled like in django?
 e.g. everytime create the new python file in django and then execute it
 (cli or browser), i observe that django always create the *.pyc (python
 compiled) for the file that executed.
 honestly, i don't know what exactly happen in the django background
 process, but i assume that django auto compiled the python file so that the
 *.pyc file generated.
 yet in the book about development recipes said to bytecode compile the
 app, so why web2py didn't adopt auto compiled like in django?

 please correct me if i'm wrong.

 ref:

 http://web2py.com/books/default/chapter/29/13/deployment-recipes#Efficiency-tricks

 best regards,
 stifan

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] grid exception, what is wrong?

2013-10-29 Thread Marin Pranjić
This is the code:

query=db.customer_code
codes=SQLFORM.grid(query, left=db.file_queue.on(db.file_queue.code_id==
db.customer_code.id))


On 2.7.1 it prints exception in grid (html). On 2.7.4 and trunk it raises a 
ticket. Is this change intentional?

And why is this not working?

Exception is:

type 'exceptions.AttributeError' 'Row' object has no attribute 'uuid'

While 2.7.1 would print:

Query Not Supported: ('ERROR', '42703', 'column file_queue.uuid does not 
exist')


Marin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py scheduler not working

2013-10-24 Thread Marin Pranjić
Why can't you add that line in cron? I don't get it. Scheduler WILL be
running if you do it, you just need a full path to web2py.py.
Did you even try? What wasn't working?

Anyway there is another way to start scheduler in background:
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service-%28upstart%29

Marin

On Wed, Oct 23, 2013 at 7:43 AM, ranjith ranjith2...@gmail.com wrote:
 Thanks for the response.

 Other than the below script, it was mentioned in the document that scheduler
 workers can be started via cron@reboot
 The scheduler does not use cron, although one can use cron @reboot to start
 the worker nodes.
 I am just starting to work on web2py. So, sorry for ignorance. As far as I
 know, @reboot can be used to call any python function in the application. If
 so, how do i start the worker nodes in that function. The below script
 python web2py.py -k myapp cant be added there. So is there a way to start
 the worker nodes in a python function?? so that on every reboot i can call
 that function via @reboot and the worker nodes will be started
 automatically.


 On Tuesday, 22 October 2013 23:57:27 UTC+5:30, Marin Pranjić wrote:

 You are not supposed to add entries to scheduler_worker. You need to
 run scheduler in the background.

 python web2py.py -K myapp


 Detailed explanation here:
 http://web2py.com/books/default/chapter/29/04/the-core#Scheduler



 Marin

 On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranji...@gmail.com wrote:
  I tried changing the worker table status to active/pick and others. It
  didnt
  work
 
 
  On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote:
 
  Hi,
 
  I have a model file called scheduler.py which has
 
  from gluon.scheduler import Scheduler
  def messageTask():
  mail.send(to=['ranji...@gmail.com'],subject='hello', message='hi
  there')
  return
  scheduler = Scheduler(db,tasks=dict(messageTask=messageTask))
 
  I added an entry in scheduler_task table
  Application Name:
  Task Name:
  Group Name:
  Status:
  Function Name:
  Uuid:
  Args:
  Vars:
  Enabled:
  Start Time:
  Next Run Time:
  Stop Time:
  Repeats:0=unlimited
  Retry Failed:-1=unlimited
  Period:seconds
  Timeout:seconds
  Sync Output:update output every n sec: 0=never
  Times Run:
  Times Failed:
  Last Run Time:
  Assigned Worker Name:
 
 
  I have also added an entry in scheulder_worker table
 
  Id:1
  Worker Name:
  First Heartbeat:
  Last Heartbeat:
  Status:
  Is Ticker:
  Group Names:
 
  + -
 
  Check to delete:
 
 
 
  But the the function is not getting scheduled. Am I missing something
  here? Please help
 
 
  scheduler_run.task_id
 
 
 
 
 
 
  --
  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+un...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


  1   2   3   4   >