[web2py] Re: Cannot create records in grid

2015-06-15 Thread Niphlod
are you authenticated ? if you don't pass user_signature=False by default 
grids are "read only" (and for a good reason)

On Tuesday, June 16, 2015 at 8:33:33 AM UTC+2, Mirek Zvolský wrote:
>
> Web2py 2.11.2
> Chrome & Firefox
> cache cleared
>
> I don't see Add button in the web2py grid.
> Explicit setting create=True doesn't help.
>
> In controller is just a grid with a table as source - this table is empty 
> yet.
> In view is just grid rendering {{=grid}}
>
> Any idea what I'm doing bad?
> Thanks.. Mirek
>
>

-- 
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] Cannot create records in grid

2015-06-15 Thread Mirek Zvolský
Web2py 2.11.2
Chrome & Firefox
cache cleared

I don't see Add button in the web2py grid.
Explicit setting create=True doesn't help.

In controller is just a grid with a table as source - this table is empty 
yet.
In view is just grid rendering {{=grid}}

Any idea what I'm doing bad?
Thanks.. Mirek

-- 
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] Re: Desempeño en W7 64 bits

2015-06-15 Thread Niphlod
go all the way for iis and fastcgi. the first slice is outdated and frankly 
counter-productive with wfastcgi lying around.

On Monday, June 15, 2015 at 7:42:28 PM UTC+2, Leonel Câmara wrote:
>
> Hey, I've never tried it in production, because frankly there's just much 
> better choices of servers in Linux, this isn't just a web2py problem, it's 
> any Python framework running with WSGI. That said you should be able to get 
> pretty good performance by using IIS with ISAPI WSGI extension.
>
> Like this slice:
>
> http://www.web2pyslices.com/slice/show/1453/install-web2py-on-windows-with-iis
>
> Or even using FastCGI as explained in the book:
> http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#IIS
>

-- 
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] Re: Scheduler Question

2015-06-15 Thread Niphlod
uhm. sqlite lockings then ? 

On Monday, June 15, 2015 at 6:13:04 PM UTC+2, Michael Gheith wrote:
>
> I am querying a remote PostgreSQL database, and then inserting certain 
> values into my local SQLite database, that's 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.


[web2py] Re: Desempeño en W7 64 bits

2015-06-15 Thread Leonel Câmara
Hey, I've never tried it in production, because frankly there's just much 
better choices of servers in Linux, this isn't just a web2py problem, it's 
any Python framework running with WSGI. That said you should be able to get 
pretty good performance by using IIS with ISAPI WSGI extension.

Like this slice:
http://www.web2pyslices.com/slice/show/1453/install-web2py-on-windows-with-iis

Or even using FastCGI as explained in the book:
http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#IIS

-- 
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] Re: Scheduler Question

2015-06-15 Thread 'Michael Gheith' via web2py-users
I am querying a remote PostgreSQL database, and then inserting certain 
values into my local SQLite database, that's 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.


[web2py] Web2py Web-based IDE shortcuts

2015-06-15 Thread Selman Kocael
What is keyboard shortcuts of web2py's web-based IDE. i can't find any
guide about it. I recognize that has shortcuts. but i don't know what are
they.

for example:
in views - index.html
ctrl + space gives advices.

in every files.
alt + mouse select multiple lines.

and so on.

-- 
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] Re: Find name of user with a given id: Auth table issues

2015-06-15 Thread zimani
Ok, i have dropped me and am now using just user. I will try to find a 
solution and update what the error is. Thanks a lot for all your prompt 
help.

On Monday, 15 June 2015 14:45:15 UTC+2, Anthony wrote:
>
> On Monday, June 15, 2015 at 4:57:51 AM UTC-4, zimani wrote:
>>
>> hi Anthony, i apologise for the late response, i had no access to the 
>> internet the whole weekend.
>>
>> Maybe i should clarify. I am customising this from one of your tutorials 
>> "Web development with python and web2py " part 1 and 2
>> The 'user' in this case is the person that posted a post. Hence if i use 
>> auth.user it makes all posts be written by the currently logged in user.
>> I guess my challenge is extracting the value of 'usealiasname' If its 
>> true or not for that user that posted. i tried the 'user.usealiasname' but 
>> it says that user has no attribute 'usealiasname'
>> But thank you for all the help.
>>
>
> In your original code, both "me" and "user" refer to the same record, so 
> there is no need for both. Anyway, if you have a record from db.auth_user 
> and it says there is no "usealiasname" attribute, then there is a problem 
> elsewhere in your code. Hard to say where without seeing all the code.
>
> Anthony 
>

-- 
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] Re: Image from database doesn't get displayed in the View.

2015-06-15 Thread Anthony
On Monday, June 15, 2015 at 7:57:14 AM UTC-4, Meghana Sanagaram wrote:
>
> Hi all,
>
> I'm trying to display an image stored in the database table.
> Here's the table:
>
> db.define_table('menu',
>Field('image','upload'),
>format = '%(title)s')
>
> I used the below html code to render the image:
>
>  alt="{{=i.description}}"/>
>

Is the above code served by an action in the default.py controller? Your 
URL() function call does not include the controller name so will default to 
the controller of the current action. If that is not the same controller 
where you have the "download" function, then this won't work.

Anthony 

-- 
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] Re: Display a PDF file as embed within HTML in a form

2015-06-15 Thread Anthony
Check out http://pdfobject.com/.

The URL to retrieve the PDF file would be URL('default', 'download', 
args=row.pdf_odc) where "row" is a record from your db table.

Anthony

On Monday, June 15, 2015 at 7:57:23 AM UTC-4, kama wrote:
>
> Hi there,
>
>
> do zou know how could I display one filed defined like this:
>
> Field('pdf_doc','upload'))
>
> as embed in one form?
>
> Thanks.
> Cheers.
>
>
>

-- 
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] Re: Auditing Auth Tables

2015-06-15 Thread Anthony
On Monday, June 15, 2015 at 7:57:14 AM UTC-4, dt0...@gmail.com wrote:
>
> Hi,
>
> Excellent product web2py but still trying to get my head around some of 
> the structure
> and some burning questions from the documentation.
>
> Question 1:
> I want my auth tables to have an audit table.
> So i uncommented the following line in db.py:
>
>
> auth.enable_record_versioning(db)
>
>
> Now this did not work:
>
> So some more reading and there is a mention of extra columns in the auth 
> table that are needed.
>
> Such as modified_by etc...
>
> 1) I don't know the definition of these extra columns needed.
>
>
When Auth is initialized, a dummy table with is_active, created_by, 
created_on, modified_by, and modified_on fields is created and stored in 
auth.signature. You can add those fields to individual tables by doing 
db.define_table(..., auth.signature), and you can also add those fields to 
all Auth tables by doing auth.define_tables(..., signature=True).
 

> 2) Shouldn't the auditing as these by default if they are needed?
>
>
Maybe, but for now, you have to first add the relevant fields before 
enabling versioning.
 

> Also there is a bit of the documentation that says signature should equal 
> True for auditing to work.
>
> Is that right? Isn't signature for SSL?
>
>
Not sure what you mean by that. The term "signature" is somewhat generic 
and has different meanings in different contexts. In the context of 
auth.define_tables(), the "signature" argument refers to adding those extra 
fields to each Auth table (semantically, the idea is that the created_by 
and modified_by fields are like a signature, given that they record the 
identify of the user who created/modified the record).

Anthony

-- 
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] Re: Image from database doesn't get displayed in the View.

2015-06-15 Thread 黄祥
please try :
{{=IMG(_src = URL('default', 'download', args = i.image), 
   _alt = i.description, _width = '110', _height = '110') }}

best regards,
stifan
Could somebody help me?

-- 
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] Re: Find name of user with a given id: Auth table issues

2015-06-15 Thread Anthony
On Monday, June 15, 2015 at 4:57:51 AM UTC-4, zimani wrote:
>
> hi Anthony, i apologise for the late response, i had no access to the 
> internet the whole weekend.
>
> Maybe i should clarify. I am customising this from one of your tutorials 
> "Web development with python and web2py " part 1 and 2
> The 'user' in this case is the person that posted a post. Hence if i use 
> auth.user it makes all posts be written by the currently logged in user.
> I guess my challenge is extracting the value of 'usealiasname' If its true 
> or not for that user that posted. i tried the 'user.usealiasname' but it 
> says that user has no attribute 'usealiasname'
> But thank you for all the help.
>

In your original code, both "me" and "user" refer to the same record, so 
there is no need for both. Anyway, if you have a record from db.auth_user 
and it says there is no "usealiasname" attribute, then there is a problem 
elsewhere in your code. Hard to say where without seeing all the code.

Anthony 

-- 
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] Auth Roles

2015-06-15 Thread Michele Comitini
I think what you need is in the book:
http://web2py.com/books/default/chapter/29/09/access-control#Authorization

2015-06-14 23:48 GMT+02:00 :

> Hi,
>
> Excellent product web2py but still trying to get my head around some of
> the structure
> and some burning questions from the documentation.
>
> Question 2:
> Hi at the moment every time a user registers, a new 'role' is created for
> the user.
> Basically I want three roles:
> USER
> STAFF
> ADMIN
>
> Admin goes without saying and can be manually changed in the DB.
> When a user registers online, how do I get them to be in the group role
> 'USER'
> Afterwards I will have the admin with the ability to add STAFF group to a
> particular USER.
>
> Do I have to define the roles in the DB after by code in db.py once the
> tables are created, what is the correct way?
> Also how do I get any user who registers to be automatically in group
> 'USER'?
> Cause at the moment a new role is created everytime.
>
>
> Thanks to anyone answering my questions.
>
> Den
>
>  --
> 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] Display a PDF file as embed within HTML in a form

2015-06-15 Thread kama
Hi there,


do zou know how could I display one filed defined like this:

Field('pdf_doc','upload'))

as embed in one form?

Thanks.
Cheers.


-- 
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] Auditing Auth Tables

2015-06-15 Thread dt0901
Hi,

Excellent product web2py but still trying to get my head around some of the 
structure
and some burning questions from the documentation.

Question 1:
I want my auth tables to have an audit table.
So i uncommented the following line in db.py:


auth.enable_record_versioning(db)


Now this did not work:

So some more reading and there is a mention of extra columns in the auth table 
that are needed.

Such as modified_by etc...

1) I don't know the definition of these extra columns needed.

2) Shouldn't the auditing as these by default if they are needed?


Also there is a bit of the documentation that says signature should equal True 
for auditing to work.

Is that right? Isn't signature for SSL?


Thanks to anyone answering my questions.

Den

-- 
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] Image from database doesn't get displayed in the View.

2015-06-15 Thread Meghana Sanagaram
Hi all,

I'm trying to display an image stored in the database table.
Here's the table:

db.define_table('menu',
   Field('image','upload'),
   format = '%(title)s')

I used the below html code to render the image:



Though I'm able to see that the image files are stored in the table, for 
each image, the alt text is getting displayed. 

Could somebody help me?

-- 
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] Use of list:reference giving a foreign key error

2015-06-15 Thread Travis May
Here is my code:

Controller
def index():
form = SQLFORM(db.guest_questionnaire)
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = ''

return dict(form=form)

Model

db.define_table('contact_time',
Field('contact_time', 'string'),
format='%(contact_time)s'
)

db.define_table('guest_questionnaire', 
 Field('best_times_to_reach', 'list:reference 
contact_time',widget=SQLFORM.widgets.checkboxes.widget)
 )

View


Best Times to Reach You
{{=form.custom.widget.best_times_to_reach}}


The form renders just fine in the view, but when it is submitted, I get a 
Foreign Key Constraint Error.  Any ideas as to why?

 FOREIGN KEY constraint 
failedVersionweb2py™Version 
2.11.2-stable+timestamp.2015.05.30.16.33.24PythonPython 2.7.3: 
/Users/travismay/Downloads/web2py/web2py.app/Contents/MacOS/python (prefix: 
/Users/travismay/Downloads/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/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/restricted.py",
 line 227, in restricted
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/applications/betsy/controllers/default.py"
 , line 
70, in 
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/globals.py",
 line 412, in 
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/applications/betsy/controllers/default.py"
 , line 
20, in index
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/html.py",
 line 2301, in process
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/html.py",
 line 2238, in validate
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/sqlhtml.py",
 line 1688, in accepts
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/objects.py",
 line 691, in insert
  File 
"/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/adapters/base.py",
 line 731, in insert
IntegrityError: FOREIGN KEY constraint failed

Error snapshot [image: help] 


(FOREIGN KEY constraint failed)

inspect attributes
Frames
   
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/restricted.py
 
   in restricted at line 227* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/applications/betsy/controllers/default.py
 
   in  at line 70* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/globals.py
 
   in  at line 412* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/applications/betsy/controllers/default.py
 
   in index at line 20* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/html.py 
   in process at line 2301* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/html.py 
   in validate at line 2238* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/sqlhtml.py
 
   in accepts at line 1688* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/objects.py
 
   in insert at line 691* code arguments variables
   - 
   
   *File 
   
/Users/travismay/Downloads/web2py/web2py.app/Contents/Resources/gluon/packages/dal/pydal/adapters/base.py
 
   in insert at line 731* code arguments variables
   Function argument list
   
   (self=, table=, 
   fields=[(, 1), (, 
   ''), (, 20), (, 8), 
   (, 5), (, ''), 
   (, 1), (, 3), 
   (, ''), (, ''), 
   (, 2), (, 11), 
   (, ['1']), (, ''), 
   (, 1), (, ''), 
   (, 2), (, ''), 
   (, ''), (, ''), 
   ...])
   Code listing
   
   726.
   727.
   728.
   729.
   730.
   731.
   
   732.
   733.
   734.
   735.
   
   self.execute(query)
   except Exception:
   e = sys.exc_info()[1]
   if hasattr(table,'_on_insert_error'):
   return table._on_insert_error(table,fields,e)
   raise e
   
   if hasattr(table, '_primarykey'):
   mydict = dict([(k[0].name, k[1]) for k in fields if k[0].name in 
table._primarykey])
   if mydict != {}:
   r

[web2py] Re: How to display Google Maps (iFrame?)

2015-06-15 Thread Robert Porter


On Friday, 5 June 2015 06:28:54 UTC-7, 黄祥 wrote:
>
> please take a look at web2py book about components and plugins
> ref:
>
> http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax
>
> best regards,
> stifan
>

Thanks to both of you.  This was very helpful 

-- 
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] Desempeño en W7 64 bits

2015-06-15 Thread Jorge Vega Trigueros
Saludos, desde Costa Rica.

Mucho agradezco la colaboración.
Quisiera saber si se presentan problemas en W7+64b con Web2py, estoy por 
cuanto estoy pensando seguir desarrollando con este framework.
Que hace meses vengo siguiendo.


Gracias.

-- 
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] Auth Roles

2015-06-15 Thread dt0901
Hi,

Excellent product web2py but still trying to get my head around some of the 
structure
and some burning questions from the documentation.

Question 2:
Hi at the moment every time a user registers, a new 'role' is created for 
the user.
Basically I want three roles:
USER
STAFF
ADMIN

Admin goes without saying and can be manually changed in the DB.
When a user registers online, how do I get them to be in the group role 
'USER'
Afterwards I will have the admin with the ability to add STAFF group to a 
particular USER.

Do I have to define the roles in the DB after by code in db.py once the 
tables are created, what is the correct way?
Also how do I get any user who registers to be automatically in group 
'USER'?
Cause at the moment a new role is created everytime.


Thanks to anyone answering my questions.

Den

-- 
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] Re: using PyCharm

2015-06-15 Thread Tim Richardson
Hi Alex, 
Symbolic links on Windows seem broken out of the box even on current 
versions and nothing would surprise me on Windows except when symbolic 
links work. On my mac I use symbolically linked folders with no problems at 
all, but this is not a production environment. For example, my web2py-book 
repository is not under a web2py root, but I have it symbolically linked. 
It has always worked well in pycharm; I have never had any issues. 

I don't even know what a Scope is in Pycharm (told you I was an 
unsophisticated user) so if I am using scopes, then only whatever I get by 
default.
Find in Path: I just right click on the desired starting point in the 
project structure window to descend from there. I find PyCharm a pleasant, 
easy experience for web2py. 

-- 
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] Re: using PyCharm

2015-06-15 Thread Alex
So you don't have the problem with files getting out of sync inside 
symbolic linked folders (applications)? I have this problem on Windows and 
Linux, e.g. everytime the language file gets modified by the application I 
have to manually synchronize the folder in PyCharm.

and what about the project structure? So you only have one PyCharm project 
for all your applications. How do you handle "Find in Path" and similar 
features? I assume you always set a Scope?

Am Montag, 15. Juni 2015 08:01:14 UTC+2 schrieb Nico de Groot:
>
> I'm using a similar setup. Within the applications folder I have repos 
> using git and also symbolic links to repos at other locations. 
> No problems. Works fine. I'm using MacOs. 
> Nico de Groot

-- 
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] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-15 Thread Paolo Valleri
According to my tests, the current PG adapter works only with psycopg2 and 
python2.7
It is broken with both pg8000 and psycopg2 on python 3.x

A possible fix for pg8000 and python2.7 is 
here 
https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

I've posted an issue for psycopg2 with python3.x 
here https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

Paolo

On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>
> It is a bug in pg8000. You need to install psycopg2
>
> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>
>> I have the same problem. PostgreSQL database, web2py 
>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>> source install.
>>
>> Now any field update which has non-ASCII characters fails with "> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
>> position X: ordinal not in range(128)"
>> By any field update, I mean custom forms, form grids, and even database 
>> administration.
>>
>> This is the traceback after failing to change a user's name to "José" 
>> with database administration:
>>
>> Traceback (most recent call last):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, 
>> in restricted
>> exec ccode in environment
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , line 
>> 704, in 
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
>> 
>> self._caller = lambda f: f()
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , line 
>> 343, in update
>> if form.accepts(request.vars, session):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
>> accepts
>> self.id_field_name]).update(**fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
>> line 2020, in update
>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>  line 996, in update
>> raise e
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
>> ordinal not in range(128)
>>
>>
>> I don't recall having this problem with pre 2.10 versions
>>
>

-- 
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] Re: Expose public ip address with SOAP

2015-06-15 Thread Niphlod
ok, rephrasing  "Then, I deploy the app on internet" <-- how is it 
deployed ?

On Monday, June 15, 2015 at 10:19:11 AM UTC+2, DucVa wrote:
>
> I don't config. I am using default mode. How must I config it?
>
> Vào 15:51:28 UTC+7 Thứ Năm, ngày 11 tháng 6 năm 2015, Niphlod đã viết:
>>
>> it seems that web2py uses request.env.wsgi_url_scheme, 
>> request.env.http_host to build the url. How is your server configured ?
>>
>>

-- 
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] Re: Mail.send failure

2015-06-15 Thread webpypy
for the gmail account :

port 465 leads to the error (timeout)

port 25,587 lead to the error (10013 )


Any help is appreciated..



On Sunday, June 14, 2015 at 6:26:00 AM UTC+3, webpypy wrote:
>
> Hi :
>
> I got the error
>
> error 10013
> An attempt was made to access a socket in a way forbidden by its access 
> permissions.
>
> what is the cause?
>
> sender is in the format x...@gmail.com  ( I mean there 
> are two dots). Is this a problem?
>
> Regards,
>
> Ashraf
>
>  
>

-- 
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] Re: Find name of user with a given id: Auth table issues

2015-06-15 Thread zimani
hi Anthony, i apologise for the late response, i had no access to the 
internet the whole weekend.

Maybe i should clarify. I am customising this from one of your tutorials 
"Web development with python and web2py " part 1 and 2
The 'user' in this case is the person that posted a post. Hence if i use 
auth.user it makes all posts be written by the currently logged in user.
I guess my challenge is extracting the value of 'usealiasname' If its true 
or not for that user that posted. i tried the 'user.usealiasname' but it 
says that user has no attribute 'usealiasname'
But thank you for all the help.


On Friday, 12 June 2015 17:55:03 UTC+2, Anthony wrote:
>
> If you have:
>
> user = db.auth_user(id)
>
> Then there is no need for the "me" variable -- just use user.usealiasname. 
> However, if id is the same as auth.user_id, then you don't even need the 
> above line -- just use auth.user (which holds the whole user record). If it 
> still isn't working, then there is likely a problem elsewhere in your code.
>
> Anthony
>
> On Friday, June 12, 2015 at 9:20:00 AM UTC-4, zimani wrote:
>>
>> Its supposed to be the same. But this does not work. All i am doing is 
>> checking if this user: db.auth_user(id) wants to use an aliasname or not. 
>> Of which aliasname is a field in auth_user table
>>
>> On Friday, 12 June 2015 15:11:19 UTC+2, zimani wrote:
>>>
>>> I apologise, i have been trying too many things:
>>>
>>>
>>> me=db(db.auth_user.id == 
>>> id).select(db.auth_user.usealiasname).first().usealiasname
>>>
>>> This is what i currently have.
>>>
>>>
>>> On Friday, 12 June 2015 14:54:57 UTC+2, Anthony wrote:



 On Friday, June 12, 2015 at 8:36:43 AM UTC-4, zimani wrote:
>
> I have this code:
>
> def author(id):
> if id is None:
> return "Unknown"
> else:
> user = db.auth_user(id)
> me=db(db.auth_user.id == 
> id).select(db.auth_user.usealiasname).first().usealiasname
> if me==False:
> return '%(first_name)s %(last_name)s' % user if user else 
> ''
> else:
> return '%(aliasname)s' % user if user else ''
>
>
> I want to check if the user with a particular 'id' wants to use an 
> aliasname or real names. However it wont work. i know for sure this line 
> is 
> the one that is wrong because without the condition it prints properly. 
> can 
> somebody help. i am sure its simple but i cannot seem to figure it out.
>
> me=db(db.auth_user.id == 
> auth.user_id).select(db.auth_user.usealiasname).first().usealiasname
>

 In the function code you showed above, you have db.auth_user.id == id, 
 but here you have db.auth_user.id == auth.user_id. Which code are you 
 actually using? Is id supposed to be the same value as auth.user_id? If 
 so, 
 your "me" variable is unnecessary, as you are simply fetching the same 
 record that you have already stored in the "user" variable.

 Anthony 

>>>

-- 
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] Re: Expose public ip address with SOAP

2015-06-15 Thread DucVa
I don't config. I am using default mode. How must I config it?

Vào 15:51:28 UTC+7 Thứ Năm, ngày 11 tháng 6 năm 2015, Niphlod đã viết:
>
> it seems that web2py uses request.env.wsgi_url_scheme, 
> request.env.http_host to build the url. How is your server configured ?
>
>

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