seems that you have a very old installation of psycopg2 . upgrade that
and you should be fine (pip install --upgrade psycopg2)
according to docs, server_version was added on psycopg2 2.0.12, and if I'm
not mistaken that should be well before 2 years ago.
On Wednesday, April 24, 2013 4:
Is there a way to concatenate fields in the represent function in the same
way that countryTelephoneCode and countryName are in the "requires"
validator below?
db.PartyPhoneNumberIntersection.countryTelephoneCode.requires = IS_IN_DB(db,db
.Country.countryTelephoneCode, '%(countryTelephoneCode)s
represent can be a lambda so you can do all sort of crazy things.where
are you stuck ?
--
---
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
hi folks,
i'm trying to add twitter recent tweets that i learned from admin page. but
when i'm implemented it returns an error :
Unable to download because:
local variable 'r' referenced before assignment
did anyone ever face the same situation? any hints, or solutions to solve
this problems?
On Tue, Apr 23, 2013 at 11:37 PM, Arnon Marcus wrote:
> How is this architected?
I'm not sure I understand what you want to know but
I suppose you are referring to the chat example and how it works:
1. You open the chat with your browser and it sends the last messages, this is a
"normal" re
1) The code says it is possible to pass in linked_tables as a dictionary,
in which case it will put the links together in the order produced by
linked_tables.keys(). This may or may not give you what you want. Quoting
the Python web site, "The keys() method of a dictionary object returns a
li
Hi all,
I've some trouble trying to migrate an app db from mysql to postgres using
the cpdb.py script
My appname is "sviluppo" and it has all the tables defined inside
"db_wizard.py".
Both the connection url (source and dest) are tested working
I used this command:
./web2py.py -S sviluppo -M
Wel...
I solved my problem using a custom widget. I don't know if it is the best
solution, but it works.
The records are now represented like below :
*
fruits
banana
apple
vegetables
potatoes
tomatoes*
Below my code for those who are interested :
*Create
Can you show some code...?
Le mercredi 24 avril 2013 11:01:05 UTC+2, 黄祥 a écrit :
>
> hi folks,
>
> i'm trying to add twitter recent tweets that i learned from admin page.
> but when i'm implemented it returns an error :
>
> Unable to download because:
> local variable 'r' referenced before assig
Leonel's right, if you want to compare frameworks java with python
frameworks oh yes you can talk in web2py x primefaces, for example. Yet the
architecture adopts java and python patterns can even use some standards of
design patterns, but some patterns java, as these are own when developing
JEE, E
hello,
i have a table like
Name date
John 2013-01-01
John2013-01-01
Alex2013-02-02
Alex2013-02-03
Alex 2013-02-04
How do i select only alex because he has odd number of records?
I just want the name alex, i dont care how many.
--
---
You received this message because you ar
Yes, that is correct. I made the changes, (only minor adjustment to your
solution was that I had to replace a 'default' with 'patient_scan_history'
when setting response.js).
As usual, while writing my post I became slightly clearer in my head about
where the problem lay, but didn't have the co
Hi
Maybe you could try something like
db().select(db.myTable.name=='Alex', groupby=db.myTable.name)
Le mercredi 24 avril 2013 13:24:01 UTC+2, Ramos a écrit :
>
> hello,
> i have a table like
>
> Name date
> John 2013-01-01
> John2013-01-01
> Alex2013-02-02
> Alex2013-02-03
>
db.PartyPhoneNumberIntersection.countryTelephoneCode.represent = \
lambda v, r: '%(countryTelephoneCode)s %(countryName)s' % r
Anthony
On Wednesday, April 24, 2013 4:08:25 AM UTC-4, Alex Glaros wrote:
>
> Is there a way to concatenate fields in the represent function in the same
> way that c
First of all, by "architecture" I was referring to the server-side, not the
client-side.
Secondly, when I asked "how do you combine gevent and tornado", I was
referring to your statements:
"web2py app based on tornado long polling chat example."
The only requirement is to run it with gevent."
I'm aware of that.
but, when you opt to use java on your development environment, you'll there
are certain aspects that you'll have to take into account. For ex: Java
usually will use more processor and memory, costs on hosting java are way
more expensive than any other language/framework, develop
Not sure if this can be done completely with the DAL, but doing some
post-processing in Python:
count = db.mytable.Name.count()
rows = db(db.mytable).select(db.mytable.Name, count, groupby=db.mytable.Name
)
odd_count_names = [r.mytable.Name for r in rows if r[count] % 1 == 0]
Anthony
On Wednesd
Thanks
That is how i did it reading the book.
2013/4/24 Anthony
> Not sure if this can be done completely with the DAL, but doing some
> post-processing in Python:
>
> count = db.mytable.Name.count()
> rows = db(db.mytable).select(db.mytable.Name, count, groupby=db.mytable.
> Name)
> odd_count
if i have a component calling another component item, what code can i use
for the back button to get to the previous component?
--
---
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
Hi guys.
I have this code in my view:
{{if rows:}}
{{number_of_pages = int(math.floor(number_of_records/
settings["items_per_page"]))}}
{{if request.args:}}
{{current_page = int(request.args[0])}}
{{else:}}
I'd start by "why python and not java" and continue with "why a framework
and not starting from scratch" and end with "why web2py and not some other
python framework".
Everything else would be comparing the incomparable... it goes without
saying, not everything is black and white, try to keep a
Ajax and browser back button functionality is a rather complex issue. I'm
using a hacked version of history.js, but it's a pain... I have made a
thread here a while ago, describing my approach:
https://groups.google.com/forum/#!msg/web2py/U7aBJV2HTXI/nsNnYzgGsGsJ
Regards,
Ales
On Wednesday, Ap
These links may interest you
http://web2py.com/books/default/chapter/29/12#Plugins
http://web2py.com/books/default/chapter/29/03#Adding-grids
On Wednesday, 24 April 2013 08:01:24 UTC-5, Domagoj Kovač wrote:
>
> Hi guys.
>
> I have this code in my view:
>
> {{if rows:}}
>
>
HI,
>From web2py book,
http://www.web2py.com/book/default/chapter/06
try:
execute models, controller function and view
except:
rollback all connections
log the traceback
send a ticket to the visitor
else:
commit all connections
save cookies, sessions and return the p
Thanks Massimo,
I saw there is a system of plugins, but i wasn't sure are they the right
choice for something like this. I will check them one more time.
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and
Hi Folks,
I discovered recently web2py and I really like it!
I wonder if it exist a nice open source CMS (still maintained...) in
web2py?
I don't need something overcomplicated. I prefer something basic but
comfortable to use...
The goal is to create my personal website first, then contribute
This just came up in another context. There's no way to do it via the
public API, but I think it should work if you use one of the private
methods:
session._try_store_in_db(request, response) # for sessions in db
session._try_store_in_cookie_or_file(request, response) # for sessions in
cookie
I'm aware of that... but again, just trying to get enough to tell people
who've been working with Java for so long, to understand why web2py... your
reasoning sounds easier to understand, although I'd made it slightly
diferent:
1. "why a framework and not starting from scratch"
2. "why web2py and n
basically it's same like on the admin page, the different part is only the
twitter user name.
*models/db.py*
TWITTER_HASH = "stifixid"
*controllers/default.py*
def twitter():
session.forget()
session._unlock(response)
import urllib
import gluon.tools
import gluon.contrib.simp
Hi Arnon,
On Wed, Apr 24, 2013 at 1:13 PM, Arnon Marcus wrote:
> First of all, by "architecture" I was referring to the server-side, not the
> client-side.
the demo chat was running with:
$ cd
$ nohup python anyserver.pt -s gevent
was running with gevent httpserver, no tornado involved in any
Thanks Cliff.
I've tried a few combination, and it didn't get to what I want.
1) linked_tables=['demo_detail','achievement'].sort(reverse=True)
2) linked_tables=dict(demo_detail=id,achievement='id')
Case 1) - I still can't get achievement to listed first. My smartgrid shows
achievement first and
Hi all,
It is very simple but i am quite blocked:
i did a site and I want to give the possibility to load some program and
files.
exemple :
Repertory of my site
MySite
/private
myProgram.exe
myFile.txt
To load the myProgram.exe I put in my form this
http://127
sorry... i need some coffee. Typed the wrong name of table above.
Case 1) - I still can't get demo_detail to be listed first. My smartgrid
shows achievement first and then demo_detail.
On Wed, Apr 24, 2013 at 10:59 PM, fun man wrote:
> Thanks Cliff.
>
> I've tried a few combination, and it did
On Wednesday, April 24, 2013 9:22:24 PM UTC+7, Marco Tulio wrote:
> I'm aware of that... but again, just trying to get enough to tell people
> who've been working with Java for so long, to understand why web2py... your
> reasoning sounds easier to understand, although I'd made it slightly
> dif
the private dir is not "exposed" by default (the name "private" should have
give you an hint :-P )..
if you need to do something like that (e.g. a fast way to give access to
some static file) you'd better put them in the /static directory (in that
case it will work with exactly the same cod
in your client side js code use the js file api (this is for one file, but
multi file upload can be done too)
$('#datafile-uploadfield').change(function() {
var upload_element = $(this)[0];
var file = upload_element.files[0];
if (file) {
var reader = new FileReader();
read
Thanks Niphlod.
I thought that Private was for files I was really wrong! I am going to
put all my files in the static's repertory and to do some tests.
thanks a lot and maybe write you soon!
Pibol
On Wednesday, April 24, 2013 5:00:33 PM UTC+2, open...@gmail.com wrote:
>
> Hi all,
>
> It
Is there a way to make the form generated by SQLFORM return the current
fields saved in the DB instead of making the fields blank? What i want is
to return the record.
--
...
Teddy Lubasi Nyambe
Opensource Zambia
SQLFORM.grid(, editargs=dict(comments=False))
or
SQLFORM.grid(, formstyle='bootstrap')
On Monday, April 22, 2013 2:15:35 PM UTC-4, Christian Espinoza wrote:
>
> Hi guys, somebody know how hide the comments column at a edit form using
> SQLFORM.grid() ??
>
> I can do it using jquery wi
Hi Folks,
I was reading:
http://web2py.com/books/default/chapter/29/07?search=checkboxes#Widgets
I am trying to implement some checkboxes with a specific class using DIVs:
db.anuncio.equipamento.widget=lambda field,value:
SQLFORM.widgets.checkboxes.widget(field,value,_class="span2",style='divs')
you mean an edit form ?
record = db.table(1)
form = SQLFORM(db.table, record)
On Wednesday, April 24, 2013 5:35:18 PM UTC+2, software.ted wrote:
>
> Is there a way to make the form generated by SQLFORM return the current
> fields saved in the DB instead of making the fields blank? What i want i
why the base64 ? I want my files submitted as binaries, if possibile.
On Wednesday, April 24, 2013 5:31:48 PM UTC+2, select wrote:
>
> in your client side js code use the js file api (this is for one file, but
> multi file upload can be done too)
>
> $('#datafile-uploadfield').change(function
yah that exactly, but when you add a new record, the saved record does not
show in the form. I want the fields to remain with saved content. Even when
i use the example u have givenbut when i click on a button with an id
with an existing record in the db it shows without any problem...when i
ma
Hello,
This topic came up last month, and if my memory serves me correctly there
were a few options available. I'd recommend searching this group for "CMS",
and take a look at some of the more recent posts.
Neil
On Wednesday, 24 April 2013 14:57:52 UTC+1, alastor...@gmail.com wrote:
>
> Hi Fol
readAsBinaryString and readAsArrayBuffer and readAsText
did not work, i just tested, but if you have a hint on how to make them
work I would be very interested
On Wednesday, April 24, 2013 5:53:33 PM UTC+2, Niphlod wrote:
>
> why the base64 ? I want my files submitted as binaries, if possibile...
it's not that I don't like the use of native js api, but if the tradeoff is
transmitting as base64 that's not an implementation I want to use (given
that there are plenty of "drop-loaders" out there).
Base64 the contents means wasting a net 33% of bandwith.
--
---
You received this message b
With the "divs" style, the parent element of the checkboxes is a CAT(),
which doesn't produce an HTML element (and therefore can't take any HTML
attributes, such as a class). Maybe try:
db.anuncio.equipamento.widget = \
lambda field, value: DIV(SQLFORM.widgets.checkboxes.widget(field,
value
I think you need to be more clear...either you want to:
- add a new record --> if you want to "preload" default values you just
have to set them beforehand
- edit an existing record --> it's obvious that what you edit (and submit)
has the same value of the next attempt to edit the same record
On
so what do these drop loaders do to make pure ajax file uploads, i was not
aware of that o_O
On Wednesday, April 24, 2013 6:19:09 PM UTC+2, Niphlod wrote:
>
> it's not that I don't like the use of native js api, but if the tradeoff
> is transmitting as base64 that's not an implementation I want
Thanks Niphlod and Anthony,
it worked perfectly.
(note to total beginners, Anthony's backslash "\" means use a soft, not
hard return")
much appreciated,
Alex
On Wednesday, April 24, 2013 5:00:00 AM UTC-7, Anthony wrote:
>
> db.PartyPhoneNumberIntersection.countryTelephoneCode.represent = \
>
so i basically missed what is going on right now because I did not looked
at the problem for half a year
http://caniuse.com/xhr2
xhr2 is supported by almost all browsers and xhr2 supports sending files :D
implementations are here
http://stackoverflow.com/a/10811427/1436151
http://stackoverflow.c
First off, thanks to the community for a well written framework. The
documentation is very nice and full of examples.
I thought I'd ask here, as I couldn't be the only want who didn't want a
text "verify email" to be sent out in lieu of nice, colorful, css heavy
html emails.
I want do the follo
Looking in gluon > tools.py, it seems that when a registration is taking
place, it doesn't call any framework code to execute a registration.
Rather, it simply does the registration actions inline, under form.accepts.
/gluon/tools.py +2308
if form.accepts(request, session, formname='register',
Anthony, doesn't there have to be some sort of pointer to the correct
reference record in the lookup table?
Here is a real example below (different fields and table than first
example).
I tried to put "db.Country" in front of the lookup table field names, but
the syntax is wrong. Now that you
Sorry, try:
db.PartyPhoneNumberIntersection.countryTelephoneCode.represent = \
lambda id, r: '%(countryTelephoneCode)s %(countryName)s' % db.Country(id
)
Anthony
On Wednesday, April 24, 2013 1:18:51 PM UTC-4, Alex Glaros wrote:
>
> Anthony, doesn't there have to be some sort of pointer to th
thanks for taking your time to give your point of view... couldn't read
your name though.. are those characters chinese? Could be japanese, but
since japanese kanji are based on chinese, it would be a fair mistake by an
outsider.. :)
2013/4/24 黄祥
> On Wednesday, April 24, 2013 9:22:24 PM UTC+
I've been debating using the baked in scheduler and figured I'd try it out
first before fighting to get celery running with web2py. I have a task
that uses Popen to run an external program, processes the result, and
returns. When I run this with the scheduler, an entry in scheduler_run is
cre
it's by design if the function doesn't return a value, then you don't
need a record to store the result ^_^
try returning something from your function and you'll see that the record
will remain.
e.g.
you have
def mytask():
# do something
switch it to
def mytask():
#-
haha brilliant. Thanks for the quick response.
My task only operates on the db and internally after an external matlab
call to chug on data so i wasn't returning anything. A simple return 1 did
the trick.
Also I'm using your ComfortScheduler plugin that i found while searching
the message bo
That looks like an improvement Anthony but now receive this error
format requires a mapping
There is data in all of the fields (there are no "None" values).
The represent field names the above table are as follows:
db.PhoneNumber.countryTelephoneCode.represent = lambda id, r:
'%(countryTelep
The docs at
http://web2py.com/books/default/chapter/29/09#Central-Authentication-Service
say: "Thanks to CAS 2.0 all fields that are readable on the provider and
have a corresponding field in the auth_user table of the consumer will be
copied automatically."
This is correct but does not mentio
no probl, submit ideas too ^_^
On Wednesday, April 24, 2013 8:45:39 PM UTC+2, DeanK wrote:
>
> haha brilliant. Thanks for the quick response.
>
> My task only operates on the db and internally after an external matlab
> call to chug on data so i wasn't returning anything. A simple return 1 did
Hmm, that works for me. Does it work if you do:
db.PhoneNumber.countryTelephoneCode.represent = \
lambda id, r: '%(countryTelephoneCode)s %(countryName)s' % db.Country(id
).as_dict()
Also, confirm that all values in db.PhoneNumber.countryTelephoneCode do in
fact reference existing records in
DAL now supports MongoDB which is nice for auth and forms. But I'd like to
use the MongoDB query facilities (and maybe GridFS).
Is it possible to obtain a connection to the database through DAL or should
just use pymongo's MongoClient, as if it was another application?
TIA
Marcel
--
---
Yo
I know, this topic has been discussed several times. Sometimes I get this
message.
(1) I want to use a "try - except" statement to catch this message. Has
anybody tried it? Where should the "try - except" go?
(2) If this does not work: which database would be better than sqlite?
Regards, Martin
So I've read through the documentation twice and could have skipped over
some key point, but i'm having an issue submitting a task from a task.
I've stupefied my to paste it here, but basically from a controller i'm
doing this:
scheduler.queue_task(my_parent_task,
pvars=dict(arg1=val,ar
1) if you can't reproduce the error with a specific "line" of your code
that triggers it, then is quite unuseful to try:catch every single db
operation.
BTW, this is what you'd need to do
try:
db(somequery).select()
except:
#handle the exception
pass
try:
db(somequery).update(some
The builtin wiki works as a CMS.. other than that, instantpress.
1) create a new app
2) edit default.py so that
def index(): return auth.wiki()
3) navigate to http:///yourappname
https://groups.google.com/forum/#!topic/web2py/Y84vndej0jI/discussion
On Wednesday, April 24, 2013 6:57:52 A
Don't need pyodbc, web2py comes with pypyodbc.
On Tuesday, April 23, 2013 5:35:03 PM UTC-7, Richard wrote:
>
> Did you install pyodbc?
>
> Also, your connection string seems to me doubtfull :
>
> Mine start like that :
> db=DAL()
>
> You should stick with db since it is a convention for us and may
thx :-)
M
2013/4/24 Niphlod
> 1) if you can't reproduce the error with a specific "line" of your code
> that triggers it, then is quite unuseful to try:catch every single db
> operation.
> BTW, this is what you'd need to do
> try:
> db(somequery).select()
> except:
> #handle the excepti
you're probably missing the part where a task gets executed in a
"shell-like" environment, whose most-notable difference is that inside a
task you have to manually db.commit().
While a db.commit() is ensured "automatically" at the end of every request
in the normal web environment by web2py, in
>
>
>> b = SQLDB('mssql://username:password@localhost:portnumber/databaseNAME')
>>
>> Can someone give me a some examples or link to any information where I
>> can see how a simple program connects to a SQL SERVER DB and selects a few
>> records from a table and displays them...
>>
>> I h
> A "tasks fired by tasks" is a perfect example: what if you want to queue
> your tasks only if the "parent" completed correctly ?
This makes perfect sense. Also I forget that the "message passing" is
being done through the database. I added a db.commit() at the end of the
parent task and
Anthony,
It works. Did not need the ".as_dict()"
The problem was with my data. I still don't know what's wrong with that
table, but tried your statement on a different table with different fields
and it worked.
Thanks for the great tips.
Alex
On Wednesday, April 24, 2013 12:18:35 PM UTC-
Hi
the code from pypdf wiki examples works
http://code.google.com/p/pyfpdf/wiki/Web2Py
(downloaded via http://pyfpdf.googlecode.com/files/web2py.app.fpdf.w2p )
pdf=MyFPDF()
pdf.add_page()
pdf.write_html(str(XML(table, sanitize=False)))
response.headers['Content
Well, as for the whole confusion-thing, next time you should write
"inspired by" instead of "based on" to disambiguate your meaning.
As for threading/non-blocking, it appears that this is a very large subject.
Non-blocking IO is a holy-grail of IO-bound applications such as
web-servers.
However
it seems the twitter code from admin page is limited for certain days or
weeks. the other things is it didn't support link for example
http://whateverurl.com
did anyone know how to fix it?
thank you so much
--
---
You received this message because you are subscribed to the Google Groups
"web
On Thursday, April 25, 2013 1:12:13 AM UTC+7, Marco Tulio wrote:
> thanks for taking your time to give your point of view...
>
no worries, bud, that's what community are for.
> couldn't read your name though.. are those characters chinese? Could be
> japanese, but since japanese kanji are bas
I have experimented with this and i think there is something wrong...
*Controllers*:
def index():
return locals()
def post():
form = SQLFORM(db.pics, upload=URL('download'))
if form.process().accepted:
response.flash = 'Data saved'
elif form.process().accepted:
re
What about using the keepvalues option:
>From the book:
form.accepts(vars, session=None, formname='default',
keepvalues=False, onvalidation=None,
dbio=True, hideerror=False):
Change keepvalues to True
Regards
Johann
On 24 April 2013 18:23, Niphlod wrote:
> I think
I had big problems with the connection to a mssql server.
My working connection string is this:
mssql://DRIVER={SQL Server};SERVER=HOST\DATABASE,PORT;UID=USER;PWD=PASSWORD
On Wednesday, April 24, 2013 11:16:58 PM UTC+2, Tim Richardson wrote:
>
>
>
>>
>>> b = SQLDB('mssql://username:password@
81 matches
Mail list logo