I have this many to many relationship example:
db.define_table('location',
Field('geom', 'geometry()'))
db.define_table('item',
Field('name'))
db.define_table('item_location',
Field('item', db.item),
Field('location_one', db.location),
Field('location_two', db.location))
T
) &
> (location_one.geom.st_equals(point_x_y)) & (location_two.geom.
> st_equals(point_n_m))).select(db.item.ALL)
>
> Alex
>
> Am Dienstag, 27. August 2013 19:43:08 UTC+2 schrieb Apple Mason:
>>
>> I have this many to many relationship example:
>
7;)
>
>
> I hope this works.
>
> Am Dienstag, 27. August 2013 21:51:56 UTC+2 schrieb Apple Mason:
>>
>> Hey Alex,
>>
>> Thanks for the suggestion. The problem with the query is that
>> 'location_one.geom.st_equals(point_x_y)' won't work
I keep getting 502 Bad Gateway, and I'm not sure why. I followed the Nginx
deployment recipe on the website, with the following changes:
/etc/uwsgi/web2py.xml: Used /var/www-data/web2py/ instead of
/home/www-data/web2py/
nginx conf: server_name is my server ip (I don't have a domain name)
inst
quested: 0 --
On Thursday, August 29, 2013 3:10:20 PM UTC-4, Niphlod wrote:
>
> what does uwsgi log show ?
>
> On Thursday, August 29, 2013 8:18:02 PM UTC+2, Apple Mason wrote:
>>
>> I keep getting 502 Bad Gateway, and I'm not sure why. I followed the
>> Ngi
The default register form has too many fields, so I created a slimmed-down
custom one:
register.html:
Username: {{=form.custom.widget.username}}
Email: {{=form.custom.widget.email}}
Password: {{=form.custom.widget.password}}
{{=form.custom.submit}}
default.py:
def register():
return d
_user[field].writable =
> False
> return dict(form=auth())
>
>
> Anthony
>
> On Friday, September 6, 2013 5:17:23 PM UTC-4, Apple Mason wrote:
>>
>> The default register form has too many fields, so I created a
>> slimmed-down custom one:
>>
>> register
On Friday, September 6, 2013 8:55:13 PM UTC-4, Anthony wrote:
>
> On Friday, September 6, 2013 7:51:54 PM UTC-4, Apple Mason wrote:
>
>> Oops, I do have form.custom.begin and form.custom.end. I had forgotten to
>> type it here.
>>
>> I also wanted a custom v
I created a custom profile view so that the user can create/update his
profile. Currently I have something like:
models/db.py:
db.define_table('images',
Field('image', 'upload', requires = IS_EMPTY_OR(IS_IMAGE()))
auth.settings.extra_fields['auth_user'] = [
Field('user_image', 'reference
your requirements making your own
> profile update/insert page, dealing with all the things you explained .
>
> On Monday, September 9, 2013 9:50:40 PM UTC+2, Apple Mason wrote:
>>
>> I created a custom profile view so that the user can create/update his
>> profile. Current
I would like to throw a 404 when a user tries to access something that
doesn't exist, like trying to access a non-existent comment by providing a
comment id that doesn't exist in the database. In these cases, web2py will
throw an exception and point to a ticket (ie, NoneType has no attribute
'i
Nevermind, I think I've figured things out. Although I noticed that
routes_onerror doesn't do anything if it's in the application-specific
routes.py. It works if I place it in the web2py root routes.py.
Is this intentional?
On Friday, September 20, 2013 2:27:20 AM UTC-4, Ap
I'm trying to shorten the url from something like:
www.example.com/myapp/default/index?page=1
to
www.example/com/index?page=1
I'm using pagination on the index page, so that's why you see the ?page=1
My routes.py is pretty standard:
routers = dict(
# base router
BASE=dict(
de
Thanks Jonathan, I ended just pointing the default function to a main() and
from there I redirected to my index() in my controller.
On Thursday, October 10, 2013 5:47:22 PM UTC-4, Jonathan Lundell wrote:
>
> On 9 Oct 2013, at 9:11 PM, Apple Mason >
> wrote:
>
> I'm tr
Suppose I have three different types of users: buyer, distributor, and
reseller.
All buyers, distributors, and resellers have an email, password, and
ratings. Since email and password are already part of auth_user, the
ratings Field will be an extra field in auth_user.
To separate the user rol
If we have a table full of products, but some products use slightly
different fields, how should this be represented?
For example, if I sell clothing and furniture:
clothing and furniture share these fields:
- price
- description
- stock
- name
clothing have these special fields:
- materia
My many-to-many table is throwing an error every time I access that table
in the admin page:
incomplete format
Traceback (most recent call last):
File "/home/apl/Desktop/web2py/gluon/restricted.py", line 217, in
restricted
exec ccode in environment
File "/home/apl/Desktop/web2py/applic
Nevermind, I figured it out. My format string was wrong. After fixing that,
everything works.
On Thursday, January 9, 2014 4:42:01 PM UTC-5, Apple Mason wrote:
>
> My many-to-many table is throwing an error every time I access that table
> in the admin page:
>
> incomplete forma
In the online doc on computed field, the computed fields uses a field in
the current table, and not in another table.
I modified the one-to-many example by adding a 'total_items' field on
person. If I want 'total_items' to be the sum of all items the person
currently has, and this field should
in db.person, you probably want to create _after_insert and
> _after_update callbacks for db.thing (see
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks
> ).
>
> Anthony
>
> On Tuesday, January 14, 2014 12:48:59
I read through the link you show me. I'm using _before_delete now, since
doing s.select() returns 0 rows since it's already been deleted. I'm not
sure how to deal with sets in _after_delete.
Here is my updated models:
db.define_table('person',
Field('name'),
Yeah, that thread says to use _before_delete, and it fits this use case.
Can you verify if what I'm seeing about the delete is correct? The
_before_delete is causing the admin panel to not delete the record for some
reason. Is it a bug?
I'm using web2py 2.7.4 stable
On Tuesday, January 14, 201
I have the following tables:
db.define_table('person',
Field('name', 'string'))
db.define_table('pet',
Field('name', 'string'),
Field('person_id', 'reference person'))
db.define_table('thing',
Field('name', 'string'),
Field('person_id', 'reference person'))
I have a person
able.filter == something).select(
> main_table, other_table,
> left=[other_table.on(main_table.some_id == other_table.reference),
>
> ]
> )
>
>
>
> On Wednesday, January 22, 2014 10:24:14 PM UTC+1, Apple Mason wrote:
>>
>>
>> I have the foll
I have a search bar that I want to display on every page, but something is
not working. Here is an example of what I have:
layout.html:
{{include 'default/searchbar.html'}}
In default/searchbar.html:
{{=form}}
But web2py doesn't find the searchbar controller function. I get a
My controller default.py:
def searchbar:
form = SQLFORM()
return (form=form)
On Monday, January 27, 2014 12:03:37 AM UTC-5, Apple Mason wrote:
>
> I have a search bar that I want to display on every page, but something is
> not working. Here is an example of wh
Oh, it's probably because the url is /index.html and not /searchform.html.
In that case, how would I create a search form that is present globally in
the site?
On Monday, January 27, 2014 12:04:43 AM UTC-5, Apple Mason wrote:
>
> My controller default.py:
>
> def searchbar:
>
On Monday, January 27, 2014 12:20:50 AM UTC-5, Apple Mason wrote:
>
> Oh, it's probably because the url is /index.html and not /searchform.html.
>
> In that case, how would I create a search form that is present globally in
> the site?
>
> On Monday, January 27, 2014
for search). How you create the form itself in the view
> depends on your needs. Do you just need a single text search field? What
> does the search function do to return results?
>
> Anthony
>
> On Monday, January 27, 2014 1:02:03 PM UTC-5, Apple Mason wrote:
>>
&
h form making GET requests open to the public? In that
> case, I don't think you need to worry about CSRF or input sanitizing.
>
> Anthony
>
> On Monday, January 27, 2014 2:16:04 PM UTC-5, Apple Mason wrote:
>>
>> If I manually create the raw html form and set the acti
I want to search across some many to many tables, but with certain
conditions.
db.define_table('person',
Field('name', 'string'),
Field('nickname', 'string'))
db.define_table('clothing',
Field('name', 'string'))
db.define_table('item',
Field('name', 'string'))
db.define_table(
d)
> )
>
> then, you can search it as
>
> what_I_want = (
> (db.person.name == 'Bob') &
>
> (db.item.name == 'item1')
> )
>
> rows = db(whole_set)(what_I_want).select()
>
> On Wednesday, January 29, 2014 6:29:10 AM UTC+1, A
; (db.person.id == db.clothing_person.person_id)
> ) #the reference
>q = q & (db.clothing.name.belongs(clothings))
>
> rows = db(q).select(db.person.ALL)
> return rows
>
>
>
>
>
> On Wednesd
If we have these simple models:
db.define_table('person',
Field('name', 'string'))
db.define_table('common_allergies',
Field('name', 'string'))
The common_allergies is a table full of common allergies that people may
have like 'peanuts' or 'bee stings'. This table is pre-populated by the
syst
I forgot to highlight code samples in my last post. Sorry about that.
If we have these simple models:
db.define_table('person',
Field('name', 'string'))
db.define_table('common_allergies',
Field('name', 'string'))
The common_allergies is a table full of common allergies that people may
35 matches
Mail list logo