I'd like to know this as well? Does anyone have some tips?
On Wednesday, April 23, 2014 at 12:44:39 PM UTC+2, libe...@gmail.com wrote:
Hi everyone,
I am trying to extract latitude and longitude from a POSTGIS geography()
field. Unfortunately the usual st_x() and st_y() functions normally
Hi,
I'm using a parameter based router like this:
routers = dict(
# base router
BASE=dict(
default_application='welcome',
default_controller = default,
default_function = index,
domains={'www.mydomain.nl':'myapp'}
),
)
Now how do I
What part of the admin creates the list of controllers? I looked in
default.py but i couldn't find it.. :(
On Monday, March 19, 2012 at 11:16:45 AM UTC+1, Hassan Alnatour wrote:
Dear ALL ,
How Can I Get ALL controller functions , as i know i can get the one
am at in the view using
Hi,
I have the following model:
#Abstract category model, has references from multiple translations
db.define_table('pitch_category') #No fields except for ID
#The category translations
db.define_table('pitch_category_translation',
Field('pitch_category', db.pitch_category,
Hi all,
I have this raw sql which I execute in my query:
sql_statement =
SELECT id, title, description, created_on, slug
FROM (SELECT infobank_article.id as id,
infobank_article.title as title,
Hi there,
I'm building a webapp with the model less app approach by Bruno Rocha and I
stumble upon a problem.
Usually when you use models you can define function which can later be used
inside a view.
How would I do this with a model less approach?
--
Resources:
- http://web2py.com
-
that you need globally, and it's the perfect place for them to be.
On Sunday, November 30, 2014 12:42:21 PM UTC+1, Ruud Schroen wrote:
Hi there,
I'm building a webapp with the model less app approach by Bruno Rocha and
I stumble upon a problem.
Usually when you use models you can define
This doesn't seem to be working properly or I'm doing something wrong..
query = db.providers.geolocation.st_distance(geoPoint(51.340245,
5.530007))5
providers = db(query).select()
I currently have one record. It's geometry field holds this value:
*POINT(51.247427 5.89289)*I'm using a
Nevermind.. I was using a geometry field instead of a geography one, so it
was showing the difference in degrees rather than meters.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Hi guys,
I'm using a auth_register() form. Right now, the password_two field (the
one that requires you to re-enter your password) shows a comment next to it
saying you need to re-enter your password or something.
Now I want to remove that comment using the following:
Found the solution.
*form.custom.comment.password_two = None*
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you
Or return XML(make_html), whatever you find easier.
On Wednesday, August 20, 2014 12:19:54 PM UTC+2, Stavros Anastasiadis wrote:
I am trying to use mpld3 (http://mpld3.github.io/index.html) to generate
an example plot with web2py.
so far in my simple example:
controller:
def
I have this:
My form:
auth.settings.register_onaccept = lambda form: __add_user_membership(form)
auth.settings.register_next = URL('members', 'ingeschreven')
return dict(form=auth.register())
My onaccept function:
def __add_user_membership(form):
user_id = form.vars.id
if
Which of the two is better in terms of performance/speed?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are
Hi list,
I'm working on a portal where people can look for healthcare in a given
municipality.
Imagine if each municipality has it's own portal, for example:
leudal.zorgloketlimburg.nl
maas.zorgloketlimburg.nl
What would be the most efficient way to fetch a different database for
different
)
db = DAL(db_uri)
On Tuesday, 29 July 2014 07:23:03 UTC-5, Ruud Schroen wrote:
Hi list,
I'm working on a portal where people can look for healthcare in a given
municipality.
Imagine if each municipality has it's own portal, for example:
leudal.zorgloketlimburg.nl
maas.zorgloketlimburg.nl
Just override the class that web2py gives the form in a css file like:
.web2py-class { color:#FF; }
On Saturday, July 19, 2014 2:56:08 PM UTC+2, bhavana r wrote:
since the default black color font is not seen on my page clearly(because
of the background color of the page which overlaps)
Hi guys,
I'm building a Blog module, which I will post here as soon as it's done.
But there's something wrong, I've defined a couple of tables in the module.
def define_tables(self):
category_tablename = self.settings.category_tablename
post_tablename =
Nevermind, it was because I initialized my module in a controller and not a
model.
On Tuesday, July 22, 2014 11:21:39 AM UTC+2, Ruud Schroen wrote:
Hi guys,
I'm building a Blog module, which I will post here as soon as it's done.
But there's something wrong, I've defined a couple of tables
I went for the virtual field approach.
My field in my model:
#Virtual field for showing categories in view
def categories(row):
links = db(db.post_to_cat.post_id == row.blog_post.id).select()
ids = [{'name':l.cat_id.name, 'slug':l.cat_id.slug} for l in links]
return ids
#Appending
Thanks for the info Massimo. I made a link table like you said.
Something like this is ok?
db.define_table('post_to_cat',
Field('post_id', 'reference blog_post'),
Field('cat_id', 'reference blog_cat')
)
Querying should be easy, there's just one
Hi group!
I'm building a small blog where the user has the ability to assign multiple
categories to blog posts.
My quesition is.. what is the proper way to query those posts?
db.define_table('blog_cat',
Field('name', 'string', label=T('Name of the category')),
Hi there,
In my app there is the possibility to become friends. This is my model:
db.define_table('friendship',
Field('source_user', 'reference auth_user'),
Field('target_user', 'reference auth_user'),
Field('accepted', 'boolean', default=False)
Web2Py Pages CMS
https://groups.google.com/forum/#!searchin/web2py/web2py$20cms/web2py/9c0xOpsZlac/3sYjl8CNu4MJ
This is a basic CMS. You can create pages, add all sorts of page items,
have SEO friendly URLs and more.
You should check it out.
--
Resources:
- http://web2py.com
-
Thanks for your answer.
I know about the OR operators. The problem is that it now fetches the
entire friendships records.
I need a list with ID's other then the user's own ID. For example when I
fetch a friendship record, the ID of the friend can either be the
source_user or the target_user.
That's exactly what I was looking for. Thanks!
Op 5-jun.-2014 15:42 schreef Leonel Câmara leonelcam...@gmail.com:
my_friends = db((db.friendship.accepted == True)
((db.friendship.source_user == auth.user_id) | (db.friendship.target_user
== auth.user_id))).select()
my_friends_ids =
Hi,
I'm trying to use the pagination from web2py_utils with two queries.
Usually the code looks like this:
query = db.table.id 0
count = db(query).count()
results = db(query).select(orderby=~db.table.created_on)
orderby = ~db.table.id
pcache = (cache.ram, 15)
paginate =
I tried that, it returns zero results..
Also when i print the query, this comes out:
((kamernet.province = 'Limburg') AND (kamernet.province = 'North Brabant'))
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Web2Py seems to start, but everytime i load the page i get a ticket.
When i try to open the ticket it says:
admin disabled because unable to access password file
My routes.py is like this:
routes_in = (
('/socket.io/$anything', '/iochat/default/socketio/$anything'),
)
--
Resources:
-
Al of a sudden my callbacks aren't working. Whenever i specify :eval as the
target, i get this error:
Uncaught Error: Syntax error, unrecognized expression: #:eval
which comes from jquery.js
This is my callback trigger, returned from a function:
return A(T('Send friend request'),
new_button = SPAN(XML(T(#10004; Friend request sent)), _class='button
white friendship')
return jQuery('#friendship_button').replaceWith('%s'); % new_button
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Thanks Derek! Although i went for another approach:
I removed target=':eval' from the A helper, and instead of using a return,
i used response.js
So now it's like this
new_button = SPAN(XML(T(#10004; Friend request sent)), _class='button
white friendship')
response.js =
Hi,
I've got a A helper with a callback function, which is created in the
controller
return A(T('Send friend request'), callback=URL('friendship', args=[
'request', user.id]), _class='bt_white sendrequest', _id='friendship_button'
, target=':eval')
It used to render this:
a class=bt_white
It no longer follows the href, but it now gives me this jQuery error:
Uncaught Error: Syntax error, unrecognized expression: #:eval
I am using the jquery.js from the welcome app
On Monday, April 21, 2014 6:56:41 PM UTC+2, Ruud Schroen wrote:
Hi,
I've got a A helper with a callback function
Hi,
I'm using the web2py MENU helper, but whenever i visit a page, the MENU
helper does not add a active class to the li..
In the view:
{{=MENU(response.menu,_id='navigation')}}
In the model:
submenu=[]
response.menu = [(T('Home'), False, URL('default','index'), submenu)]
Nevermind, already did it. Was just some simple math ;)
On Saturday, March 15, 2014 2:49:50 PM UTC+1, Ruud Schroen wrote:
I'm building a small forum for my website.
In a topic, you will see 10 posts per page. Outside the topic, in the
forum overview, each topic will have a shortcut
Hi there,
I'm creating a small forum for my website. When you view a topic you will
see 10 posts per page. I'm using the pagination from web2py utils.
Outside the topic (in the forum overview) i want each topic to have a
shortcut to the most recent post.
How do i find out which page i have to
I'm building a small forum for my website.
In a topic, you will see 10 posts per page. Outside the topic, in the forum
overview, each topic will have a shortcut to the most recent post.
How do i find out which page to redirect to (the page where the most recent
post is)?
(there is another
http://www.web2pyslices.com/slice/show/1642/login-with-username-and-email
On Friday, December 9, 2011 1:22:57 PM UTC+1, Francisco Costa wrote:
lots of users on login form submit their email instead of the
username..
it seems that auth.define_tables(username=True) forces username login
but
Hi,
I'm currently working with an affiliate program from Daisycon.
They offer productfeeds in the form of XML, XML attributes and CSV. I went
for the CSV because it's easier to import.
There's only one problem.
When I look at an exported csv file in a basic texteditor, it looks like
this:
Nevermind, I went for the XML approach and I got it working now :)
On Thursday, February 13, 2014 11:08:04 PM UTC+1, Ruud Schroen wrote:
Hi,
I'm currently working with an affiliate program from Daisycon.
They offer productfeeds in the form of XML, XML attributes and CSV. I went
for the CSV
I see some applications in web2py appliances that use modules instead of
models.
Is there an advantage to this?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report
Hi,
I'm building a pdf using Template from pyfpdf.
Whenever i try to add a second page like this:
f = Template(format=A4,
elements = elements,
title=Sample Invoice, author=Sample Company,
subject=Sample Customer, keywords=Electronic TAX Invoice)
http://experts4solutions.com/
Is this what you are looking for?
On Friday, January 10, 2014 10:59:10 AM UTC+1, Timothy Swieter wrote:
I've got a couple web ideas I'd like to put into motion. Some work will
be done by myself, other work I'd like an expert (or at least someone more
I have my login form in the index page.
Is there a way to set the default login page to index? For example when try
to open a page where you need to be logged in.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
{{=login.custom.begin}}
{{=login.custom.email}}
{{=login.custom.password}}
{{=login.custom.submit}}
{{=login.custom.end}}
How do i give the custom email, password and submit an ID/class?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
I have a translatable string inside a jquery selector. I properly escaped
the single quotes cause i don't get an error from jquery.
$(#resultemail).removeClass().addClass('error').text('{{=T(Sorry, we
don\\'t know you...)}}').fadeTo(900,1);
But the string is not showing up in my language
that line?
On Thursday, January 9, 2014 6:31:40 PM UTC-5, Ruud Schroen wrote:
I have a translatable string inside a jquery selector. I properly escaped
the single quotes cause i don't get an error from jquery.
$(#resultemail).removeClass().addClass('error').text('{{=T(Sorry, we
don\\'t know you
So.. angularjs should be used when i want to create a website with lots of
javascript/AJAX?
On Sunday, January 5, 2014 11:06:43 PM UTC+1, Ruud Schroen wrote:
I see more and more about using angularjs with web2py.
But why? What would be an example of a benefit from using those two.
Cause
Have you found a solution for this yet? I'm struggling with this as well..
On Thursday, September 10, 2009 5:21:11 AM UTC+2, eddwinston wrote:
Hi,
I am trying to make an ajax login, I am currently sending request to
this url: [app]/default/user/login. But it has been fruitless. I just
I see more and more about using angularjs with web2py.
But why? What would be an example of a benefit from using those two.
Cause when i look at AngularJS, it already looks alot like web2py.
Not saying that it's a bad idea, just wondering ;)
--
Resources:
- http://web2py.com
-
Hi,
I want to add a class to the body depending on the controller and function
(like Drupal does for example).
My function (in db.py):
def get_page_class():
page_class = 'page-%s-%s' % (request.controller, request.function)
return page_class
And in my view:
body
is you can't overrule it somewhere.
If anyone knows a solution that will be greatly appreciated, and we can
finally make a plugin for it.
On Tuesday, November 19, 2013 9:23:42 AM UTC+1, Ruud Schroen wrote:
Hi,
I'm here to share a great module with you. It's called *web2py-pages*,
created
I think my question was a bit unclear.
What i mean this when you want to browse for a file to upload, a window
pops up, which allows you to select a file from your computer.
Inside this window i want only image extensions able to be selected.
Example:
When you want to send a file attachment on
Didn't know it was that easy..
Thanks alot anyway, your first reply might come in handy sometime.
On Wed, Dec 18, 2013 at 2:02 PM, Leonel Câmara leonelcam...@gmail.comwrote:
Oh then you can use this
http://www.w3schools.com/tags/att_input_accept.asp
--
Resources:
- http://web2py.com
-
Nice! I'll try it out later today!
Just one question, does the web2py validation also work on this? For
example IS_IMAGE?
On Monday, December 16, 2013 7:21:01 PM UTC+1, Leonel Câmara wrote:
I did this to see how I could integrate dropzone.js (
http://www.dropzonejs.com/ ) with web2py as
Ah! Very nice :)
On Tue, Dec 17, 2013 at 1:22 PM, Leonel Câmara leonelcam...@gmail.comwrote:
Yes, all validators work since the usual SQLFORM form processing is always
done. IS_IMAGE is actually demonstrated to work in this demo as we needed
that to make the thumbnails.
--
Resources:
-
Hi,
Is it possible to translate the strings inside requires=IS_IN_SET?
For example i have
requires=IS_IN_SET(('Allowed','Not allowed'))
Now i'd like to translate Allowed and Not allowed
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
Would this work?
On Saturday, November 16, 2013 1:21:07 PM UTC+1, Paolo Caruccio wrote:
The IS_IN_SET validator allows to list the options as a dictionary (
http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=IS_IN_SET
)
Therefore, for an example, you could do:
def
('Cherry')}
with
options = (('Apple',T('Apple')), ('Banana',T('Banana')), ('Cherry',T(
'Cherry')))
On Thursday, 12 December 2013 08:12:50 UTC-6, Ruud Schroen wrote:
Would this work?
On Saturday, November 16, 2013 1:21:07 PM UTC+1, Paolo Caruccio wrote:
The IS_IN_SET validator allows
Hi,
I have a model which contains a couple of upload fields, they all have
requires=IS_IMAGE
Right now when you browse for a file you can select any file you want, but
i'd like users to only be able to browse for image files (for example .png
and .jpeg)
I know that this doesn't really matter
Works like a charm! Thanks alot :)
On Wed, Dec 4, 2013 at 11:55 PM, Ruud Schroen r...@formatics.nl wrote:
Thanks alot! I'll check it out tommorow :) i'll let you know if it worked
On Wed, Dec 4, 2013 at 9:54 PM, Paolo Caruccio paolo.carucci...@gmail.com
wrote:
There are several
it should
work also with foundation (I tested the code with foundation 5.0.2) and
also with jquery 1.9
Il giorno martedì 3 dicembre 2013 00:01:21 UTC+1, Ruud Schroen ha scritto:
Hi,
I know this is an old thread, but I have a question.
The upload and everything is working fine, but for some reason
Hi,
I'm running web2py on my laptop with Ubuntu and i'd like to test my
websites in IE.
So i'd like to test my local web2py website my desktop, which is a Windows
machine.
How do i achieve this?
Thanks in advance.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
Hi,
I know this is an old thread, but I have a question.
The upload and everything is working fine, but for some reason it doesn't
work when bootstrap.min.css (the default one by web2py) is NOT included.
This is kinda stupid because i'm using Foundation. Any idea what's going on?
On Friday,
Hi,
I'm developing a portal for students where they can search for places they
can rent.
It features an option where you select a location and a maximum allowed
distance.
The locations you can choose from have a hard-coded geolocation. The
records in for example *db.places* also have a
I found a Python version of the link you posted:
loc = GeoLocation.from_degrees(51.441642, 5.469722)
distance = 1000 # 1 kilometer
SW_loc, NE_loc = loc.bounding_locations(distance)
print SW_loc
print NE_loc
print loc.distance_to(SW_loc)
print loc.distance_to(NE_loc)
This function should
Great story! I really like the part where he explains the solution for
fetching random records in a large database.
On Thursday, November 28, 2013 1:56:51 AM UTC+1, Massimo Di Pierro wrote:
http://www.reddit.com/r/Python/comments/1rlcwl/scaling_stereodose_a_web2py_internet_radio_station/
--
You can still use SQLFORM, but have standard html inputs.
Example:
{{=form.custom.begin}}
..enter your html input here with attribute: *name**=NAME OF YOUR FIELD*
{{=form.custom.end}}
You can find more info about custom forms
herehttp://www.web2py.com/book/default/chapter/07#Custom-forms
Hi,
I have a swipe-slider with 4 database records in them. When you swipe to
the left and reach the end of the slider, there will be inserted more
content via AJAX (like a pull to refresh).
When I try to GET the data, the controller takes the ID of the last slide
given by args. Now i want the
A simple way of doing it would be adding a field with a string set (avatar
1, avatar 2 , avatar 3).
Then in the view you can show a image based on which string the user chose.
Example
{{if (row.avatar == avatar 1):}}
{{url to first image..}}
{{elif (row.avatar == avatar 2):}}
{{url to second
Hi,
I'm here to share a great module with you. It's called *web2py-pages*, created
by Formatics http://www.formatics.nl which I'm currently working for. You
can download it here: web2py-pageshttps://github.com/acidjunk/web2py-pages
Pages module for web2py gives you a good starting point for
? ;-)
mic
2013/11/19 Ruud Schroen r...@formatics.nl
Hi,
I'm here to share a great module with you. It's called *web2py-pages*,
created
by Formatics http://www.formatics.nl which I'm currently working for.
You can download it here:
web2py-pageshttps://github.com/acidjunk/web2py-pages
Pages
those lines to match the locations to this and your app,
then run the file in a terminal like this:
*./copy_to_app.sh*
On Tuesday, November 19, 2013 9:23:42 AM UTC+1, Ruud Schroen wrote:
Hi,
I'm here to share a great module with you. It's called *web2py-pages*,
created
by Formatics http
Is it possible to translate the strings in the requires=IS_IN_SET?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you
I got the errors working. I forgot to use form.errors like you said. Do you
guys also know of a way to show an error if the password is incorrect?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Hi,
I am building my login form with the form.custom.widget, because I don'
like the standard layout of the forms.
Now the problem is, I can't get the errors to display.
Here is my controller:
def login():
form=auth.login()
if form.accepts(request,session):
response.flash =
Hi. I posted a topic earlier about html2canvas to db. Now i got a new issue
so i figured i'd start a new thread.
html2canvas takes a screenshot of all the content inside a div and creates
a canvas which acts as the image. After that the canvas is converted to a
base64 code. I send this code a
(html) {
$('#results').html(html);
}
});
return false;
}
in controller:
def update():
return db().insert(data = request.vars.data)
Vào 04:32:53 UTC+7 Thứ bảy, ngày 12 tháng mười năm 2013, Ruud Schroen đã
viết:
Hi,
I am creating a app which uses html2canvas to create
Hi,
I am creating a app which uses html2canvas to create a screenshot of all
content inside a specific div. It generates a canvas which acts as the
screenshot. Now it is also possible to generate a image which you can
download directly.
Is it possible to upload this as a image to a db record?
I think you need to, if using pyforum, change the required roles in the
controllers.. That's all
On Monday, September 30, 2013 12:12:45 AM UTC+2, Tobias Dahlberg wrote:
Hi
I'm looking for a forum plugin that I can use to extend a web2py
application. I need a forum plugin that uses
Hi, i'm working on a project atm and im using web2admin as the admin
interface.
Is there a way to show different table names depending on the language? The
table names don't actually have to change, but i would like web2py to show
translations in the grid.
(BTW: i'm NOT talking about field
Hi,
I'm currently building my own blog system, and i have a function which
allows a post to be deleted by its poster. But i would like web2py to
prompt a windows first saying Are you sure?
When you click yes it should delete the item, if you click no.. then
nothing happens
How would i go
83 matches
Mail list logo