how about this instead?
# fix
re.compile('^(?P[^:@]*)(\:(?P[^@]*))?@(?P[^\:/]+)
(\:( ?P[0-9]+))?/(?P[^\?]+)(\?(?P.*))?
$').match(uri)
# end fix
if not m:
raise SyntaxError, \
"Invalid URI string in DAL: %s" % uri
user = credential_decoder(
I have a pending patch for per-user last. it is in my todo list
On Nov 1, 10:32 pm, Eli Collins wrote:
> I'm coming slightly late to this thread, but wanted to add a note...
>
> > If we did implement this approach, the next question is, could we also
> > implement a scheme whereby if the algo
yes please!
On Nov 1, 10:13 pm, Andrew wrote:
> I am currently re-reading the book since version 3.2 came out, and
> I'll probably do the same for 4.0. It's slowly sinking in.
>
> I have also come across a number of typos too. Massimo, would you
> like feedback on this, or can we make suggested
yes. For example to export
def myaction(): return str(db().select())
to import
def importdata():
db.mytable.import_from_csv_field(StringIO(request.vars.input_field))
On Nov 1, 10:09 pm, Saurabh S wrote:
> Hi , is it possible to built a module in the application itself to
> have a functio
What's your model?
On Nov 1, 10:02 pm, Plumo wrote:
> I had a GAE app running on Version 1.94.6 (2011-03-27 17:35:27)
> I tried upgrading to: Version 1.99.2 (2011-09-26 06:55:33) stable
>
> But then get an error with this
> line: db(cls.db.user_profile.user==google_user).select().first()
>
> Fi
Hi Massimo,
A typo in online book for update_or_insert() is spotted.
http://web2py.com/book/default/chapter/06#update_or_insert
The example quoted from current book:
db.person.update_or_insert(dict(name='John'),
name='John',birthplace='Chicago')
should be:
db.person.update_or_
While trying to answer a question on StackOverflow
(http://stackoverflow.com/questions/7962840/web2py-ms-sql-server-2008-r2-ldap-authentication-helloworld-application)
I found the potential need for a patch to dal.py. The DAL works just fine
if you want to connect to MSSQL using SQL Server's a
I'm coming slightly late to this thread, but wanted to add a note...
> If we did implement this approach, the next question is, could we also
> implement a scheme whereby if the algo is changed, when someone goes to
> change their password, the system can confirm that the old password is
> pr
Conceptually, this is the same as giving any module to access the
web2py helpers...you will need to make them available within the
namespace. I did a quick test:
>>> content = "{{from gluon.html import *}}{{=A('hello world')}}"
>>> render(content=content)
'hello world'
So it works! Other things
I am currently re-reading the book since version 3.2 came out, and
I'll probably do the same for 4.0. It's slowly sinking in.
I have also come across a number of typos too. Massimo, would you
like feedback on this, or can we make suggested changes and send them
through.
Andrew
On Nov 2, 7:4
Thank you for understanding me :)
I tried but this code will set the default value if the field exist on
the view.
I made a simple example. I don't want to show field2 so it's excluded
in view using custom form but want to store the value like 'BBB' or
'CCC' before it's inserted into table. This
Hi , is it possible to built a module in the application itself to
have a functionality of import and export , just like /appadmin ?
i.e. can we have a button in our application on click of which we can
import/export the data ?
On Tue, 2011-11-01 at 19:54 -0700, Anthony wrote:
> If these are purely static files, why do you need web2py to serve
> them? Can't you set up your web server to serve them from where they
> are, or do you only have web2py's built-in server available (if so,
> maybe you can run a separate instance
I had a GAE app running on Version 1.94.6 (2011-03-27 17:35:27)
I tried upgrading to: Version 1.99.2 (2011-09-26 06:55:33) stable
But then get an error with this
line: db(cls.db.user_profile.user==google_user).select().first()
File "/web2py/gluon/dal.py", line 5786, in select
return self.d
On Tuesday, November 1, 2011 5:46:57 PM UTC-4, John Duddy wrote:
>
> That lets me read the URL from my web2py code, right? Instead, I want
> to serve the file via web2py to the browser.
>
> I suppose I could use this with response.stream, if I knew how to
> parse the rest of the URL component be
On Tuesday, November 1, 2011 5:48:12 PM UTC-4, John Duddy wrote:
>
> Unfortunately, no. I might be able to create soft links under static
> to those directories, making up a guid each time for the name. I was
> hoping for a more elegant solution.
>
If these are purely static files, why do you ne
I think this problem was fixed in trunk -- you can try the current trunk
version of
anytime.js:
http://code.google.com/p/web2py/source/browse/applications/welcome/static/js/anytime.js
(if you look at the most recent diff, you'll see it was just one small
change, so you can probably just make
On Tuesday, November 1, 2011 7:15:32 PM UTC-4, Archibald Linx wrote:
>
> @auth.requires_login()
> def write_message():
> form = SQLFORM(db.message)
> if form.process().accepted:
> response.flash = 'Got it'
> return dict(form=form)
>
> then although the "title" field is fil
Hi,
I am a developer for Sahana Eden . I am facing the following problem :-
A variable is defined in the second file of the models of the
web2py-application ( there are more than 40 files in the models folder).
Depending on the value of that variable I wanted to stop the further
execution of t
On Wed, 2011-11-02 at 02:46 +0100, ~redShadow~ wrote:
> [...]
For the moment, I'm using this javascript to add a "blank" button after
the datetime inputs:
// -- Add blank button right of datetime fields
$('input.datetime').each(function(){
oc = "$('#"+this.id+"').val('');return false;
ok, i feel like i am on the right path, getting hot. i have this
sample code to break it down,
q = """ok dude, italic text.
this is plain but bold text.
{{=A('web2py code', _href=URL('http://fscj.edu'))}}"""
from gluon.template import render
from gluon.storage import Storage
I am creating a search form in which I let the user optionally specify a
datetime range to be used to filter results.
The plan was to check whether the user choose a date, and if that's the
case, add a filter to the search query.
Problem is: if the user clicks on the datetime field, or even tabs i
Can you show some code?
On Tuesday, November 1, 2011 6:47:13 PM UTC-4, brushek wrote:
>
> Ok, thanks for answer. I would like to use this plugin with LOAD
> helper. How can I connect LOAD with blockUI ? When I use load, then I
> can't make blockUI working (I want to ask user before send the
> v
On Tuesday, November 1, 2011 9:12:02 PM UTC-4, Anthony wrote:
>
> In appadmin, there is a "cache" page with some stats about the cache. For
> me it shows the cache hits, but doesn't seem to show anything in the cache,
> so not sure it's working properly.
OK, looks like you need guppy installed
Also, you can see what's in the cache via cache.ram.storage (e.g., print it
to the console, etc.).
On Tuesday, November 1, 2011 9:14:10 PM UTC-4, pbreit wrote:
>
> OK, thanks.
>
> It looks like the sluggish performance I'm seeing is because of a LOAD()
> not the cache. I think the cache might be
OK, thanks.
It looks like the sluggish performance I'm seeing is because of a LOAD()
not the cache. I think the cache might be working OK.
In appadmin, there is a "cache" page with some stats about the cache. For
me it shows the cache hits, but doesn't seem to show anything in the cache,
so not sure it's working properly. Also, you might check db._timings (or
the "db stats" button on response.toolbar()) -- I'm guessing it won't sto
Oh, I see, I assume the cache.disk is at /init/cache/cache.shelve.db
What sort of binary file is that? SQLite?
Does "distinct" or "orderby" make a difference?
Is there any way to confirm that my caching is working? I've got a query
cached but it still takes the same long amount of time on each page view.
For example, this query:
groupings = db((db.item.status=='active') &
(db.item.grouping!='test')).select(db.item.grouping,
I believe in your controller, before form.process() (or form.accepts),
include:
form.vars.FFTSCD = 'aaa'
I have discovered where my problem came from.
If you try this model :
db.define_table('message',
Field('title'),
Field('tosomeone', 'list:reference auth_user'))
and this controller :
@auth.requires_login()
def write_message():
form = SQLFORM(db.message)
if form.accepts(request.v
Render is the same function used to process the views. So, as long as
you put all the variables in the namespace, your code will execute.
Something like this should work:
from gluon.template import render
context = Storage()
context.rows = rows
content = """
{{
for row in rows:
..something wi
Ok, thanks for answer. I would like to use this plugin with LOAD
helper. How can I connect LOAD with blockUI ? When I use load, then I
can't make blockUI working (I want to ask user before send the
validated form wheter do the action (by javascript confirm()) and make
him waiting with blocked brows
yes, but even more general then only fields, like you can have entire
sections of blocked executable code in a view like
{{
for row in rows:
..something with rows..
for c in rows.colnames:
..something with colnames..
=A("some link text", =href=URL("index"))
}}
that isn't so much a field a
Sorry, I'm so confused and hard to explain but...
I have a field which value was set from another table and don't want
to show on the user. I just want to set default value in controller
and submit the form with the fields user filled in.
Do I need to include the field in the view but make it hid
This is what I do:
if form.accepts(request.vars, session):
return_script = ['parent.$.nyroModalRemove();']
return_script.append('parent.window.location.reload();')
return HTML(BODY(SCRIPT(''.join(return_script.xml()
On Nov 1, 8:19 pm, Kenneth Lundström
wrote:
>
Unfortunately, no. I might be able to create soft links under static
to those directories, making up a guid each time for the name. I was
hoping for a more elegant solution.
On Nov 1, 12:42 pm, Anthony wrote:
> On Tuesday, November 1, 2011 3:08:10 PM UTC-4, John Duddy wrote:
>
> > I'm creating an
That lets me read the URL from my web2py code, right? Instead, I want
to serve the file via web2py to the browser.
I suppose I could use this with response.stream, if I knew how to
parse the rest of the URL component below my controller
On Nov 1, 12:17 pm, Richard Vézina
wrote:
> I think thi
This is already fixed in trunk
(http://code.google.com/p/web2py/source/checkout). The updated
web2py_ajax.js file is attached if you want to try it.
On Tuesday, November 1, 2011 5:03:45 PM UTC-4, glimmung wrote:
>
> Hi Anthony,
>
> Thanks for the very complete explanation and the workaround.
>
>
Ok forget this I read to fast you only need to display some information and
not other...
Richard
On Tue, Nov 1, 2011 at 5:15 PM, Richard Vézina
wrote:
> It look you want some records to not be updatable right? If so... You can
> use permissions like this :
>
>
>
>
> data_entry_person (4), update
It look you want some records to not be updatable right? If so... You can
use permissions like this :
data_entry_person (4), update, tableX, 1
data_entry_person (4), update, tableX, 3
in Auth_permission table
That's mean data_entry_person or group #4 can update tableX row1 and 3...
When you
I think you want render. For example:
from gluon.template import render
fields=Storage()
fields.first_name = "John"
content = "Hello {{=first_name}}"
rendered = render(content, context=fields)
On Nov 2, 9:02 am, lucas wrote:
> ok, still stuck,
>
> i played with CODE(...) but that only displays
Hi Anthony,
Thanks for the very complete explanation and the workaround.
Rather than muck around with JS and potentially cause unintended
consequences, I'll create dedicated non-Ajax delete forms.
--
Regards,
PhilK
'a bell is a cup...until it is struck'
Hi Marin,
On 31/10/2011 18:31, Marin Pranjić wrote:
As described here:
http://web2py.com/book/default/chapter/06#Left-Outer-Join
db(inner_joins).select(select_fields, left = db.tablename.on(...))
note that "left" can be a list of joins if you need >1 left join in query.
left = [db.table1.on(.
Hi All,
Another long day, another silly question!
I have an Ajax component called with LOAD, which uses crud.create to
append a comment and/or image to a parent record, and so needs to hold
the reference to that record.
My table is: -
db.define_table('property_detail'
,Field('property_i
>I don't understand what you try to do... You mean you have to show all
>the >fields?
1. No, I pick some of fields I need from existing table by specifying
at model
2. Create/Edit form, I want user to edit some of them but the others
should be readonly
This will cause error...
>From your sugges
i have a script that launches a few things, including web2py. I use
the multiprocessing module and everything starts up.
def startWeb2py()
name=multiprocessing.current_process().name
os.system('python ./blueLite/web2py/web2py.py -a {0} -
N'.format(password))
...
Hope this helps,
Mart
ah i changed a bit much :
here is the new code (the problem fixed there)
def get_items():
response.generic_patterns = ['json']
query=(db.item.id>0)
items=db(query).select(db.item.id,db.item.name)
return response.json(items)
On 11/2/11, Phyo Arkar wrote:
> the model is :
>
> db.
the model is :
db.define_table("item",
SQLField("name", "text", length=512, notnull=True, default=None),
SQLField("base_price", "integer", notnull=True, default=None),
SQLField("price", "integer", notnull=True, default=None)
)
"""
Table definition
"""
from datetime import
I don't understand what you try to do... You mean you have to show all the
fields?
You can just don't tell web2py the field you don't want to show... Just
omit them in your model definition?!
Since you only read or select your are not don't need writable=false...
Maybe you don't use the proper t
ok, still stuck,
i played with CODE(...) but that only displays the text in python or
web2py syntax, it doesn't run it. i tried exec("string"), like in the
web2py manual, under a function in index.py, but it failes to compile
on that line saying invalid syntax.
so i am still not sure, so how doe
This did the trick. Thanks a lot
On Tuesday, November 1, 2011 3:08:10 PM UTC-4, John Duddy wrote:
>
> I'm creating an app that runs external programs, which produce HTML
> reports. These reports are produced outside the static directory, but
> I want the user to be able to browse them.
>
Do you have control over where the repor
Richard,
Thank you for you suggestion !
>Field('legacy_id_field_name','id'),
I tried this but the same result.
> sequence_name='name_of_sequence_in_legacy_database'
Not sure about it, especially I dont' use any auto increment...
This problem is critical like I need to suspend my project. Right
I think this is what you are looking for :
http://web2py.com/book/default/chapter/12#Fetching-an-external-URL
Richard
On Tue, Nov 1, 2011 at 3:08 PM, John Duddy wrote:
> I'm creating an app that runs external programs, which produce HTML
> reports. These reports are produced outside the static
At least if your DB2 is a legacy database you maybe need to define you id
field like this :
Field('legacy_id_field_name','id'),
I think it is a not documented functionality offer to postgres user that
can maybe apply to your situation...
There is also this :
sequence_name='name_of_sequence_in_l
I'm creating an app that runs external programs, which produce HTML
reports. These reports are produced outside the static directory, but
I want the user to be able to browse them.
Is there a way I can tell web2py to serve those files like it does
static files? All the links in the HTML files are
Hello Omi,
Is this problem have been resolved with the other thread?
Richard
On Tue, Nov 1, 2011 at 12:53 PM, Omi Chiba wrote:
> Tested with MSSQL 2008 and DB2
>
> If you connect existing table with primarykey and use writable=False
> to any of the field on the form, it will show the following
Trying giving your INPUT an id (i.e., _id='whatever') -- I think it may
need an id for Anytime to work (the value of the id shouldn't matter,
though each separate date/datetime field should have a unique id).
Anthony
On Tuesday, November 1, 2011 2:19:21 PM UTC-4, petrasadi wrote:
>
> Thank you
Hi! I think I found a little typo here:
http://web2py.com/book/default/chapter/09#RESTful-Web-Services
Similarly a GET request to
http://127.0.0.1/myapp/default/api/persons.json
indicates a request for a list of persons (records from the data person) in
json format.
A GET ***requst*** to
http
Thank you gentleman for your answers. I have followed your instructions,
but somehow it's not working
So in my controller, I have the following:
form=FORM('Date and time: ', INPUT(_name='date',
_class='datetime'), INPUT(_type='submit'))
return dict(form=form)
And my view looks like th
Anthony,
>migrate_enabled=False
Good to know, I will use this instead of migrate=False
Richard,
> I don't see why select should lock... And I don't think it lock since my
> user would not able to work concurrently...
I think you have a good point. I will just make sure not insert/update/
delete
I don't see why select should lock... And I don't think it lock since my
user would not able to work concurrently...
Richard
On Tue, Nov 1, 2011 at 12:46 PM, Omi Chiba wrote:
> Richard,
>
> Thanks for your reply. Yep, I set the migrate=False at DAL level so
> that I don't have to specify each t
On Tuesday, November 1, 2011 12:46:30 PM UTC-4, Omi Chiba wrote:
>
> Richard,
>
> Thanks for your reply. Yep, I set the migrate=False at DAL level so
> that I don't have to specify each table.
>
To prevent migrations globally, use DAL(..., migrate_enabled=False).
DAL(..., migrate=False) simply
I am not sure of that, but if there is migrate=False at table level and you
set to migrate = true at DAL level it should not override the table
level... So better to set also migrate=False at table define level...
I think you should be aware of this (from the book) :
Migrations can be disabled fo
Tested with MSSQL 2008 and DB2
If you connect existing table with primarykey and use writable=False
to any of the field on the form, it will show the following error.
Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 194, in restricted
exec ccode in environment
Richard,
Thanks for your reply. Yep, I set the migrate=False at DAL level so
that I don't have to specify each table.
> If you use crud and you define permissions, just don't give update, delete
> and create rigths (so just read and select, maybe).
>
> About the not lock any record, I don't know
Thanks. I'll follow the instructions there (looks like some useful
information, in any case!).
Tim
I went back to web2py book and found section on using json directly.
I guess jsonrpc is more for web service, for internal front/back end
communication,
it is simply better to use json directly.
Strongly agree with you on Qooxdoo, The look-and-feel of Qooxdoo very
professional, I have not found ot
On Tuesday, November 1, 2011 9:59:26 AM UTC-4, horridohobbyist wrote:
>
> Thanks, but there is one other issue. The following XML references the
> file system, I believe:
>
>
>
>
>
That looks like a URL, not a filesystem path (note the # fragment).
Never mind.
Thanks,
Richard
On Nov 1, 9:59 am, horridohobbyist wrote:
> Thanks, but there is one other issue. The following XML references the
> file system, I believe:
>
>
>
>
> /
>
>
>
>
>
> This cannot be fixed in Apache.
>
> Richard
>
> On Oct 31, 11:13 pm, Mas
I'm start running the company intranet site with the following.
O/S: MS Windows Server 2003
DB: MS SQL Server 2008 R2 (hosted over LAN and with Windows
Authentication not SQL Authentication) and DB2 (Database on AS400)
Python: 2.7
WebServer: Apache (Uniform Server)
To use Uniform Server, you can
migrate=False
If you use crud and you define permissions, just don't give update, delete
and create rigths (so just read and select, maybe).
About the not lock any record, I don't know how it works exactly, but I
think that if you only use read and select there will be not lock (to be
confirmed).
I'm connecting existing tables on DB2 which is for a mission critical
system. I just want to read them and don't want to lock any record on
the tables.
Shoud I explicitly put readonly or it doesn't matter if I don't use
like crud.update ??
My definition for existing table
Thanks, but there is one other issue. The following XML references the
file system, I believe:
/
This cannot be fixed in Apache.
Richard
On Oct 31, 11:13 pm, Massimo Di Pierro
wrote:
> Assuming you do not have an app called w3c.
>
> put the file in
>
> applicatio
Hi
I'm using the SQLFORM.grid extensively in a rewrite of my old TurboGears
application. A common thing that I provided in my previous version of
the application was to present to the user different filtering options
for lists. Here is a screen shot of it:
For my needs, the new SQLFORM.g
Sorry for my late reply.
You do not need response.generic_patterns = ['json'] as the generic view is not
used when you return a string.
The error is a serialization error. What's in the model?
On Oct 23, 2011, at 12:20 PM, Phyo Arkar wrote:
> def get_items():
> response.generic_patter
blockUI is just a client-side jQuery plugin, so just follow the usual
instructions: http://jquery.malsup.com/block/. I don't think there's
anything special about using it with web2py.
On Tuesday, November 1, 2011 8:34:42 AM UTC-4, brushek wrote:
>
> Hello,
>
> I would like to use jquery blockUI
Hello,
I would like to use jquery blockUI with web2py for long time action.
Can You give me some example/advice, how to do this with web2py using
web2py's ajax or jQuery in the best-fashion manner ?
regards
brushek
In answer to the first question, this is the process I use for
authentication in Windows:
http://timgolden.me.uk/python/win32_how_do_i/check-a-users-credentials.html
Another user posted this excellent LDAP setup tutorial:
http://ochiba77.blogspot.com/2011/10/how-to-set-up-web2py-ldap-with-windows
For the datepicker to work, you need /static/js/anytime.js and
/static/css/anytime.css, with both of those included in the document. Those
files come with the 'welcome' app, and web2py_ajax.html (which is included
in the 'welcome' layout.html) handles including them. However, if you
aren't usin
On Tuesday, November 1, 2011 6:20:57 AM UTC-4, Massimo Di Pierro wrote:
>
> I am not sure I understand the proposal. You can override the format:
>
> db.mytable._format = '%(name)s'
> db.mytable._format = lambda record: SPAN(record.first_name)
>
FYI, the above now works in trunk, but not in st
I am not sure I understand the proposal. You can override the format:
db.mytable._format = '%(name)s'
db.mytable._format = lambda record: SPAN(record.first_name)
On Nov 1, 12:44 am, "Ray (a.k.a. Iceberg)" wrote:
> Hi Massimo,
>
> So what do you think about the following idea? If it is ok for you
form=FORM('Date and time: ', INPUT(_name='date', _class='datetime'),
INPUT(_type='submit'))
No _type='datetime'.
On Oct 31, 10:45 pm, petrasadi wrote:
> From what I read, if the _class and _time attributes of a FORM both
> reference "datetime", then this should render a datetime picker in the
>
If you get the chance can you guys please look into this post:
http://stackoverflow.com/questions/7962840/web2py-ms-sql-server-2008-r2-ldap-authentication-helloworld-application
If the app I am to develop is added to the free appliances section it
will allow a lot of companies to quickly make sma
ok thanks a lot. I missed this point.
Uolter
On Nov 1, 7:04 am, howesc wrote:
> how will you know what counter value to add? with GAE's parallelism and
> delayed data replication you have no way to know what counter values have
> been used...
for 5) I will add - adding/deleting rows and truncating tables. Stay tuned.
1) I am using directly Json as I haven't really look into JSONRPC of
qooxdoo yet. In web2py every request ends with .json return in JSON
Serialized result.
2) /HersPOS/default/insert_items.json is the actual request url
Hello Massimo,
Ofcoz its on googlecode :D
http://code.google.com/p/herspos/
hg clone https://phyo.arkarl...@code.google.com/p/herspos/
On 11/1/11, Massimo Di Pierro wrote:
> where is the mercurial repo?
>
> On Oct 31, 3:25 pm, Phyo Arkar wrote:
>> http://herspos.appspot.com/HersPOS
>>
>> I
Hi,
I'm using nyroModal to open a SQLFORM in a modal window. When I submit
the form I want to the modal window to close and the parent window to
refresh. Is this possible?
Kenneth
89 matches
Mail list logo