environment.
Best,
Ian
On Wednesday, December 5, 2012 4:02:51 PM UTC-5, viniciusban wrote:
>
> Hi monotasker.
>
> I'm starting to run something like that and I'm giving
> gluon/contrib/webclient.py a try.
>
> I intend to prepare an environment to allow runni
I'm trying to use pytest (instead of unittest) to do unit testing for a
web2py app. I've written a script (attached: runtest.py) to launch py.test,
which then finds and executes my test files. I run this launcher script in
a web2py environment like this:
python ~/web/web2py/web2py.py -S pai
;
> On Saturday, 27 October 2012 13:54:49 UTC-5, monotasker wrote:
>>
>> I'm finding it awkward to insert uploaded images into markmin-formatted
>> text because the upload filenames aren't memorable. I see the point of the
>> file renaming. But I think I nee
I'm finding it awkward to insert uploaded images into markmin-formatted
text because the upload filenames aren't memorable. I see the point of the
file renaming. But I think I need some kind of widget that displays the
images in my upload library and will automatically get and insert the
filena
at the usual webdev suspects -- number of file and
image downloads, resolution of image files, server optimization, etc. Good
to know.
Ian
On Thursday, October 4, 2012 3:52:24 PM UTC-4, Niphlod wrote:
>
> Not directed only to monotasker: aren't all you tired of reading
> bench
One thing I'm trying out right now is (a) writing all of my business logic
in module files; (b) breaking up that logic into small-ish classes that
each seem to have with around 5-10 methods each; (c) injecting my
dependencies as much as possible into the class in the __init__ method and
then pa
Has anyone looked at the speed differences between operations performed
with a Storage object and the equivalent object with a dictionary? I wonder
how these would compare?
bob = MyStorageObject.name
bob = MyDictionary['name']
I suspect that the difference with one lookup would be trivial, but
I'm not sure how this would work with the current web2py framework (which
uses static css), but a css pre-processing system like LESS makes the
application of framework classes to your custom html trivial. Twitter
Bootstrap (like many of the other css frameworks out there) provides its
styles i
Thanks very much. I just sent the files to you by email.
Ian
On Thursday, October 4, 2012 8:11:23 AM UTC-4, Massimo Di Pierro wrote:
>
> If you send me the file and the models I will try it.
>
> On Thursday, 4 October 2012 01:16:17 UTC-5, monotasker wrote:
>>
>> I'
I'm trying to set up unit tests and run into this error during the creation
of the test db (using testrunner.py). I've looked at the code of this
method in gluon.dal, but I really don't know enough about csv importing to
know how to debug the error. So any help would be much appreciated.
Here i
t of key:value
>
> condition = {'name': auth.user_id, 'tag': tag}
>
> If the first argument of update_or_insert is not specified the following
> named arguments (tlast_right=time_last_rightm,...) are used to build a
> condition dict.
>
> On Sunday, 30 Sep
In the manual section on update_or_insert() the examples only touch on a
situation where one field/value is given as the matching condition. I'm
wondering what syntax needs to be used if we want to match values on more
than one field. Extrapolating from the manual example, can I do this?
db.t
Sorry, found the problem. I was just missing a comma in the list of tuples
(sheepish grin).
On Thursday, September 27, 2012 11:26:51 AM UTC-4, monotasker wrote:
>
> My site hosted on webfaction started returning a 500 internal server error
> this morning and it looks like it's
My site hosted on webfaction started returning a 500 internal server error
this morning and it looks like it's choking on my routing. What's strange
is that it was all working (with no changes made) for quite a while prior
to this. My server log shows this at the start of the problem:
[Thu Sep
Console means
> "standard output + standard error", you see it only if you're running on
> terminal (unix, mac) or Dos prompt (Windows). That's why usually
> "production" apps log something directly to a file or to a database.
>
> On Thursday, Septemb
Ok, this reveals the depth of my ignorance. The logging.example.conf file
is set up to output logs to "console." What is that? If I'm trying to log
things running on a remote server, where do I access this "console"?
Thanks.
--
Ok, so would I then just have python read the contents of the file and then
unpickle the whole as a single string?
Ian
On Friday, September 14, 2012 2:52:33 PM UTC-4, Niphlod wrote:
>
> it's not hashed, it's pickled.
>
> On Friday, September 14, 2012 7:40:47 PM U
Following on an earlier question of mine, I'm trying to arrange for
persistent data (per user) by writing session data to the db. The trick I'm
stumbling over is how to make sure that the session data that is stored
always represents the end of the most recent user session. It seems to me
like
I'm using github for open-source development of some web2py apps and want
to make sure I'm not exposing any data that would be a security risk. As
far as I can tell, the sensitive pieces of data in a standard app would be:
- email account information (by default in db.py)
- any recaptcha keys (b
Aha! That did it. For the record, on Webfaction an application server is
restarted with $HOME/webapps/app_name/apache2/bin/restart
Thanks for pointing me in the right direction. I'm obviously going to have
to learn a lot more about the server end of things :) But I really
appreciate the help.
lled/package")
>
> Have you restarted web2py since you installed the module?
>
> On Mon, Sep 10, 2012 at 4:52 PM, monotasker
> > wrote:
>
>>
>> I'm having trouble on Webfaction with web2py not finding the pytz module,
>> even though it is found fine in
I'm having trouble on Webfaction with web2py not finding the pytz module,
even though it is found fine in my local environment. I've
already installed the module using easy_install at myname/lib/python2.7 (as
per Webfaction instructions), and I've confirmed that I can import it from
the python
Perfect. Thanks for providing the snippet. I haven't used the cache methods
yet, and this saves me a lot of time.
Ian
On Sunday, September 2, 2012 2:28:14 AM UTC-4, rochacbruno wrote:
>
> I think you can use cache.
>
> user_data = cache.ram("user_data_%s" % auth.user_id, lambda :
> dict(field=v
on?
>
> Anthony
>
> On Saturday, September 1, 2012 12:38:47 PM UTC-4, monotasker wrote:
>>
>> I'd like my app to preserve a "state" for each user for 24-hours, even if
>> s/he
>> - logs out and back in
>> - switches browsers
>> - switches IP
I'd like my app to preserve a "state" for each user for 24-hours, even if
s/he
- logs out and back in
- switches browsers
- switches IP (i.e., uses a different device)
What would be the best way to do this?
I'm already using the session object to preserve state in the app. So I was
thinking th
Do you know how to set the admin password? I tried entering my webfaction
dashboard password but it didn't work.
Ian
On Wednesday, July 4, 2012 11:42:24 AM UTC-4, kokoyo wrote:
>
> hi, i have been using webfaction, you can do these step to get w2py admin:
> on the left menu: Domains/Website
>
UTC-4, Massimo Di Pierro wrote:
>
> Looks like there is a patch pending about this.
> On Wednesday, 4 July 2012 09:58:47 UTC-5, monotasker wrote:I will review
> it asap.
>
> Am I right that the Markmin syntax still doesn't implement nested lists?
>> Has anyone foun
Am I right that the Markmin syntax still doesn't implement nested lists?
Has anyone found an easy workaround for this? I'm building a presentation
(slideshow) component and would like to use Markmin, but I need more depth
than a flat list.
Thanks.
get='mycomponent')}}
>
> jQuery(function() {
> jQuery('#mycomponent').ajaxSuccess(function(e, xhr, settings) {
> if (settings.url == '/default/mycomponent.load') {
> jQuery(this).doSomething();
> };
> });
> });
>
>
>
I'd like to be able to bind a jquery function to a div that is the
container for a web2py component, so that when the component content is
updated by the controller the jquery function is triggered. But I'm not
sure whether there is a stock event that would cover the component refresh
(I don't
ΟΚ, that's very helpful. Thanks once again.
On Friday, June 1, 2012 1:14:08 PM UTC-4, Anthony wrote:
>
> X
>>
>
> That would have to be _onclick, not _href, and you'd want to add something
> like "; return false" at the end to prevent the usual link behavior.
> Anyway, I suggested an alternative
Thanks, Anthony, and sorry for spreading misinformation. I just re-read the
book section and found where I'd been confused. So it looks like Johann
simply needs something like this for each row in his view:
X
Then to refresh the component after the controller runs, he would just
return "web2py
The :eval method of the ajax() function requires that there is a form field
holding the value to be sent by ajax. So in your view you could just
include in INPUT() helper somewhere on the page and hide it via css. Then
when the "remove row" link is clicked, your could use js to:
- set the input
I have a db field that holds a regular expression (one unique regex for
each row in the table). Another row in the table
(db.steps.readable_response) lists sample strings that should satisfy the
regex. I'm trying to create a custom validator that tests the regular
expression against the sample
I'm trying to use the recipe on p. 142 of the web2py cookbook (Uploading
files using a LOADed component) and I'm wondering if there's an error in
the replacement web2py_trap_form function. Line 4 of the replacement
provides an 'if' condition with no statements following (no { } at all). Is
this
Yes, that was it. Thanks.
Ian
On Tuesday, May 8, 2012 1:34:30 PM UTC-4, Anthony wrote:
>
> It's probably being cached by the browser, so you may need to clear the
> browser cache (simply refreshing the page won't do it).
>
> Anthony
>
> On Tuesday, May 8, 2012 1:1
I'm working on a js file that resides in appname/static/js/ but for some
reason it seems to be cached. When I refresh the browser (even if I restart
the local web2py server) the page continues to load an old version. I
develop largely with custom modules, and those files are refreshing just
fin
Thanks very much for doing this. Have you considered putting it in a github
repo so that it's a bit easier to use and fork?
Ian
On Sunday, May 15, 2011 5:44:42 PM UTC-4, pancurster wrote:
>
> Hi,
> I was looking today for vim syntax for web2py templates but I didn't
> find it. So I make my own
I want to float a proposal for plugin infrastructure that I'd love to see
made part of the web2py core. It takes a bit of explanation, so bear with
the long post.
I'm starting to find that the syncing issue is a major one with the
(otherwise great) plugin infrastructure. I have a growing series
stalled
via repository.
Ian
On Thursday, April 5, 2012 6:53:36 PM UTC-4, monotasker wrote:
>
> I'm trying to set up unit testing using testRunner.py as laid out here:
> http://www.web2pyslices.com/slice/show/1465/unittesting-doctesting-and-userinterface-testing
>
> . Wh
I'm trying to set up unit testing using testRunner.py as laid out here:
http://www.web2pyslices.com/slice/show/1465/unittesting-doctesting-and-userinterface-testing
. When I run the tests I'm getting this error:
AttributeError: 'thread._local' object has no attribute 'app'
This is fixed if I
No, I hadn't seen that. Thanks Anthony.
Ian
On Tuesday, April 3, 2012 4:56:54 PM UTC-4, Anthony wrote:
>
> I'm coming at things backwards (as usual) and just now looking at writing
>> unit tests for a couple of apps I'm working on. The most recent forum
>> discussion of unit testing in general
I'm coming at things backwards (as usual) and just now looking at writing
unit tests for a couple of apps I'm working on. The most recent forum
discussion of unit testing in general seems to be about a year old and
references an appliance in web2py_utils as the most complete solution to
that po
I ran into analogous problems with sqlite on fluxflex. If you have a
working local version of the app, would it be simplest to just
re-initialize the fluxflex repo (and mysql db) and then push a fresh
version of the app to the fluxflex repo?
I have found that, in general, it doesn't work very w
et, RadioWidget, and CheckboxesWidget classes to
> generate options for SQLFORM fields. That's probably why it's not
> documented in the book.
>
> Anthony
>
> On Saturday, March 31, 2012 12:25:50 PM UTC-4, monotasker wrote:
>>
>> Maybe it's just me,
Just found another very handy one: field.requires[0].ktable (provides the
linked table name for a db reference field)
On Saturday, March 31, 2012 12:25:50 PM UTC-4, monotasker wrote:
>
> Maybe it's just me, but one of the things I find most confusing as I work
> with web2py is fig
Yes, and my frustration with the push toward node.js is that it seems to
come in part from the "I learned js for webdev and I don't want to bother
learning another language" impulse. I also think that's part of the
motivation behind pushing everything client-side (i.e. into the browser).
But I
Yes, stats like this can be deceiving when automated queries are used. One
of my web2py projects on github is categorized as "C" rather than python or
javascript! I can only assume this is because I have the lxml library in
there (?) But I've never written a line of C in my life, and it certainl
Maybe it's just me, but one of the things I find most confusing as I work
with web2py is figuring out what properties and methods each object has.
For example, I just learned that field.requires can have an options()
method that outputs a list of tuples for the options available in a
reference
I'm not convinced that the stats you cite about Python are statistically
meaningful over a one-year period (2.45% decline?). But it seems to me that
on the web the key issue is browser integration. JavaScript is the default
language of the web because browsers all interpret it internally. PHP,
OK. That makes sense. A bit frustrating, though, that the Mozilla apps are
limited to js. I guess that's why I keep developing for the web--it's still
the only truly cross-platform environment with any kind of muscle in the
back end.
On Saturday, March 24, 2012 3:49:36 PM UTC-4, Anthony wrote:
Yes, I think web2py can already produce a self-contained local app running
from the rocket server. At least I think there was a recipe for that in the
last edition of the book (I haven't looked in a while).
The issue of web2py being 'thick' for the purpose is very much what I was
wondering abou
As I suggested to Derek, I think I've caused some confusion by not being
clearer in my original question. I'm not thinking about client-only
web-apps. I'm thinking about locally installed apps that use an html5
front-end. This is what win8 is promoting, and that's also the thrust of
Mozilla's a
> are looking for. The way I see it, I would not want Web2Py turning into
> another Pyjamas. Pyjamas has it's place, Web2Py has it's own place, and
> remember one of the keys to Web2Py is DRY.
>
> On Friday, March 23, 2012 3:34:27 PM UTC-7, monotasker wrote:
>>
&
would not want Web2Py turning into
> another Pyjamas. Pyjamas has it's place, Web2Py has it's own place, and
> remember one of the keys to Web2Py is DRY.
>
> On Friday, March 23, 2012 3:34:27 PM UTC-7, monotasker wrote:
>>
>> Right. For something as simple a
ript templates.
>
> The only advantage you'd get with an app like this is you can use it while
> you are disconnected from the network.
>
> But what would be better is to rewrite it so it will retrieve the rss
> feeds directly. Then you don't need the web2py piece at
I've been struck by the huge push lately for 'html5 apps' as a (partly)
cross-platform approach to mobile and desktop development. Now win8 is
integrating html5+js heafily into the desktop and the Mozilla app project
is pushing in a similar direction. In many ways I think it makes sense (I
find
I may be off target but I just recently noticed the .as_dict() method for
rows objects. This converts the rows object to a regular dict (instead of a
gluon storage object) which can be stored in session or cache (i.e., it's
picklable). If you need the query (not the resulting rows object) to be
I think I understand a bit what you mean about not feeling like you
understand the "guts" of web2py at first. The book wants to walk you
through app-building before introducing you to much of the core, even
conceptually. I think this is actually a good pedagogical move for lots of
people, but f
This makes frameworks like Twitter Bootstrap even more attractive if they
get us part of the way there.
On Tuesday, March 20, 2012 8:14:26 AM UTC-4, rochacbruno wrote:
>
>
> Useful information, worth reading it!
>
> http://www.w3.org/TR/mwabp/
>
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com
find() to fiter that rows.
>
> On Thu, Mar 15, 2012 at 5:55 PM, monotasker wrote:
>
>> I had a nice query set up and working that looked for any match between
>> items in a list and records in a list-reference field:
>>
>> catXtags = [2,4,6,7,9]
>> curr_lo
I had a nice query set up and working that looked for any match between
items in a list and records in a list-reference field:
catXtags = [2,4,6,7,9]
curr_loc.id = 6
db((db.paths.tags.contains(catXtags)) &
(db.paths.locations.contains(curr_loc.id))
I changed db.paths.tags to be a virtual f
ght_sidebar_enabled: right_sidebar_style = 'style="display:
> block;"'
> else: right_sidebar_style = 'style="display: none;"'
> style_content = 'style="width: %s"' % width_content
> }}
>
>
> <scrip
Can you post the parts of your css code that aren't working?
Ian
On Sunday, March 11, 2012 7:39:42 AM UTC-4, frasse wrote:
>
> Hi
>
> I like to use my custom css and add it to my application base.css mess
> my application. I have remove base.css and move classes .flash
> and .error to my cust
That does it. Great! Was this in the book somewhere?
Ian
On Monday, March 12, 2012 2:08:18 PM UTC-4, Martin.Mulone wrote:
>
> I think you can do:
>
> (T('my item'), True, A('My item', _href=URL('default', 'index'), _class =
> 'my_it
I want each of my app menu items to have a distinct class to ease theming
(I'm using background images to provide icons in place of text). It looks
like the MENU helper doesn't allow _class arguments in the items in
response.menu. So I can just modify the MENU helper, but am I missing some
way
you read it
> carefully.
>
> http://web2py.com/books/default/chapter/29/9#Authorization-and-CRUD
>
> Your is_member =
>
> auth.has_membership(group_id, user_id, role)
>
> *
> *
>
> *
> *
>
> Does it help?
>
> Richard
>
> On Mon, Mar
In digging through the discussions here I've come across two auth methods
that allow for checking a user's authorization:
auth.is_logged_in()
and
auth.has_permission()
These are really useful, but aren't documented in the web2py book (They're
used a couple of times in other recipes, but the
gt; window.parent.web2py_component("/paideia/exploring/index.load","page")
>
> Anthony
>
> On Wednesday, February 22, 2012 5:18:15 PM UTC-5, monotasker wrote:
>>
>> I'm using an svg image as a navigation map, with areas that can be
>>
I'm using an svg image as a navigation map, with areas that can be clicked.
I've got the interactivity working via an external javascript, but when I
try to call web2py_component() I get an error telling me that
web2py_component is not defined. I assumed that I could call it since this
script i
Thank you sooo much! I never would have figured that out. I really
appreciate your help.
Ian
OK, I'm trying to create a generic controller function that will list the
rows in a table, representing each row using a flexible format that can be
user-defined (this is all for a plugin to provide a list-and-edit-records
widget).
My testing model includes this table definition:
db.define_tab
Is the problem with passing db to the module function? I got tripped up
until I realized that "current" objects needed to be retrieved *within the
function* (i.e., after "def myindex()"). Here you seem to be passing the
"current" objects as arguments to the function. I don't know whether that
w
I haven't been able to figure this out: I want to use the "format"
representation defined in my db model to represent the rows in a list of
query results. In other words, I'd like to be able to do something like
this:
rowlist = []
q = db(db.mytable.id > 0).select()
for r in q:
rowlist.appen
I'm using a lot of custom plugins to allow re-use of code across several of
my web2py apps. But since the plugins are in a state of constant updating,
it's getting to be a pain to keep them all in sync. I use git for version
control (one repo for each app) and for deployment (on Fluxflex). I've
Great. Thanks again. I really appreciate your help.
Ah. Now I understand. Thanks a lot for explaining. Sometimes it's the
basic structural things I miss!
That's good news. I'm a bit confused, though, since it doesn't seem to be
the default widget for list:reference fields, which are presented by
default in a multiple select widget (or does list:reference not fall under
list:?).
Also, the list widget isn't included in the list of available widget
I'm continuing to work in fits and starts on my ajaxselect plugin (I'll
post an update and bugfix soon, hopefully with a proper demo). In the
process, I came across the ListWidget method in sqlhtml. It's quite a nice
way to implement multi-reference field. But it's not documented in the 4th
edi
I suppose I could! But I'd like to understand the underlying issue -- why
the form seems to submit blank when the component loads (hence the else
condition firing).
I include a comments plugin in my main view:
{{=plugin_comments()}}
That plugin calls this controller:
#checks to see whether hidden 'honeypot' field has any text in it
(presumably placed there by a bot)
def checkfilter(form):
form.vars.filter = request.vars.filter
if form.vars.filter =
In a few different places I'm finding that a SQLFORM form loaded in a
component is submitted automatically when the component first loads. It
doesn't pass the if form.process() test, and it doesn't throw errors, so I
get whatever the "else" condition is in the form submission process. Does
anyo
OK, in that case maybe the book example should be changed since the code
doesn't quite work as given on p. 331.
I'm trying to add a hidden form to a SQLFORM using the sample code on p.
331 of the 4th edition book (pdf):
form.vars.a = request.vars.a
form = SQLFORM(..., hidden=dict(a='b'))
When I submit the form, though, I get an error because I'm calling the
variable 'form' before assignment. If I reverse
Thanks. I think I'll try the honeypot (hidden field) approach and see how
successful it is.
Thanks Benjamin. That sounds quite simple.
I'm about to deploy a simple blog platform for myself and have implemented
comments using something very much like Massimo's example in the components
chapter of the web2py book. What I'm wondering about, though, is spam
control. At the moment I think I'm just going to activate recaptcha for the
Well, I heard back about plugin development and it turns out that plugins
can only be written in Java. That rules me out. I'm still trying to get my
mind around Python. But the plugin API is available at
http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment if you or
anyone else wan
Yeah, I'm not sure either. And I'm not sure it matters as much as having
good interactions going forward.
In case anyone else runs into a similar problem, it turns out that I was
handling DAL and Crud improperly in the modules I was trying to import. For
db, I added this in db.py right after the initial definition of db:
current.db = db
Then in my model, in any function that used db, I could just r
I'm moving a whole bunch of (perfectly functional) business logic from
model files to custom modules. But when I try to import the modules in my
controllers custom_import is throwing an error. Here's the traceback:
File "/home/ian/web2py/gluon/restricted.py", line 204, in restricted
exec c
Well, I'd really like to use pydev, but I just find that it's too resource
intensive. I do a lot of work on a souped up netbook and eclipse *really*
churns. PyCharm is a Java application too, but it positively sings beside
eclipse. I'm generally really committed to open source (I eat sleep and
Sorry for the delayed response. I'm going to have to ask them about docs. I
haven't found them in the obvious places.
I had an email exchange over the last couple of days with a developer at
Jetbrains who works on PyCharm. The bad news is they've chosen not to work
on web2py integration any time soon. The even worse news (from my
perspective) is that they seem to have a very negative impression of the
web2py c
Great! Thanks!
I have a function in which I have two table names 'db.A' and 'db.B'. There
is a field in db.A that links to the id field of db.B. But I don't know
what that linking field is called in db.A. Is there a way to find this out
programmatically?
(This is the last nut to crack before I can release the
Thanks, Bruno. I've been writing this for an app that isn't finished yet,
but I'll try to at least get some screenshots up soon.
And thanks, by the way, for all your coaching as I've been learning web2py.
I need to add a "thanks" section to the README.
I forgot to add that the one dependency of this plugin is jquery-ui (for
the dialog). I'd be interested to know what people think of this. Should I
write a little dialog script of my own so that there are no external
dependencies, or should I avoid reinventing the wheel and use jquery-ui?
le as
selectable options. You can download or clone the file from the github
repository: https://github.com/monotasker/plugin_ajaxselect
In one sense this is a duplication of the "select_or_add" module that has
been available on web2py slices. Under the hood, though, they are quite
different
OK, I found the problem. I wasn't actually returning the
OptionsWidget.widget object during form creation. I was returning a LOAD
helper which then inserted the OptionsWidget.widget object at a second
stage. It looks like the accepts() method looks at the *widgets returned
during form building*
1 - 100 of 179 matches
Mail list logo