please check discussion on :
https://groups.google.com/forum/?fromgroups=#!topic/web2py/6wU3AtkwtA0
there are 2 example apps on that.
hope this can help.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and
is it computed on update?
is there any error traceback?
is the prerequisites computed field is filled?
btw, you can use the computation function in controller too.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this
Thank you both for your replies.
Are you using SQLFORM? Note, you can do SQLFORM(...,
formstyle='bootstrap'). If that doesn't yield what you're looking for, you
can do SQLFORM(..., formstyle=custom_function). See
https://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#773 for
an
I have a table 'subscribe':
db.define_table('subscribe',
Field('viewID','reference view'),
Field('moduleID','reference
module',requires=IS_EMPTY_OR(IS_IN_DB(db,'module.id','%(name)s')),ondelete='RESTRICT',represent=lambda
moduleID, row: db(db.module.id==moduleID).select().first().name
thanks for reply.
I tried modifying the controller as per the company model that you provided
earlier. But I am getting following error :
type 'exceptions.AttributeError' 'DAL' object has no attribute 'auth'
Sorry for this basic question, but I am a beginner to web2py. Hope you can
help me
I ran into another issue, in case of multiple select=True the form won't
submit, the moduleID field gives me a 'value not in database' error.
I adjusted my code, I moved the IS_EMPTY_OR(IS_IN_DB)) validator from the
model:
Field('moduleID','reference module',ondelete='RESTRICT'),
... to the
Thanks Mika,
But my question was more about the model :
If I delete phone_number field from my 'contact' table, I won't be able to
access it and dump previous data.
I could keep phone_number in 'contact' table and comment something like #
depreceated field, do not use anymore but I think this
the code can definitely check for the requirements and activate some kind
of migration of data, but I'd manage it outside the web process (i.e., I'll
prepare a script meant to be run as webp2y.py -M -S appname -R
upgradescript.py)
On Monday, March 25, 2013 9:10:58 AM UTC+1, Loïc wrote:
hi,
is it possible to execute 2 function during update using sqlform.grid?
my goal is to combine e.g.1 with e.g.2 onupdate function.
for description :
in e.g.1 during update i want to update the others tables (room and
cleaning)
in e.g.2 during update i want to archive the previous value, so
ooopsss, sorry
created_by_user=db.company.created_by == db.auth.user.id
*should be :*
created_by_user=db.company.created_by == auth.user http://db.auth.user.id/
and it *work just for the query, not for editable and deletable*
for your case please try (the solution is on the book):
def rent():
Dear all, I want to share with you some results. I implemented a query in
two different ways. Given the following common code:
start = db.record.with_alias('start_point')
end = db.record.with_alias('end_point')
elapsed_time = end.gathered_on.epoch() - start.gathered_on.epoch()
The first query is
I didn't get the point.
Q1 is slower (obviously) cause of the epoch() function and the additional
filtering
Q1 with cache shows more or less the same duration as Q2 with cache.
the key point is even when the cache is enabled the first query is taking
longer ... longer than what ?
Q1 with
Hi,
It's possible to put the €/$ symbol in a column in a SQLForm.grid?.
Thanks
--
---
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
I tried the same, now all the results are non editable, it seems I need to
add user_login to edit permission.
I am doing the below for adding the permission, but not successful.
auth.add_permission('edit','mana...@test.com', 'company', 0)
Just one more question: since this expression will
this **should** work
db.table.field.represent = lambda value : %s € % value
of course you can pass your own formatting value
On Monday, March 25, 2013 10:19:53 AM UTC+1, José Manuel López wrote:
Hi,
It's possible to put the €/$ symbol in a column in a SQLForm.grid?.
Thanks
--
---
You
did you add this in your grid?
editable = auth.has_permission('edit','auth_user'),
deletable = auth.has_permission('delete','auth_user')
i've already tested it before i posted and it works fine on me.
in my test environment for your case i didn't add :
Thank you Niphlod,
I've use:
lambda value, row : %s € % value
On Monday, March 25, 2013 10:34:46 AM UTC+1, Niphlod wrote:
this **should** work
db.table.field.represent = lambda value : %s € % value
of course you can pass your own formatting value
On Monday, March 25, 2013 10:19:53
Paolo
2013/3/25 Niphlod niph...@gmail.com
I didn't get the point.
Q1 is slower (obviously) cause of the epoch() function and the additional
filtering
Q1 with cache shows more or less the same duration as Q2 with cache.
the key point is even when the cache is enabled the first query
I have a model defined like that. There is a reference to the build in auth
user. The requirement is to create such submission via an unsecured
controller and to register or login on the same page in one step.
db.define_table(
'submission',
Field('title', requires = IS_NOT_EMPTY()),
Hi Niphlod, thanks for the answer. I am not blaming on web2py I am just
sharing with you all these results.
In both the cases I have the time constrain, in one case it is in the query
(Q1) while in the second it is explicit(Q2). With cache enabled, Q1 is no
longer checking the constrain while Q2
Hi
I have a controller sending JSON to my view. I cannot get the data into
the TreeGrid. The Json is coming down correctly (I placed it manually and
it works). Running this code places the JSON on the webpage. Controller and
View below.
Help appreciated.
Regards
Nate
CONTROLLER
I think I kinda figured out the problem. The order of defining tables
seems matter. Tables to be referenced need to be defined before the
referencing tables. Guess it's a rookie mistake.
I don't think it's a matter of table definition order. Maybe there aren't
any referenced records in
I did added it in grid, my controller is :
@auth.requires_login()
def rent():
grid=SQLFORM.grid(db.company, user_signature=False,
editable = auth.has_permission('edit','auth_user'),
deletable = auth.has_permission('delete','auth_user'))
return
well, when you plan to use cache you do it because:
a) the additional roundtrip is negligible
b) using the cache means your database is not used
I'll explain it further
A query that takes 0.18ms to get computed on the database side can very
well end up in 18sec as soon as your database gets
hm, it seems that i must redive down to the code that i've provide above.
in my code above the company is automatic generate using populate before i
populate the membership, group and user that will cause the created_by is
not filled. you can also remove the populate first to make it simple
Thanks for the very clear explanation.
I made the following:
t0 = time.time()
rows = cache.memcache ('q1', lambda : q1(query))
t1 = time.time()
rows2 = cache.memcache('q2', lambda: q2(query))
rows2 = [r for r in rows2 if (r.end_point.gathered_on -
r.start_point.gathered_on
so, q1 is now always faster than q2 ... seems that the bits you were
missing are in fact the ones that auto-set the cache-key based on the query
string
cache.ram is always faster than anything else, cause it stores a pointer to
the result, doesn't have to pickle/unpickle the result and
Just one question, were you able to get the results in the grid as :
ROW1 -- Editable (means showing view, delete and edit buttons)
ROW2 -- Non Editable (means showing only view button)
ROW3 -- Non Editable (means showing only view button)
ROW4 -- Editable (means showing view, delete and edit
Do you get any errors in the console? That's the first place I usually
look...
On Sunday, March 24, 2013 8:42:45 PM UTC-4, Nate wrote:
Hi
I have a controller sending JSON to my view. I cannot get the data into
the TreeGrid. The Json is coming down correctly (I placed it manually and
it
Hi all,
I have a problem which only happened in IE (I tested IE9, firefox, chrome).
To reproduce the problem, open the following sample web page in IE browser.
When the mouse hover on the table, the whitespace between scrollbar and
table border will keep increase. This will only happen at the
Do you use the Turnkey service?
https://hub.turnkeylinux.org/amazon/launch/web2py/
Is it manage the database too?
Em sábado, 9 de fevereiro de 2013 18h02min06s UTC-2, samuel bonilla
escreveu:
Amazon EC2 is a web server, highly scalable and secure.
recommend
This installation is easy, is a
it's kinda an old-ish config ... apache, mysql, 1.99.7
On Monday, March 25, 2013 2:33:13 PM UTC+1, marlus araujo wrote:
Do you use the Turnkey service?
https://hub.turnkeylinux.org/amazon/launch/web2py/
Is it manage the database too?
Em sábado, 9 de fevereiro de 2013 18h02min06s
As I understand it, the table does not have to exist when using the
'reference sometable' syntax. Or anyway that's how it's supposed to work.
I'm not 100% confident in it, though so I always make it a practice to
create the reference tables first.
On Monday, March 25, 2013 6:31:16 AM UTC-4,
In your function you can do db.whatever_table._enable_record_versioning()
. Record versioning is automatic on update so you can still use your
original onupdate callback.
check here and search for 'archive'
http://web2py.com/books/default/chapter/29/06
On Monday, March 25, 2013 4:27:01 AM
My vote would be for validators :)
Mart :)
--
---
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
yeah, now i'm using web2py 2.4.5 + nginx on ubuntu server configured with
autoscaling , this is my app www.foxter.co
2013/3/25 Niphlod niph...@gmail.com
it's kinda an old-ish config ... apache, mysql, 1.99.7
On Monday, March 25, 2013 2:33:13 PM UTC+1, marlus araujo wrote:
Do you use
Dear all,
I started to use scheduler. I've created a simple starting example task:
https://github.com/ilvalle/scapp/blob/master/models/scheduler.py
and with the great niphlod's plugin cs_monitor_plugin I created an initial
repetitive task.
However, although I set repeats: 0 and period: 300,
I think the period starts as the last execution ends.
Sometimes I miss the feature to start the task exactly at fixed interval
rater than fixed interval starting after the last run ends but I can live
without it. :) It's a great tool anyway :-D
2013. március 25., hétfő 16:23:56 UTC+1
Accordingly to the book
http://web2py.com/books/default/chapter/29/04?search=scheduler#Scheduler-(experimental)
It doesn't start when the previous task ends but when the previous task
starts instead.
Paolo
2013/3/25 szimszon szims...@gmail.com
I think the period starts as the last execution
My bad. Never looked closely :(
Than my guess is that the scheduler is exec the task at some point after
the next run time and the actual running time is a base of the next run
time not the original (first) intended run time.
2013. március 25., hétfő 16:42:04 UTC+1 időpontban Paolo valleri a
Hi all,
I did a form with SQLFORM.smartgrid that searchs a list of verbs. It is
working fine but the area of research in the SQLFORM.smartgrid is
automatically set with in setting and I should like have startswirh
by default.
I explain:
With can I have a list of words like this cantar,
I want to create a query object with multiple constraints, just like adding
commas in the WHERE clause of an sql query. I tried the intuitive
constraint1 and constraint2 but it just took constraint2 and ignored
constraint1 (probably because the key word and isn't overridden and when
applied to
On 25 Mar 2013, at 9:13 AM, David Ripplinger dale...@gmail.com wrote:
I want to create a query object with multiple constraints, just like adding
commas in the WHERE clause of an sql query. I tried the intuitive
constraint1 and constraint2 but it just took constraint2 and ignored
Thank you, that works! Along the same line, would we then use ! or ~
for not, and | for or? Do you know if this is documented in the book or
is it only documented in the code/API?
If Massimo reads this, I would suggest that an eventual feature to add to
web2py is for query objects to allow
The scheduler is not as precise as you would because there are some
design considerations to think of
The uber-costraint is that a worker can execute only one task at a time
-- if the scheduler is busy with something else, queued tasks can be
delayed down the line
If the worker is free,
On 25 Mar 2013, at 9:30 AM, David Ripplinger dale...@gmail.com wrote:
Thank you, that works! Along the same line, would we then use ! or ~ for
not, and | for or? Do you know if this is documented in the book or is it
only documented in the code/API?
It's definitely in the book. Look for the
That's mentioned in the book as well; Python doesn't support overloading
those operators.
I do remember reading that in the book.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving
I'd rather store the dates in the database in local time with the offset
stored (ie take out the [:19]).
On Sunday, March 17, 2013 7:31:24 PM UTC-7, Massimo Di Pierro wrote:
I was looking at code to detect the user timezone and store dates
consistently in UTC format.
I made some changes in
Hi guys!
In recent days we have developed an application to create crowdfunding
platforms
(Like KickStarter, IndieGoGo, etc.) with web2py.
Our inspiration was another open source application called Catarse,
developed in ruby, here in Brazil also.
It already has the default functionalities
Add a vendor-specific tag for IE...
-ms-overflow-x: scroll;
the scrollbar will appear when there is overflow on the X, all the other
browsers will have the 'auto'.
On Monday, March 25, 2013 6:18:25 AM UTC-7, Mark wrote:
Hi all,
I have a problem which only happened in IE (I tested IE9,
Ok, I found it in the book. For any who might come across this post and be
wondering where it is, it is not actually under the Queries section. It is
in a subsection of Select, under the heading Logical Operators (in the
chapter on the Data Abstraction Layer):
Pretty neat, one issue. Clicking the 'back' button on the scroller causes
the 'try it' button to bounce off the right side then plop back in the
proper place. Also, it does not reset the scrolling timer, so if you click
'back' before it's going to switch to the next one, it goes back then
Hi Derek,
Thanks for the feedback, I will fix it in the website, the app is here:
http://chipincode.com/chipincode
2013/3/25 Derek sp1d...@gmail.com
Pretty neat, one issue. Clicking the 'back' button on the scroller causes
the 'try it' button to bounce off the right side then plop back in
Hi!
Why this does not work:
Field('image', 'upload', requires=IS_NOT_EMPTY(), uploadseparate=True,
autodelete=True,),
Field('image_filename', readable=False, writable=False, compute =
lambda row: row.image.filename),
Using a form I can follow the book and fill the image filename:
if
Derek,
It is a great solution. Thank you so much! I hope this -ms-overflow-x:
scroll; should be included in SQLFORM.grid by default.
Mark
On Monday, March 25, 2013 1:49:03 PM UTC-4, Derek wrote:
Add a vendor-specific tag for IE...
-ms-overflow-x: scroll;
the scrollbar will appear when
Hello,
I try the Martìn plugin works great! Need translation though... I like
the idea it use the comment instead of requiring widget= because it leave
you with the possibility to have a widget and the modal add new record...
But it doesn't work properly combining the Martìn modal plugin and
file a bug for it, so it gets tracked. ...
On Monday, March 25, 2013 8:01:18 PM UTC+1, Mark wrote:
Derek,
It is a great solution. Thank you so much! I hope this -ms-overflow-x:
scroll; should be included in SQLFORM.grid by default.
Mark
On Monday, March 25, 2013 1:49:03 PM UTC-4, Derek
your original query retrieves only 3 rows, not the last 3 rows for each
capitulo
On Saturday, March 23, 2013 7:14:01 PM UTC+1, Tito Garrido wrote:
Yes, you got it...
On Sat, Mar 23, 2013 at 9:33 AM, Niphlod nip...@gmail.com
javascript:wrote:
so, you want the last 3 capitulo rows,
You can use this:
Field('image_filename', readable=False, writable=False, compute = lambda
row: request.post_vars.image.filename),
On Monday, 25 March 2013 13:28:19 UTC-5, Tito Garrido wrote:
Hi!
Why this does not work:
Field('image', 'upload', requires=IS_NOT_EMPTY(),
beware that the offset is NOT the same thing as the timezone (DST adds
another layer of complexity)
On Monday, March 25, 2013 6:40:26 PM UTC+1, Derek wrote:
I'd rather store the dates in the database in local time with the offset
stored (ie take out the [:19]).
On Sunday, March 17, 2013
Hi, given the fact that I left untouched the heartbeats value and that my
worker was performing only the test task, I got odd starting values:
t1: 2013-03-25 15:34:43
t2: 2013-03-25 15:40:48 ( t2 started after 6m + 5s = 365seconds )
t3: 2013-03-25 15:46:52 ( t3 started after 6m + 4s = 364seconds
Worked! It should go to the book :)
http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename
Thanks!
Tito
On Mon, Mar 25, 2013 at 4:53 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
You can use this:
Field('image_filename', readable=False, writable=False,
can't reproduce the issue, even with SQLite.
Using the demo1() function from the w2p_scheduler_test app, if I schedule
it with period=300, repeats = 0, this is what I get back
r1: 2013-03-25 21:32:56
r2: 2013-03-25 21:38:12 -- 316s
r3: 2013-03-25 21:43:28 -- 316s
r4: 2013-03-25 21:48:31 --
My task is available here:
https://github.com/ilvalle/scapp/blob/master/models/scheduler.py
As you can see the difference is related to the external request. Asap I
will try your app too.
Paolo
2013/3/25 Niphlod niph...@gmail.com
can't reproduce the issue, even with SQLite.
Using the
Hi,
I got two tables which reference each other. to do that I added a third
called reference_image
db.define_table('Images',
Field('Title',length=1024),
Field('Image','upload'),
Field('thumb','upload',writable=False,readable=False),
Field('Source',db.Source,
Hi guys !
I am new to web2py and I want to make a simple scheduler which could
implement the following tasks:
1.Schedule events/tasks
2.Marking tasks as done.
3.Views to view tasks/events for this day/week/month (default by day)
4.Multiple users can register and make an account on the website to
Just wanted to share, it looks like Web2Py is finally on the pycharm 3
roadmap. Article was posted today:
http://confluence.jetbrains.com/display/PYH/PyCharm+3.0+Roadmap
def register():
form=SQLFORM.factory(db.client,db.address)
if form.process().accepted:
id = db.client.insert(**db.client._filter_fields(form.vars))
form.vars.client=id
id = db.address.insert(**db.address._filter_fields(form.vars))
response.flash='Thanks for
I don't think that's the issue cause next_time_run gets calculated from the
start_time of the previous task, i.e. if I put time.sleep(60) in demo1(), I
still get the same execution times...
The only bit missing at this point is remembering that if you have a single
worker it can't ASSIGN a new
I didn't get your point, with one repetitive task, should I start the
scheduler with two or more workers? If so, I will try it.
Actually I have just seen the stop time, on average the task completes it
cycle in just a few seconds (~1-2). Given that, is what you have suggested
still valid?
Last
Nothing in the console. Firebug reports
No Javascript on this pageIf script tags have a type attribute, it
should equal text/javascript or application/javascript. Also scripts
must be parsable (syntactically correct).
On Monday, March 25, 2013 11:15:31 PM UTC+11, Willoughby wrote:
Do you
On Monday, March 25, 2013 10:46:12 PM UTC+1, Paolo valleri wrote:
I didn't get your point, with one repetitive task, should I start the
scheduler with two or more workers? If so, I will try it.
The point is that the thread that manages some logic every heartbeat
seconds is the one in
I opened a ticket at
http://code.google.com/p/web2py/issues/detail?id=1406start=100
Thanks
On Monday, March 25, 2013 3:46:04 PM UTC-4, Niphlod wrote:
file a bug for it, so it gets tracked. ...
On Monday, March 25, 2013 8:01:18 PM UTC+1, Mark wrote:
Derek,
It is a great solution. Thank
:-)
On Monday, 25 March 2013 14:57:38 UTC-5, Shawn McElroy wrote:
Just wanted to share, it looks like Web2Py is finally on the pycharm 3
roadmap. Article was posted today:
http://confluence.jetbrains.com/display/PYH/PyCharm+3.0+Roadmap
it works well, i define db.booking._enable_record_versioning() on
models/db.py and replace onupdate=auth.archive with the other function on
controller. thank you very much for your hint cliff.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users
it can, yesterday i've already tested it, i'll share the code when i'm at
the office.
--
---
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
Here's a bit of javascript that will create a calendar for you... it won't
offset the date by the day number, but it's a start anyway...
html
head
style
.calendarDay
{
width: 100px;
float: left;
}
/style
script
var monthStart = new Date(2013, 3, 1);
var monthEnd = new Date(2013, 3 + 1, 1);
var
Sorry, you are right, the :19 strips off the timezone. DST isnt an issue
with the timezone since you have EST / EDT or whatever you time changers
use.
On Monday, March 25, 2013 12:54:21 PM UTC-7, Niphlod wrote:
beware that the offset is NOT the same thing as the timezone (DST adds
another
Agree with it. According to my practice empty can table can be referenced
and the dropdown list is created by without any item. By defining the
referenced tables first does solve my problem.
在 2013年3月25日星期一UTC+8下午10时48分02秒,Cliff Kachinske写道:
As I understand it, the table does not have to
Sorry to bump this up, but I have not been able of using unique as it is
described here (no validators).
Also I have tried to use instead of unique IS_NOT_IN_DB as in this other
thread is suggested:
good news.
El lunes, 25 de marzo de 2013 14:57:38 UTC-5, Shawn McElroy escribió:
Just wanted to share, it looks like Web2Py is finally on the pycharm 3
roadmap. Article was posted today:
http://confluence.jetbrains.com/display/PYH/PyCharm+3.0+Roadmap
Dear Massimo, i have tried those methods from the articles suggested by you
previously. However I am still getting the same error.
I have also tried to copy the Serial folder from python2.7 dist-packages
to web2py site-packages. the result is still the same.
Bellow is the detail of the error
Finally this is great news!!!This is one of the missing puzzles of the
treasure of web2py!!!
On Tue, Mar 26, 2013 at 4:43 AM, samuel bonilla pythonn...@gmail.comwrote:
good news.
El lunes, 25 de marzo de 2013 14:57:38 UTC-5, Shawn McElroy escribió:
Just wanted to share, it looks like
83 matches
Mail list logo