[web2py] Re: Putting time in a string

2015-11-04 Thread Dave S
On Wednesday, November 4, 2015 at 7:13:16 AM UTC-8, Garry Smith wrote: > > Hi > Thanks for the reply, the session.time was left in my mistake, > I tried it without the session and it still gave me the same error, I have > tried your suggestion and is working. > The only problem I am having

[web2py] Why won't web2py serve my .vcf file?

2015-11-04 Thread tim spear
I'm trying to let users download a .vcf file (vCard). I copied myfile.vcf to the static folder. When I try going to www.myapp.com/static/myfile.vcf I get "invalid request" while other files in the static folder ending .js or .ico get served fine. Any ideas why it doesn't like .vcf or how to

[web2py] Re: Password protecting a folder (subdomain)

2015-11-04 Thread Dave S
On Wednesday, November 4, 2015 at 6:19:41 AM UTC-8, digirew wrote: > > Hello, > > I have a folder (html files & png as images) that I would like to password > protect and only have specified users access. > > Can I set this up using web2py? or do they all need to be pages created in > web2py? >

[web2py] Re: decorator "Or" operator syntax

2015-11-04 Thread Alex Glaros
oops, regarding security, you're right Anthony. Users could walk the URL address. Is this better? Seems to work... @auth.requires(lambda: not db((db.auth_membership.user_id == auth.user_id) & (db.auth_membership.group_id == db.auth_group.id) & (db.auth_group.role ==

Re: [web2py] its possible get mac address?

2015-11-04 Thread Dave S
On Wednesday, November 4, 2015 at 11:58:07 AM UTC-8, Carlos Cesar Caballero wrote: > El 04/11/15 a las 14:30, Fabiano Almeida escribió: > > Hi! > > Web2py can obtain mac address from user? > > > Bassicly, the MAC address don't cross the routers, so, you can't get the mac address of a client

[web2py] Re: decorator "Or" operator syntax

2015-11-04 Thread Anthony
On Wednesday, November 4, 2015 at 5:47:07 PM UTC-5, Alex Glaros wrote: > > oops, regarding security, you're right Anthony. Users could walk the URL > address. Is this better? Seems to work... > > @auth.requires(lambda: not db((db.auth_membership.user_id == auth.user_id) > &

[web2py] Re: decorator "Or" operator syntax

2015-11-04 Thread Alex Glaros
That's completely unacceptable, bad security. You are right Anthony. What would be a better method? Right now the value of role field in db.auth_group is the same as the primary key of the object I want to set auth for. I was hoping to use that idea to be able to restrict users to that

[web2py] Web2py / Pydal Time Fields

2015-11-04 Thread Mark Graves
Hey everyone, I find myself in the need for microsecond level precision for time fields where I am querying over those fields regularly. As I dug into pydal and web2py's internals, I noticed that it seems to be convention that times are truncated to H:M:S I'm aware I can easily store as a

[web2py] Re: auth_group/membership auto assign and disable sign up?

2015-11-04 Thread Dave S
On Wednesday, November 4, 2015 at 7:23:38 PM UTC-8, lucas wrote: > > hello one and all, > > i set up three records under auth_group, Developer, Administrator, and > Personnel. a few questions. i want to disable the "Sign Up" option under > the "Log In" submenu. how do i remove that option?

[web2py] Re: auth_group/membership auto assign and disable sign up?

2015-11-04 Thread 黄祥
i want to disable the "Sign Up" option under the "Log In" submenu. how do i remove that option? *models/db.py* auth.settings.actions_disabled = myconf.take('auth.actions_disabled') *static/appconfig.ini* actions_disabled = ['register'] how do i direct web2py code to default the new login to

[web2py] Re: auth_group/membership auto assign and disable sign up?

2015-11-04 Thread 黄祥
oopss, sorry, my bad. the recent web2py version is adapted appconfig to store configuration like (db uri, smtp server n login, form styling, auth config like my example, meta, etc), you can see it in models/db.py e.g. *models/db.py* from gluon.contrib.appconfig import AppConfig ## once in

[web2py] auth_group/membership auto assign and disable sign up?

2015-11-04 Thread lucas
hello one and all, i set up three records under auth_group, Developer, Administrator, and Personnel. a few questions. i want to disable the "Sign Up" option under the "Log In" submenu. how do i remove that option? and i want anyone with Administrator right to be able to create new login

[web2py] Re: auth_group/membership auto assign and disable sign up?

2015-11-04 Thread lucas
oh, ok, yes, a config file, i get it. nice. i might use that new feature now. thank you for that. lucas On Wednesday, November 4, 2015 at 11:26:40 PM UTC-5, 黄祥 wrote: > > oopss, sorry, my bad. > the recent web2py version is adapted appconfig to store configuration like > (db uri, smtp

[web2py] Re: auth_group/membership auto assign and disable sign up?

2015-11-04 Thread lucas
i don't understand the myconf.take function. can you explain that? is it new to web2py? lucas -- 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

[web2py] Re: decorator "Or" operator syntax

2015-11-04 Thread Anthony
Are you saying that: @auth.requires_membership(request.get_vars.specificObjectID) allows access, but with the exact same query string (i.e., specificObjectID set to the same value in the URL query string): @auth.requires(auth.has_membership('Engagement_Squared_Super_Admin') or

Re: [web2py] its possible get mac address?

2015-11-04 Thread Carlos Cesar Caballero Díaz
Bassicly, the MAC address don't cross the routers, so, you can't get the mac address of a client from a external network server, you only can get the MAC of the last router. You could do some tweak using ARP, but only if the client and server are in the same subnet. Greetings. El 04/11/15 a

[web2py] its possible get mac address?

2015-11-04 Thread Fabiano Almeida
Hi! Web2py can obtain mac address from user? Thanks in advance, Fabiano. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] decorator "Or" operator syntax

2015-11-04 Thread Alex Glaros
Only the first-named requirement gets executed when I use "or" in a decorator. What is correct "or" syntax? In below example, the first item works and the second is ignored. @auth.requires_membership(request.get_vars.specificObjectID or 'Engagement_Squared_Super_Admin') In second example

[web2py] Re: custom auth table email field set to unique=True accepts non unique values with different case.

2015-11-04 Thread Anthony
unique=True is enforced by the database, not web2py, so it may be case sensitive depending the backend. Also, failures will result in a database error rather than a nice error message reported to the user in the UI. Instead, you should rely on validators to manage this: Field('email',

[web2py] Re: web2py and python3

2015-11-04 Thread Massimo Di Pierro
There will be a new framework similar to web2py for python 3. web2py has to be backward compatible and it is pointless to port it to python 3. On Wednesday, 4 November 2015 06:25:40 UTC-6, Jim Gregory wrote: > > I know this has come up in the past, but it hasn't been asked in a while. > > Is

[web2py] Re: test for integer in form

2015-11-04 Thread Massimo Di Pierro
I am lost in this thread. Can you state your problem once more with a couple of examples. I am pretty sure try... except is wrong. The requires=IS_INT_IN_RANTE(minumum,maximum) can also be set in controllers, does not have to be set in models. Moreover try: int(s) except: pass is

[web2py] Re: About static files in markmin

2015-11-04 Thread Martin Weissenboeck
Thank you very much - this solves my problem: I want to use these files in a wiki. It has not been clear for me whether "@args" will be resolved first or "[[...]]". 2015-11-04 15:31 GMT+01:00 Massimo Di Pierro : > MARKMIN itself does not mess with paths. It just

Re: [web2py] bootstrap3 formstyle checkboxes

2015-11-04 Thread Richard Vézina
In the book it mention that radio and checkboxes widget have different style attribute, your issue is probably related to this particularity of these widget ? Quote from the book : Widgets are helper factories and their first two arguments are always field and value. The other arguments can

[web2py] auth tables not visible in appadmin

2015-11-04 Thread Red Beard
Hi, My problem is that the auth tables do not appear in appadmin, though the system allows me to register users, and it seems to remember them. I am following the example in the book (chapter 3, overview: http://www.web2py.com/books/default/chapter/29/03/overview) I have left the model

Re: [web2py] DAL alternatives

2015-11-04 Thread Massimo Di Pierro
Something like this was already implemented 4 years ago when we write a compatibility layer between Django and web2py: http://web2py.com/AlterEgo/default/download/document.file.08621820-64d8-4db5-a85c-569a647a4437.py Perhaps you can take some of that code and re-adapt it. On Monday, 2

[web2py] Apache 2.4 - 403 Forbidden Issue

2015-11-04 Thread Barış Güvercin
Hello everyone, I have newly installed Debian 8 and Apache 2.4 server. I run the script setup-web2py-ubuntu.sh (attached). And wsgihandler.py has +x permission. But when I connect server, I get '403 Forbidden' / 'You don't have permission to access / on this server.' In apache's error log :

[web2py] DAL returns string fields not as unicode strings

2015-11-04 Thread Dandelion Mine
Hello! According to Web2py book, 'by default web2py uses utf8 character encoding for databases'. I get the contrary results: there are fields with type 'string', mysql shows that they have collation utf8_general_ci, but when I select them with DAL, the type of returned fields are 'str', not

[web2py] Password protecting a folder (subdomain)

2015-11-04 Thread digirew
Hello, I have a folder (html files & png as images) that I would like to password protect and only have specified users access. Can I set this up using web2py? or do they all need to be pages created in web2py? Andrew -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Simple Tutorial for using web2py with an html5 template

2015-11-04 Thread jack somber
I found a modern template at html5up.com, and am trying to use it with web2py. Does anyone know of a tutorial for this. Assets include css, js, fonts, sass. Or is it as simple as uploading the assets and connecting them to the html? Thanks. -- Resources: - http://web2py.com -

[web2py] Re: Putting time in a string

2015-11-04 Thread Garry Smith
Hi Thanks for the reply, the session.time was left in my mistake, I tried it without the session and it still gave me the same error, I have tried your suggestion and is working. The only problem I am having know is the request.client is sending a ip of 127.0.0.1, which ever client pc I use.

[web2py] Re: About static files in markmin

2015-11-04 Thread Massimo Di Pierro
MARKMIN itself does not mess with paths. It just render the markup to HTML. Paths are framework/application/routes dependent therefore there cannot be a generic syntax in markmin that works in every case. The same problem happens when the hostname changes. In auth.wiki we solve the problem by

[web2py] Re: Putting time in a string

2015-11-04 Thread Alfonso Serra
you are overwriting t and not converting back to string session.time = t -- 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

[web2py] web2py and python3

2015-11-04 Thread Jim Gregory
I know this has come up in the past, but it hasn't been asked in a while. Is there ever going to be a usable and maintained Python3-compatible fork of web2py? The latest edition of Fedora now ships with Python3 by default. It's the default version used in Django's tutorial. I'm not using

[web2py] Re: Submissão Python Brasil 11

2015-11-04 Thread Matheus Cardoso
Ari613, o que chamo de framework de nicho é devido a natureza do web2py, embora ele tenha influências pesadas de outros frameworks Python, como o próprio Django. Mas se você parar para olhar, o web2py tem características que o diferenciam bastante de outros frameworks full stack, começando pelo

Re: [web2py] Web2py - Babel

2015-11-04 Thread Mirek Zvolský
This is new for me, I have read this chapter for much older framework version. It looks good but I need to study this system more to decide what is better, if the standard gettext/babel system or the Web2py solution. Thank you. Dne úterý 3. listopadu 2015 11:22:50 UTC+1 Vinicius Assef

[web2py] Returning a controller function with an integer causes Thread issues

2015-11-04 Thread Calvin
Hi I was working on the a controller function where the end result was the row id following a def insert_record() id= db[f].insert(**data) operaton return id As it turns out, this works without a hitch on my mac running python 2.7.10 and Web2py Version

[web2py] Re: auth tables not visible in appadmin

2015-11-04 Thread Anthony
Can you pack and attach a minimal app that displays the problem? On Wednesday, November 4, 2015 at 9:19:41 AM UTC-5, Red Beard wrote: > > Hi, > > My problem is that the auth tables do not appear in appadmin, though the > system allows me to register users, and it seems to remember them. > > > >

Re: [web2py] bootstrap3 formstyle checkboxes

2015-11-04 Thread Gary Cowell
Ah, I see that my 'checkbox' is actually this widget by default: SQLFORM.widgets.boolean.widget So then it's in fact the boolean.widget that isn't being correctly styled. Still trying to work out where the styling for boolean.widget comes from. Still think it's something that will be

Re: [web2py] Re: web2py and python3

2015-11-04 Thread António Ramos
@massimo When will it be available ? 2015-11-04 14:38 GMT+00:00 Massimo Di Pierro : > There will be a new framework similar to web2py for python 3. web2py has > to be backward compatible and it is pointless to port it to python 3. > > > On Wednesday, 4 November 2015

[web2py] Re: Simple Tutorial for using web2py with an html5 template

2015-11-04 Thread Anthony
I would recommend reading the layout section of the book and take a look at the layout.html file included in the welcome app. Just use the template you have found as the starting point for your layout, and add in the

Re: [web2py] bootstrap3 formstyle checkboxes

2015-11-04 Thread Richard Vézina
When you want control over widget that are manage by sqlform, you better set the widget at the model level and pass you preferences of display... If it still not working you can implement your own widget where you are free to style it the way you want even change the display framework completly...

[web2py] Re: test for integer in form

2015-11-04 Thread Alex Glaros
I want to prevent users from choosing a db.auth_group.role name that is an integer because integer names for roles are reserved fro admin purposes. Admin uses primary key of an organization or other entities as the db.auth_group.role name. This makes it effortless to manage permissions for

[web2py] Re: [web2py-users-brazil:8169] Re: Submissão Python Brasil 11

2015-11-04 Thread Ari Sobel
Opa, Matheus, muito obrigado pelas colocações. Sim. Não conheço nada de outros frameworks, o web2py foi minha porta de entrada no mundo web (fora uma curta incursão no PHP sem framework), por isso nao posso falar dos outros. Mas os pontos fortes que ouço são principalmente o PyDal e usar Python

[web2py] custom auth table email field set to unique=True accepts non unique values with different case.

2015-11-04 Thread arihant daga
In custom auth table even if email field is set to unique=true, if user inputs two different values different in case ex.( 'em...@gmail.com' and 'em...@gmail.com' ) it will accepts both and will store both of them in database. Hence enabling a user to signup with the same email id multiple

Re: [web2py] How to get my pdf-file to display from webserver

2015-11-04 Thread Karl Florian
Thanks! The first part is working!!! The filename is as it is supposed to be! This is my code at the Moment, maybe some can use it: ltxfile = str(os.path.join(request.folder, 'tex', 'languages.tex')) pdffile = str(os.path.join(request.folder, 'tex', 'languages.pdf'))

[web2py] Putting time in a string

2015-11-04 Thread Garry Smith
H i I am trying to put the current time in a email message using the following:- Enter code here...def index(): import datetime ip = str(request.client) t = str(datetime.datetime.today()) form = SQLFORM.factory( Field('name', requires=IS_NOT_EMPTY()),