Worked for me the following code:
if 'login' in request.args:
auth.settings.login_userfield = 'username'
if request.vars.username and not
IS_EMAIL()(request.vars.username)[1]:
auth.settings.login_userfield = 'email'
request.vars.email =
# So, I want to dynamically add this fields gravity_x, gravity_y,
magnetism_x, magnetism_y, to the table
You can create Field objects and place them inside a list and then call
.define_tables unpacking it.
# fixed values
fields = [Field(grapes), Field(pineapples)]
# build fieds from a
Having this file is awesome I will write a few lines of code to add this to
my security report.
just one question: I tested a failed login myself because my file was
fortunatly empty.
The file format looks like this:
ip 1 1370164406
I asume the one is number of attemps and the long number is a
https://lh6.googleusercontent.com/-oDE7O7Yvqgk/UasTv8GH5TI/AAk/lB1eTk0eIcw/s1600/project+progress.gif
I stumbled apon the about page and this graph so I searched the forums and
found this post. seeing the number of lines written is pretty interesting
but I can't figure this graph out.
I wrote just a simple few lines to display the contents of that file to my
personal Admin report^^
h2Failed logins to Adminpanel:/h2
{{deny=os.path.join('applications', 'admin', 'private', 'hosts.deny')}}
{{file=open(deny,'r')}}
{{lines=file.readlines()}}
{{file.close()}}
{{for l in lines:}}
A web2py newbie says hi to everyone :)
In my app I'm planning to have a sidebar navigation for users of 3 groups:
1. user who's NOT logged in
2. user who IS logged in and stored in db as group 2
3. user who IS logged in and stored in db as group 3
So the 3 user groups have different navigations,
As i remember, one year ago, I had to include the referenced table in the
query, so that it can be used in the select.
Can you give us a source code example of the problem/question?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To
Now, how do I prepare such menu in my controller and then implement it in
the view? What's the best way?
(somewhere in the model)
custom_menu = None
(at the top of the controller)
if not auth.user:
custom_menu = MENU(...) # dirty fork menu
elif auth.has_membership(role=group 1):
when one has a database field with a list:reference type it can be empty.
For quite a few scenarios this is undesirable. but if you use requires
is_not_empty() it first of all doesn't show the reference table entries.
And it still allows you to leave the field empty.
--
---
You received
Thanks, Alan, great post. And it seems very easy.
On Sunday, June 2, 2013 1:58:24 PM UTC+2, Alan Etkin wrote:
Now, how do I prepare such menu in my controller and then implement it in
the view? What's the best way?
(somewhere in the model)
custom_menu = None
(at the top of the
I got a database field which needs to be filled when a bolean is true and
when its not true it should be empty.
Thats what I did:
Field('Booleancheck','boolean'),
Field('Type','reference Type_table', requires=IS_IN_DB (db,'type_table.id',
'type_table.Name') if request.vars.Booleancheck else
The IS_NOT_EMPTY validator is not compatible with a list:string field. A
list can have zero elements. What you want it
IS_LIST_OF(other_validator_for_elements, minimum, maximum)
On Sunday, 2 June 2013 07:14:19 UTC-5, BlueShadow wrote:
when one has a database field with a list:reference type
I would use javascript for this. I may ba adding logic in web2py to do this
soon.
On Sunday, 2 June 2013 08:01:45 UTC-5, BlueShadow wrote:
I got a database field which needs to be filled when a bolean is true and
when its not true it should be empty.
Thats what I did:
Do you need the commented lines?
#request.vars.email = request.vars.username
request.post_vars.email = request.vars.email
#request.vars.username = None
request.post_vars.username = None
On Saturday, 1 June 2013 21:27:05 UTC-5, Gustavo Souza wrote:
As Massimo suggested, you should use Javascript to disable the Type input
when the boolean remains unchecked (and reset Type if an option was
selected and the boolean subsequently unchecked). But if you also want to
validate on the server (which isn't a bad idea), you might try
IS_LENGTH(0),
Web2py noob here: I have a long-running Scheduler task that is updating a
record-count. The record count is displayed in a view.
How would one update the view when the Scheduler updates the record count?
--
---
You received this message because you are subscribed to the Google Groups
How would one update the view when the Scheduler updates the record count?
Instead of having the scheduled task update the value in the client (I
cannot think of a web2py feature able to make that), you could use a
self-updated component with the LOAD helper timing options.
If you have an
Correct this is a data modelling question.
Based on the strengths and flexibility web2py I am trying to figure out how
to model the process I described.
Is it better to use separate tables for issues, objectives, actions,
and ranking then use queries etc to link them together?
If so is it
OK, this might be a silly one.
My app uses one main view (layout.html), which is extended by every other
one.
layout.html has a login form included, created in default.py controller
(the form is supposed to be at hand until user signs in).
Now, whenever I use any other controller, I get an
Darin,
I'm a newbie also and Web2py plug-in wiki may do the job.
If not, off the top of my head the data model roughly seems to be as
follows. I could have misread the concepts, but here's a general idea.
auth_user table
(web2py automatically creates this. It would be like PersonTable if not
I am sorry. I am the problem.
I should use outer join.
I was confused , because not mentioning the reference table in the query
and mentioning it in the select, will generate product of the tables.
Again, I am sorry.
Regards,
Ashraf
On Sunday, June 2, 2013 2:21:25 PM UTC+3, Alan Etkin
greetings to all.
in the following model (which generally works well)
http://pastebin.com/DkUvq29r
when the user enters values in the group are not changed
to uppercase by the system .. bone does not apply is_upper () that
Requires to define in this field
the controller is as follows:
On Sunday, 2 June 2013 17:15:55 UTC-5, lesssugar wrote:
OK, this might be a silly one.
My app uses one main view (layout.html), which is extended by every other
one.
layout.html has a login form included, created in default.py controller
(the form is supposed to be at hand until user
23 matches
Mail list logo