Hi All,
I have a table with Field('image1', type='upload', uploadseparate=True,
autodelete=True), If the file uploaded is missing (because deleted by hand
for example) then I would get this error trying to delete a row
>>> db(db.service.id==1).delete()
Traceback (most recent call last):
File ""
Hi I got A table for articles on my page wich contains a variable for the
date it was submitted and the number of views (content title...)
I tried to do a select which gives me the newest five of this table
(orderedby=~article.date) Now I want to sort those five by the number of
views.
I tried i
Hello list,
Would anyone have an idea on how to accomplish reverse ajax ("server
push") on free hosting like fluxflex/pythonanywhere?
If I'm correct, typical "comet" libraries require special web servers,
so that is probably out of the question on typical free hosting sites.
For my own educ
On 05/13/2012 12:02 AM, Andrew wrote:
> Does replacing select with delete work?
Nope, i got:
TypeError: delete() got an unexpected keyword argument 'join'
It seems that delete does not accept any argument at all!
Yeah. I want to delete from db.keyword
If delete was more like select() would b
Alec,
The database depends on what data you store and serve. It depends on your
model. Postgresql is pretty generic and scales (Skype use postgresql).
web2py has all the required layers for your requirements and scales: just
put nginx in front of scgi, uwsgi, fcgi and use processes not threads.
>
> db((db.keyword.id!=db.users_keywords.keyword_id)&(db.keyword.dictionary==dictionary)).delete(db.keyword)
>
>
>
Exactly what set of records are you trying to delete from db.keyword? Are
you trying to identify keywords that are not referenced by any records in
db.users_keywords? If so, how
Thanks, I'll give Postgres a go.
Quick semi-related question: have their been benchmark comparisons on
recent versions on Django when compared with recent version on web2py?
E.g.: for requests per second, processing time &etc
On Sun, May 13, 2012 at 10:47 PM, Michele Comitini
wrote:
> Alec,
>
>
orderedby=~db.article.date|~db.article.views
should work. Did you try exactly that code?
Anthony
On Sunday, May 13, 2012 4:43:24 AM UTC-4, BlueShadow wrote:
>
> Hi I got A table for articles on my page wich contains a variable for the
> date it was submitted and the number of views (content tit
def index():
rows=db().select(db.article.ALL, orderby=~db.article.submitted|~db.
article.views, limitby=(0,5))
return dict(Articles=rows)
Thats my code from the default.py
removing and adding the second ~ doesn't change anything.
in my index.htm I simply print the Titles and vi
>
> Quick semi-related question: have their been benchmark comparisons on
> recent versions on Django when compared with recent version on web2py?
>
I'm not aware of any benchmarks directly comparing Django and web2py. If
you were to make a comparison, you would have to be careful to make sure
Hmm, I tried a similar query and it properly respects both ~'s. Can you
pack and attach a minimal app (using SQLite) that exhibits the problem?
Anthony
On Sunday, May 13, 2012 9:14:27 AM UTC-4, BlueShadow wrote:
>
>
> def index():
> rows=db().select(db.article.ALL, orderby=~db.article.subm
On Sun, 13 May 2012 06:21:17 -0700 (PDT), abasta...@gmail.com said:
> I suspect there wouldn't be much difference in performance
> between the two frameworks (similarly and properly configured).
So long as this is broadly true (which I suspect it is), there are other
considerations to take into
I've always liked the idea of controllers as classes, allowing for
subclassing of controllers, and thereby providing an easy means of handling
common controller functionality. I'm curious as to why web2py didn't follow
this approach? Is there a recommended way of handling code that is common
to
what about using modules ? you can create as many classes as you want and
then just use them.
On Sun, May 13, 2012 at 5:31 PM, Yarin wrote:
> I've always liked the idea of controllers as classes, allowing for
> subclassing of controllers, and thereby providing an easy means of handling
> com
You can put common controller functionality in the model. This is executed
on each request before the controllers. You can check which controller is
called in request.controller.
On Sunday, 13 May 2012 17:31:22 UTC+1, Yarin wrote:
>
> I've always liked the idea of controllers as classes, allowin
i'm looking for a solution, to start to write a web-app to generate graph using
matplotlib
the graph needs to be generated using some inputs parameters coming from the
page itself.
right now i'm rewriting the app from scratch .. but i'm stuck on how to
integrate a query button to the python
That's what I've already been doing, but making decisions in the model on
which code to run based on the request controller turns into a hot mess of
distributed logic and violates the most basic principles of MVC (Models
knowing about Controllers?)
On Sunday, May 13, 2012 1:58:25 PM UTC-4, simo
Hi,
Does anyone have a scroll problem in online editor in Chrome browser
using the dev build? Whenever I open a file in the online editor, and
if I try to scroll, it scrolls back to the top in Chrome. It works
fine in Firefox.
I am using Chrome version 18.
Thanks.
Hardik Mehta
in Java (say for example Java EE 6), you would have your own Classes
hierarchy (as extended as needed), and then you would inject what you need
in your "controllers" (backing beans)... in web2py you can do exactly the
same. Create your own hierarchy of classes (as extended as needed) and then
just
You can put functions in controller files that any other function in the file
can call.
my routes on_error used on GAE (collects 400 and 500 errors unless GAE
itself throws the error before web2py gets the request):
routes_onerror = [
('/*', '//home/missing.html'),
]
On Friday, May 11, 2012 8:18:11 PM UTC-7, Sushant Taneja wrote:
>
> Yes I did configure the routes_onerror in
Sebastian- I already have class hierarchies for my model/module stuff. What
I'm talking about using classes to handle controller logic- assembling
views, controlling access, processing forms, managing redirection, etc -
that stuff belongs in controllers, not modules. But the flat, one
function-
I'm not sure that query will do what you want. I think you need to sort by
views separately.
Yarin, I see... I know what you mean... I had a quick glance into
compileapp.py line 555... (I guess that it the right place to look at)...
and it looks like that inheritance is not part of it...
filename = os.path.join(folder, 'controllers/%s.py'
> % controller)
how come i have to test an empty string field within a try|except block
like this:
try:
b = q.create_lecture_foldername!=None
except:
b = False
if b:
something
instead of the more straight forward:
if (q.create_lecture_foldername!=None):
something
because if i try the previous simp
Hi All,
I've read a couple of tutorials (probably from web2py slices) about HTML
wysiwyg + images uploading (in separate table)
I was just wondering... what if instead of defining a TEXT field and an
additional table for storing images we define a BLOB field and we store
ALL there HTM
The first numbers to look at are times those are what affect our
lives. The number of calls bother just the cpu ;-)
1. time to complete the action
2. cumulative time i.e. where most of the time affecting 1. is spent
3. percall time i.e. to find if there is a function that is really slow
1. is ar
You can create a new login_method while keeping the auth tables as usual.
The login method will work on the legacy db.
The auth table will contain user data in another db, can be sqlite or
anything else supported by DAL.
Indeed web2py auth tables *do not need to contain secrets*, those can
be kept
not quite possible because each image has an url, a single blob field is
not enough,
except if somehow you will manage to convert all images to base64 at the
time of inserting/uploading
but even so no need for blob, base64 images are represented as text
I use /models as a script folder and I always try to avoid the use of this.
Controllers are for me only a point of entry, the place where I route and
where I got argumuments and I decide about the template rendering.
All the rest of logic goes in sub modules, handlers, helpers and datamodels.
ht
135 tables to run YouAdWorld??
Has anyone come up with a solution to this? Have the same issue.
On Thursday, December 1, 2011 7:08:38 AM UTC+10, haikuvend Resident wrote:
>
> I have downloaded a plugin from http://dev.s-cubism.com/plugin_solidform
>
> It consists of two files:
> - controller/plugin_solidform.py (demo)
> - *mo
Answering my own question here.
Its a path issue.
If you insert the fill path from the applications folder, its found.
On Monday, May 14, 2012 8:08:23 AM UTC+10, Simon Ashley wrote:
>
> Has anyone come up with a solution to this? Have the same issue.
>
> On Thursday, December 1, 2011 7:08:38 AM
Youadworld is HUGE some tables even have 50 columns.
On May 13, 2012 2:59 PM, "pbreit" wrote:
> 135 tables to run YouAdWorld??
do you have __init__.py in your modules and in your app folders?
http://zerp.ly/rochacbruno
Em 13/05/2012 19:35, "Simon Ashley" escreveu:
> Answering my own question here.
> Its a path issue.
> If you insert the fill path from the applications folder, its found.
>
> On Monday, May 14, 2012 8:08:
>
> To cut define_table execution time you could try to put migrate=False,
> fake_migrate=False, when you call the DAL since in production the
> model does not change (usually) at runtime.
>
Yes, definitely turn off migrations -- you can do so for the entire
connection via:
db = DAL(..., mig
How will compiling it effect things as we are actively developing and
adding new features almost daily?
On Sun, May 13, 2012 at 5:17 PM, Anthony wrote:
> To cut define_table execution time you could try to put migrate=False,
>> fake_migrate=False, when you call the DAL since in production the
>>
On Sunday, May 13, 2012 8:37:17 PM UTC-4, Bruce Wade wrote:
>
> How will compiling it effect things as we are actively developing and
> adding new features almost daily?
>
After you make a change, you can just do "Remove compiled" and then
re-compile. You can do it via the admin interface or the
correct.
On Friday, 11 May 2012 23:59:39 UTC-5, Rod Watkins wrote:
>
> Wow, very cool. One question. In the cms app, a page (with an id) already
> exists so the ajax post to the addtag action can add the tag to the page.
> In my case the create version of the form will not have an entity with an
You can still do rows.json() even if you add columns to rows or you change
their values.
On Saturday, 12 May 2012 00:27:49 UTC-5, Franklin Freitas wrote:
>
> If I use what you recommend then what would be the best way to generate
> the JSON output
>
> Thanks Massimo
>
>
> On Saturday, May 12, 20
I think you can already
db.table.insert(**dict())
Are you asking for something different?
On Saturday, 12 May 2012 05:25:02 UTC-5, Francisco Costa wrote:
>
> It works Massimo!
> In MongoDb is also common to insert dicts, can we also have that?
>
> At the moment it only saves in the string fo
Please open a ticket. I do not see what may be causing this. On the other
ise the ID should be Null(None) or >0 else it will break most databases.
On Saturday, 12 May 2012 11:36:06 UTC-5, Eduardo Diaz wrote:
>
> In our work we migrate from version of Web2py from 1.96.4 to 1.99.7, but we
> have t
The new web2py (n trunk) has
request.args(0,default=0,cast=int)
On Saturday, 12 May 2012 13:27:07 UTC-5, Najtsirk wrote:
>
> I'm not too good at this stuff...but i think i had similar problem.
>
> In my controller I set the default value for the crud.create reference
> field:
>
> db.table.refere
Can you post some examples. I could use this myself but I never got a
chance tot try it.
On Saturday, 12 May 2012 13:58:01 UTC-5, Nils Olofsson wrote:
>
> Amazon's S3 is ideal for this, I use it I mount s3 using fuse interface.
> Works pretty well for me.
> Nils
> On May 12, 2012 7:53 PM, "Sebast
Please open a ticket with the traceback. This needs to be fixed quick.
On Sunday, 13 May 2012 03:27:54 UTC-5, sebastian wrote:
>
> Hi All,
>
> I have a table with Field('image1', type='upload', uploadseparate=True,
> autodelete=True), If the file uploaded is missing (because deleted by hand
> fo
Look into gluon/contrib/comet_messaging.py. There is an example in there.
Requires tornado.
On Sunday, 13 May 2012 07:06:49 UTC-5, stefaan wrote:
>
> Hello list,
>
> Would anyone have an idea on how to accomplish reverse ajax ("server
> push") on free hosting like fluxflex/pythonanywhere?
>
>
# useful module
import os, tempfile, random, cStringIO
# setup a temporary working forlder
os.environ['MPLCONfigureDIR'] = tempfile.mkdtemp()
# main matplotlib modules
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
# opt
Hi,
Suppose I have two tables, with a one-to-one relationship:
db.define_table('user', Field('name'));
db.define_table('car', Field('color'), Field('user_id', db.user))
What is the easiest way to create an SQLFORM that would store *correlated*data
in both fields? For instance, create a user with
I'm using the scheduler and everything is working nicely, except that any
calls I make to the db in the task function are ignored- Even though the
tasks complete successfully, there's no error, or any indication from the
worker that something went wrong. This is happening for both MySQL and
SQL
I think you need to db.commit() in the task. Does that solve it?
On Sunday, 13 May 2012 21:20:51 UTC-5, Yarin wrote:
>
> I'm using the scheduler and everything is working nicely, except that any
> calls I make to the db in the task function are ignored- Even though the
> tasks complete successfu
Sorry, figured this out- db calls made with the scheduler need a db.commit()
On Sunday, May 13, 2012 10:20:51 PM UTC-4, Yarin wrote:
>
> I'm using the scheduler and everything is working nicely, except that any
> calls I make to the db in the task function are ignored- Even though the
> tasks co
To me, this is bad idea. You miss out on many of the nice things of
having the images in a table. For example, you can index and search the
images. The database and your server don't have to be hit so hard because
those images are on another server so your pages can load faster.
Attachment
I'm not sure if this is web2py question or javascript related issue.
In an HTML view I am trying to call a subview with a form in it that has a
jquery
autocomplete attached to a text field in the form.
I attach the autocomplete like this in the form view's document ready
function:
$(document)
On 05/13/2012 02:50 PM, Anthony wrote:
> ids = db()._select(db.users_keywords.keyword_id, distinct=True)
> db((~db.keyword.id.belongs(ids)) & (db.keyword.dictionary == dictionary)).
> delete()
>
> Anthony
Thanks a lot!
This is exactly what I was looking for!
--
Vincenzo Ampolo
http://vincenzo
I'd be interested in seeing this controller. Especially the part about
running the unittests.
On Wednesday, 9 May 2012 00:19:07 UTC+3, howesc wrote:
>
> while i would not call anything i have great tests or a wonderful example
> of testing, i have used doctests in controllers successfully. th
55 matches
Mail list logo