Please help me to understand how to use uuid.
db.define_table('x',
Field('uuid', length=64, default=uuid.uuid4(), notnull=True,
writable=False, unique=True, ondelete='CASCADE'),
Field('a'),
Field('b'))
In [4]: db.x[0] = dict(
Hi,
Is there a way to pass a list to rows = db(...).select().last() ?
would be a time saver to be able to do something like:
myList = ['dog,
'cat,
'kangooroo',
'fish']
4_legged_pets = []
rows = db((db.ani
I took a crack at it. Since I'm not sure how to test it, I have no idea if
it works. I'm just learning the "str.join()" trick so am not that
comfortable with it yet. At a minimum it returns the openlayers home page if
you simply go to http://127.0.0.1:8000/app/default/proxy as suggested in the
Hi Mart,
following your example I am not sure what you want but try something
like
rows = db(db.animal.paws==4).select()
last_rows = [rows.find(lambda r: r.species=x).last() for x in myList]
On Apr 15, 4:51 am, mart wrote:
> Hi,
>
> Is there a way to pass a list to rows = db(...).select().la
Rather than use use gluon.serializers.rss, I am using
gluon.contrib.rss2 to attempt to add an enclosure to an rss feed:
http://code.google.com/p/publicradioroadtrip/source/browse/controllers/default.py?spec=svnd020b7842a1c0a9ba880fb5f94146bbb5ab55524&r=d020b7842a1c0a9ba880fb5f94146bbb5ab55524#590
hi,
is there anyone knows how to produce db output select into xml please?
my intention is to convert my audio mp3 table into xml and then put it
on web2py apps.
e.g. (source from : http://www.voice2page.com/info/v2ppage_codes.html)
http://voice2page.com/info/
mp3player.swf" menu="false" quality
Not sure I understand.
Is your problem that you do
python nweb2py.py -a 'password'
and you get?
TypeError: cannot create weak reference to 'classobj' object
I have never seen this before. How do you run it? Which python
version? Do you have a loger traceback?
On Apr 14, 10:47 pm, mart wrote:
You are passing a uuid, not a uuid function therefore it is always the
same value:
try replace
default=uuid.uuid4()
with
default=uuid.uuid4
or
default=lambda:uuid.uuid4()
or
default=lambda:str(uuid.uuid4())
they should all work.
On Apr 15, 2:20 am, Johann Spies wrote:
> Please help me to und
Let's say you have:
def mp3():
rows = db(your_query).select(your_select)
return dict(rows=rows)
If you go to /app/controller/mp3.xml it will use the 'generic.xml' view to
render the rows as XML. If you want to convert the rows to XML within your
controller and then do something else w
Note, the book recommends first converting the Rows object to a list using
as_list(), though converting to XML seems to work for me without doing that:
http://web2py.com/book/default/chapter/09?search=serializer#Rendering-Rows
Also, see
http://web2py.com/book/default/chapter/06#HTML/XML-(one-ta
can you give code segment for option 11
to start web2py without gui, use '--nogui' option
I do came to notice that why reverting back to ipython while bpython is not
installed.
It should be reverting back to plain python shell.
Fix for is that is fairly simple. An else clause.
I'll submit new patch.
@niknok: Can you reproduce the crashes?
yes, my crud form has only two drop down list.
On 15 abr, 00:29, Stifan Kristi wrote:
> is your focus is on the text area, check box or drop down list?
>
> best regards,
>
> steve van christie
I'm using 10.10, I can't see this problem happening.
Is it that Ubuntu 11.04 beta, and some package may be unstable???
what's your bpython version?
import bpython; print bpython.__version__
mine is 0.9.6.2
In response to the events in which bpython isn't installed/crashed, my
previous patch will revert back to ipython (if installed).
The attached patch will revert straight into plain python shell, instead of
checking for ipython.
Apply, if others think, that's appropriate
Thanks,
Arun
215,226c21
your system doesn't have python-dev package.
If you are compiling mercurial from source you need that.
Install that first and try again.
(on debian based systems)
$> sudo apt-get install python-dev
I prefer this, because, one in ubuntu repo is older than latest version
available,
And since some
Java -> Python
Ask why?
-> web2py!
a, i c, thank you so much for your adviced, arun.
best regards,
steve van christie
On Fri, Apr 15, 2011 at 9:52 PM, Arun K.Rajeevan wrote:
> your system doesn't have python-dev package.
> If you are compiling mercurial from source you need that.
> Install that first and try again.
>
> (on debia
https://bitbucket.org/kra3/visual-lingua-website/src/8ac2627b0a19/applications/init/controllers/default.py
see line 24.
It's like this,
populate option list first,
insert a blank entry (in my case "ALL Languages"), into first position.
Use that list in form
On Friday, April 15, 2011 9:50:01 AM UTC-4, Anthony wrote:
>
> Note, the book recommends first converting the Rows object to a list using
> as_list(), though converting to XML seems to work for me without doing that:
> http://web2py.com/book/default/chapter/09?search=serializer#Rendering-Rows
>
see around web2py_ajax.html,
Once, you converted all those functions starting with web2py_* from jquery
to dojo (or any other)
you are done.
load netbeans just for web2py is a lot for me.
btw., the best IDE I've seen working is Wing IDE,
Also, PyDev too work well, (not as good as Wing)
thank you so much for your help, anthony, i've already tested your code, and
it works fine.
def mp3():
rows = db().select(db.audio.ALL)
from gluon.serializers import xml
xmlrows = xml(rows)
return dict(xmlrows = xmlrows)
i'll try to pass the xml output into the views but, the playe
I've tried to use it to avoid registering automatically users in the
database after a login using ldap, but the result is almost the opposite.
If auth.settings.alternate_requires_registration=True, then only database
users are allowed, and the alternate_login_methods are ignored.
Is it a bug or a
Hello,
As I said before, I believe a system and stayed in webfaction.com. When I
create theapplication there, they already have a script to download the
web2py and prepare itwith Apache. But those weeks while using the
system it gives
the following error:
502 - Bad Gateway
Reported that they we
thank you so much for your info, arun, but it return an error when i execute
it :
This page contains the following errors:
error on line 162 at column 10: Opening and ending tag mismatch: link line 0
and head error on line 162 at column 10: Encoding error
Below is a rendering of the page up to the
Thanks. Will apply it shortly.
On Apr 15, 2011, at 9:36 AM, Arun K.Rajeevan wrote:
In response to the events in which bpython isn't installed/crashed,
my previous patch will revert back to ipython (if installed).
The attached patch will revert straight into plain python shell,
instead of ch
Great Arun, it did the trick.
Why do you do:?
options_added=options[:]
I just did it:
options.insert(0, OPTION('', _value=''))
and it worked fine,
kind regards
On Fri, Apr 15, 2011 at 9:00 AM, Arun K.Rajeevan wrote:
>
> https://bitbucket.org/kra3/visual-lingua-website/src/8ac2627b0a19/appli
Hi Denes,
Thanks for your reply. What about the logic of redirecting after a
form submit on the index page to a function in a locator controller,
and redefining the form and retrieving data from the database based on
the args in the URL.
Kind regards,
Annet.
First of all, I'm not sure about it, but out of curiosity
Isn't it that* InternalError: (1048, u"Column 'country_id' cannot be null")
*caused by trying to insert something into table w/o giving a value to
country_id field???
A primary field cannot be empty.
forget, if I'm wrong in my assumption
It should not be.
After caching, it must not hit database, until cache expires.
So, after the cache is set and you insert something, then it'll take time
until cache expires, to have another db hit.
Unless db is queried again, new data will not be there.
It's as simple as that.
As others said,
a, i c, thank you so much for your adviced, arun.
i'll use the cache.ram, but lower the time in my dev learning.
kind regards,
steve van christie
On Fri, Apr 15, 2011 at 11:05 PM, Arun K.Rajeevan wrote:
> It should not be.
> After caching, it must not hit database, until cache expires.
>
> So,
set content type before returning.
def mp3():
import gluon.contenttype
response.headers['Content-Type'] = gluon.contenttype.contenttype('.xml')
rows = db().select(db.audio.ALL)
from gluon.serializers import xml
xmlrows = xml(rows)
return dict(xmlrows = xmlrows)
db(...).select().first() gives only one record ( the same as
db(...).select()[0]
)
db(...).select().last() :
rows = db(...).select()
last = len(rows) and rows[-1] or None
I am having the hardest time determining what the correct way is to
set the URL that a user will be redirected to after the authentication/
authorization redirect to Facebook. What I am currently seeing is
that a user who has not yet authenticated with Facebook will be
properly forwarded for authe
Doesn't look good for Python support in Netbeans 7 according to this
https://groups.google.com/forum/#!topic/comp.lang.python/JQQWJCARh9U
Datatable plugin or powerTable does not paginate the data on server, it
loads all the records in to memory and the pagination is done in client side
DOM.
I guess you dont need to commit() or close connection because web2py does
that for you on each request.
webfaction is a very nice hosting servi
Hi Annet,
could you explain what you want to do?.
On Apr 15, 11:57 am, annet wrote:
> Hi Denes,
>
> Thanks for your reply. What about the logic of redirecting after a
> form submit on the index page to a function in a locator controller,
> and redefining the form and retrieving data from the da
I am looking display a page that allows users to take a simple quiz.
The databases I have defined work. The part that isn't so clear for me
is how to display and receive the results from the quiz. I need to
display radio buttons for each choice in of answers relating to the
question.
My databases:
yeah, I see what you mean... Should have waited a bit. So much for
clever 4am analogies... ;) Wasn't really for animals ;)
I think what you have works for this. I wanted to be able to throw a
list at '.last()' because the same set of 50 to 60 rows get generated
every time a build is run. sometimes
plugin_wiki uses he jqGrid plugin and it paginates on server.
On Apr 15, 1:27 pm, Bruno Rocha wrote:
> Datatable plugin or powerTable does not paginate the data on server, it
> loads all the records in to memory and the pagination is done in client side
> DOM.
>
> I guess you dont need to commit(
Needs work but does not use auth, but it is a good starting point.
http://web2py.com/appliances/default/show/66
On Apr 15, 1:59 pm, Drise wrote:
> I am looking display a page that allows users to take a simple quiz.
> The databases I have defined work. The part that isn't so clear for me
> is how
Here is a version that I am using
https://bitbucket.org/rochacbruno/surveycloud
(does not store cpickle and has user-password control)
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
On Fri, Apr 15, 2011 at 4:05 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:
> Needs work but
Hi,
so, this is happening on Macos 10.6x, python is 2.7 and web2py is
latest (although it tells me I have latest, but I also get the active
link to update to latest,...)
Which ever module I use, I get the same error. This example is with
subprocess and the cmd string is 'python ./blueLite/pyUtil
Redirecting should work. Can you get it to work with just one form? Once you
get one form working, then try adding the second form. Start simply.
It looks to me like it might be stuck at the very beginning with "import
os". In MacOS terminal, can you do a simple "import os" in Python shell?
$ python
>>> import os
>>>
yup, no problem doing import os
I figured, there was a call to weakref somewhere in web2py libs, but I
don't see it...
On Apr 15, 3:29 pm, pbreit wrote:
> It looks to me like it might be stuck at the very beginning with "import
> os". In MacOS terminal, can you do a simple "import os" in Python
You probably need 'answers' to reference auth_user or come up with a scheme
to track the person answering.
Then, select() a question and build a form. Perhaps:
question = db.question(1) #or however you want to pick the question
form = SQLFORM(db.answers)
form.vars.question_id = question.id
retur
found the problem sorry for the ruckus!
the problem is aptana. Doing this outside of aptana works fine... not
sure why yet.
so, the problem is narrowed down. Once I figure out why aptana is mis-
behaving, I'll post results
Thanks for you help!!
Mart :()
On Apr 15, 3:29 pm, pbreit wrote
>From what I can tell, there is a port conflict between aptana (or one
of its plugins) and web2py. Still drilling down to find the culprit.
If I open aptana first, and let it load up properly, i can not launch
web2py. but, I can launch web2py, then aptana without issue.
Seems something in aptana
Hi,
no the values should not be empty. In the given example, you can
choose available items from the drop-down-boxes and they can just be
there, if there is content behind these keys.
The problem must be somewhere else.
On 15 Apr., 17:58, "Arun K.Rajeevan" wrote:
> First of all, I'm not sure abo
I have a page that serves both for creating and updating records. One
element is an image. When I go to edit a record that has an image, the image
upload widgets don't indicate that the record already has an image.
Is there an easy way to show the image or image filename
with form.custom.widget
It's not possible to create a migration manually to alter database data, is
it? Has this capability been discussed? Do people generally just create a
controller or something?
I was thinking like South and Rails:
http://south.aeracode.org/docs/index.html
http://guides.rubyonrails.org/migrations.h
I have been using web2py for the past few years and I feel it is one the
Python world's hidden gems. While most people argue about Django and the
like, what matters most when it comes to application development is
deployment speed, reliability and low cost of maintenance. If you are in the
so
web2py is awesome, a lot of feature that can be use for all programmers.
best regards,
steve van christie
On Sat, Apr 16, 2011 at 6:19 AM, DJ wrote:
>
>
> I have been using web2py for the past few years and I feel it is one the
> Python world's hidden gems. While most people argue about Djang
I'm collaborating with Drise on this project.
This is driving me up the wall. I took at the survey app (Thanks Bruno
and Massimo!)
Here's what i've got:
def take():
quiz = db().select(db.quiz.ALL).first()
questions=db(db.question.quiz_id==quiz.id).select()
answer_value=0
for quest
Got it! :)
stories = {}
collection_id=request.args(0)
collection = db.collection[collection_id] or redirect(error_page)
stories=db(db.story.collection.contains(collection_id)).select(orderby=db.story.title)
length=len(stories);
scheme = request.env.get('WSGI_URL_SCHEME', 'htt
hi,
pardon me, i want to ask what's the meaning of this :
URL('default','index').xml()==URL().xml()
here's the complete code:
response.menu = [
(T('Index'),URL('default','index').xml()==URL().xml(),URL('default','index'),
[]),
]
i mean it is convert the url into xml format page?
thanks and b
Is there any easy way to re-prompt the user for their password before
displaying certain sensitive pages? Here's what I'm thinking - the user logs
in with auth and has access to most features of the site. But, when they go
to a more important page they're first asked to re-enter their password -
This was a bad idea and it does not work with recent web2py. Should be
URL('default','index')==URL()
Is basically check whether /app/default/index is the current
requested path.
On Apr 15, 8:07 pm, 黄祥 wrote:
> hi,
>
> pardon me, i want to ask what's the meaning of this :
> URL('default','index
You need to pass the URL('default','download') to SQLFORM(..) as in
SQLFORM(...,upload=URL('default','download'))
and the widget should have it automatically.
On Apr 15, 4:56 pm, pbreit wrote:
> I have a page that serves both for creating and updating records. One
> element is an image. When I
I do not feel the necessity.
What I do is simply version control the files (specifically models).
Any change (whether in the future or reverting to a past version)
result in an automatic migration.
massimo
On Apr 15, 5:58 pm, pbreit wrote:
> It's not possible to create a migration manually to
a, i c, thank you so much for your explaination, massimo. i got it when i
use web2py wizard on 1.94.6 version.
best regards,
steve van christie
On Sat, Apr 16, 2011 at 9:12 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:
> This was a bad idea and it does not work with recent web2py.
Maybe similar to changing password?
return dict(form=auth())
{{=form.custom.begin}}
Old Password
{{=form.custom.widget.old_password}}
New Password
{{=form.custom.widget.new_password}}
Repeat New Password
{{=form.custom.widget.new_password2}}
64 matches
Mail list logo