Re: [web2py] Re: SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread 黄祥
please check discussion on :
https://groups.google.com/forum/?fromgroups=#!topic/web2py/6wU3AtkwtA0

there are 2 example apps on that.
hope this can help.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-24 Thread 黄祥
please use query : *db.person.created_by == db.auth.user.id* in your grid.
e.g.
@auth.requires_login()
def person():
created_by_user=db.person.created_by == db.auth.user.id
grid=SQLFORM.grid(db.person, user_signature=False, 
  editable=created_by_user, deletable=created_by_user)
return locals()

or you can try :
@auth.requires_login()
def person():
query=db.person.created_by == db.auth.user.id
grid=SQLFORM.grid(query, user_signature=False)
return locals()

hope this can help

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-24 Thread Sarbjit singh
Well, I was able to run the code. Problem with this is that in this case if 
user is "Manager", then all the rows are editable and if it is other user 
including "Admin", then rows are read only.

My requirement is let's say I have a database where each user can insert 
some data and at the same time can view other user's data BUT should be 
allowed to edit only data which is entered by that user.

E.g. :

Let's say data base looks like:

UserId  PersonName   RecordEntered
user1 username1   12345
user2  username223566
user3  username345566

If user1 is logged into system, then the result should look like (results 
in form of grid, grid is required because it provides pre-defined nice 
features of searching/sorting/exporting to csv which are required)

UserId  PersonName   RecordEntered
user1 username1   12345--> EDITABLE
user2  username223566  --> NON EDITABLE
user3  username345566  --> NON EDITABLE

Similarly when user2 is logged into system, he should be able to edit his 
own records but able to view other user records as well in the same grid.

Sorry for not explaining my requirement. But, I hope now the above example 
made my requirement clear.

Thanks
Sarbjit


-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Query Not Supported: (1054, "Unknown column 'daily_counts.add_date' in 'order clause'") No records f

2013-03-24 Thread Shawn Wheatley
I figured it out. I didn't read the section of the docs on smartgrid well 
enough. I now see you *can* pass multiple values to orderby and fields as a 
dictionary, with the table names as the keys.

Shawn

On Sunday, March 24, 2013 11:21:29 PM UTC-4, Shawn Wheatley wrote:
>
> Hmmm... I also just discovered that specifying fields on the smartgrid 
> causes issues with the child tables. It uses the same fields as the parent, 
> which don't exist and therefore displays empty rows. Is there a way to pass 
> another list of fields for the child table?
>
> On Sunday, March 24, 2013 11:17:24 PM UTC-4, Shawn Wheatley wrote:
>>
>> I am seeing a similar issue using smartgrid for a master-detail invoice 
>> view. When clicking on the link for my detail child records, I get an error 
>> saying the column I'm ordering by in the master doesn't exist. Has this 
>> been resolved yet? Dan, did you open a ticket for this?
>>
>> Shawn
>>
>> On Monday, February 25, 2013 9:01:57 PM UTC-5, Dan Kozlowski wrote:
>>>
>>> *Massimo,
>>>
>>> When I removed the orderby clause it solved problem with the error 
>>> message. but I still need to sort the grid in desc order.
>>> *
>>>
>>>
>>>
>>>
>>> def dailycounts():
>>> grid=SQLFORM.smartgrid(db.daily_counts,  
>>> user_signature=False,create=False,editable=False,deletable=False,*
>>> orderby=~db.daily_counts.add_date*, 
>>> fields=[db.daily_counts.add_date,db.daily_counts.encrypt_count,db.daily_counts.decrypt_count,db.daily_counts.error_count,db.daily_counts.cycle_count,db.daily_counts.directory_create_count,db.daily_counts.client_add_count])
>>> return locals()
>>>
>>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Query Not Supported: (1054, "Unknown column 'daily_counts.add_date' in 'order clause'") No records f

2013-03-24 Thread Shawn Wheatley
Hmmm... I also just discovered that specifying fields on the smartgrid 
causes issues with the child tables. Is there a way to pass another list of 
fields for the child table?

On Sunday, March 24, 2013 11:17:24 PM UTC-4, Shawn Wheatley wrote:
>
> I am seeing a similar issue using smartgrid for a master-detail invoice 
> view. When clicking on the link for my detail child records, I get an error 
> saying the column I'm ordering by in the master doesn't exist. Has this 
> been resolved yet? Dan, did you open a ticket for this?
>
> Shawn
>
> On Monday, February 25, 2013 9:01:57 PM UTC-5, Dan Kozlowski wrote:
>>
>> *Massimo,
>>
>> When I removed the orderby clause it solved problem with the error 
>> message. but I still need to sort the grid in desc order.
>> *
>>
>>
>>
>>
>> def dailycounts():
>> grid=SQLFORM.smartgrid(db.daily_counts,  
>> user_signature=False,create=False,editable=False,deletable=False,*
>> orderby=~db.daily_counts.add_date*, 
>> fields=[db.daily_counts.add_date,db.daily_counts.encrypt_count,db.daily_counts.decrypt_count,db.daily_counts.error_count,db.daily_counts.cycle_count,db.daily_counts.directory_create_count,db.daily_counts.client_add_count])
>> return locals()
>>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Query Not Supported: (1054, "Unknown column 'daily_counts.add_date' in 'order clause'") No records f

2013-03-24 Thread Shawn Wheatley
I am seeing a similar issue using smartgrid for a master-detail invoice 
view. When clicking on the link for my detail child records, I get an error 
saying the column I'm ordering by in the master doesn't exist. Has this 
been resolved yet? Dan, did you open a ticket for this?

Shawn

On Monday, February 25, 2013 9:01:57 PM UTC-5, Dan Kozlowski wrote:
>
> *Massimo,
>
> When I removed the orderby clause it solved problem with the error 
> message. but I still need to sort the grid in desc order.
> *
>
>
>
>
> def dailycounts():
> grid=SQLFORM.smartgrid(db.daily_counts,  
> user_signature=False,create=False,editable=False,deletable=False,*
> orderby=~db.daily_counts.add_date*, 
> fields=[db.daily_counts.add_date,db.daily_counts.encrypt_count,db.daily_counts.decrypt_count,db.daily_counts.error_count,db.daily_counts.cycle_count,db.daily_counts.directory_create_count,db.daily_counts.client_add_count])
> return locals()
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error when listing newly created database tables from appadmin

2013-03-24 Thread Spring
I think I kinda figured out the problem. The order of defining tables seems 
matter. Tables to be referenced need to be defined before the referencing 
tables. Guess it's a rookie mistake.

Spring

在 2013年3月25日星期一UTC+8上午9时13分56秒,Spring写道:
>
> Hello Alan,
>
> Thanks for the reply. I noticed the common thing of the two error tables 
> is that they're both referenced by some other tables while do not reference 
> to any. Showing one of referencing table:
>
> db.define_table('t_clients_in',
> Field('f_account_id', type='reference t_accounts', 
>   label=T('Account ID')),
> Field('f_lead_id', type='reference t_leads',
>   label=T('Lead ID')),
> Field('f_status', type='string',
>   label=T('Involvement Status')),
> Field('f_sow', type='string',
>   label=T('Scope of Work')),
> Field('f_needs', type='list:string',
>   label=T('Needs')),
> #Field('f_last_update', type='datetime',
> #  label=T('Last Update')),
> Field('f_remarks', type='list:string',
>   label=T('Remarks')),
> auth.signature,
> format='%(f_account_id)s',
> migrate=settings.migrate)
>
> I'm not sure if the table reference was used correctly in field definition.
> Now I hashed out all datetime field definition because I found there was 
> two fields of "modified_on" and "created_on" which i have no idea where 
> they're from since I didn't define them...
>
> One more question here is, for the above table "t_clients_in", the first 
> two fields "f_account_id" and "f_lead_id" refer to another two tables 
> respectively. When use "new record" in Appadmin, "f_account_id" is a 
> fill-in while "f_lead_id" becomes a dropdown (which is good). I cannot see 
> where the difference comes from. 
>
> Thanks in advance.
>
> Spring
>
>
>
>
>
>
>
>
>> I think the problem may not be about the table definitions, but about the 
>> data that DAL is trying to retrieve for the datetime type fields. Are you 
>> reading a database from another application?
>>
>> I'd check that the values stored for the datetime fields have the proper 
>> format.
>>
>>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error when listing newly created database tables from appadmin

2013-03-24 Thread Spring
Hello Alan,

Thanks for the reply. I noticed the common thing of the two error tables is 
that they're both referenced by some other tables while do not reference to 
any. Showing one of referencing table:

db.define_table('t_clients_in',
Field('f_account_id', type='reference t_accounts', 
  label=T('Account ID')),
Field('f_lead_id', type='reference t_leads',
  label=T('Lead ID')),
Field('f_status', type='string',
  label=T('Involvement Status')),
Field('f_sow', type='string',
  label=T('Scope of Work')),
Field('f_needs', type='list:string',
  label=T('Needs')),
#Field('f_last_update', type='datetime',
#  label=T('Last Update')),
Field('f_remarks', type='list:string',
  label=T('Remarks')),
auth.signature,
format='%(f_account_id)s',
migrate=settings.migrate)

I'm not sure if the table reference was used correctly in field definition.
Now I hashed out all datetime field definition because I found there was 
two fields of "modified_on" and "created_on" which i have no idea where 
they're from since I didn't define them...

One more question here is, for the above table "t_clients_in", the first 
two fields "f_account_id" and "f_lead_id" refer to another two tables 
respectively. When use "new record" in Appadmin, "f_account_id" is a 
fill-in while "f_lead_id" becomes a dropdown (which is good). I cannot see 
where the difference comes from. 

Thanks in advance.

Spring








> I think the problem may not be about the table definitions, but about the 
> data that DAL is trying to retrieve for the datetime type fields. Are you 
> reading a database from another application?
>
> I'd check that the values stored for the datetime fields have the proper 
> format.
>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] second controller file not found

2013-03-24 Thread BlueShadow
Hi,
I added a second controller to my app to seperate admin functions to a 
diffrent controller. but my problem is that I can't even get the index.html 
to work with the second controller I always get a file not found.
I suspect it has something todo with my routes.py: because I don't have to 
call sites with the controller: www.mydomain/MyApp/Controller/Funktion I 
can simply do www.mydomain/funktion
#!/usr/bin/python
# -*- coding: utf-8 -*-


routers = dict(
  BASE  = dict(
  domains = {
  'mydomain.com' : 'Myapp',
  'www.mydomain.com' : 'Myapp',
  }
  ),
  Myapp = dict(
  root_static=['Favicon.ico', 'robots.txt','humans.txt']
  )
)


routes_onerror = [
('Myapp/*', '/Myapp/default/error_site')

the first controller is called default and the second manage.py
Sry I can't give any more information because I got no clue why this should 
not work.
I tried opening the page from the controler from the view and I always get 
a 404 Error


-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread Ergun Pekuysal
Thank you so much. Is it possible to create the invoice and the details on
the same page?

Sent from my iPhone

On 24 Mar 2013, at 22:02, Alan Etkin  wrote:

Thank you. Can u pls provide a sample code for this?
>

Derived from the book example (at the end of the Chapter 7, in the
smartgrid section)

@auth.requires_login():
def invoice():
constraints=dict(invoice=db.invoice.id==,
 details=db.details.invoice_id==)
grid = SQLFORM.smartgrid(db.invoice,
 constraints=constraints,
 linked_tables=['details'])
return locals()


You'd need also a previous action to create the invoice or else use a one
time form to create the invoice the first time the user visits the page.

 --

---
You received this message because you are subscribed to a topic in the
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/E8KnPq0ZGqM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to
web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread Alan Etkin

>
> Thank you. Can u pls provide a sample code for this?
>

Derived from the book example (at the end of the Chapter 7, in the 
smartgrid section)

@auth.requires_login():
def invoice():
constraints=dict(invoice=db.invoice.id==,
 details=db.details.invoice_id==)
grid = SQLFORM.smartgrid(db.invoice,
 constraints=constraints,
 linked_tables=['details'])
return locals()

 
You'd need also a previous action to create the invoice or else use a one 
time form to create the invoice the first time the user visits the page.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How can I store upload original filename using smartgrid?

2013-03-24 Thread James Burke
Found exactly what I was after here:
http://stackoverflow.com/questions/8008213/web2py-upload-with-original-filename/8185933#8185933

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread Ergun Pekuysal
Thank you. Can u pls provide a sample code for this?

Sent from my iPhone

On 24 Mar 2013, at 19:37, Alan Etkin  wrote:

Hi,
> Here the codes. Is there a quick way add multiple child objects to a
> parent in one page?
>
> Which are the children and which are the parets?. It seems that you want
to add many invoice details without requesting new form pages (within the
same invoice page).

I think that it's possible to build a customized parent child manager with
SQLFORM.smartgrid. However, it would require a page reload for each new
child, AFAIK.

Another possible approach would be a combination of normal crud/SQLFORM
form, a LOADed, self-submitted child form. and perhaps a component with a
list of children and a callback bound to the child component submit event.

-- 

---
You received this message because you are subscribed to a topic in the
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/E8KnPq0ZGqM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to
web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How can I store upload original filename using smartgrid?

2013-03-24 Thread Massimo Di Pierro
that works for a form but not for smartgrid. you can try this (a hack):

   if request.vars.file != None:
  db.client.filename.default = request.vars.file.filename
   form  = SQLFORM.smartgrid(db.client, fields=fields, linked_tables=['file'
])


On Friday, 22 March 2013 16:14:58 UTC-5, James Burke wrote:
>
> I'm having trouble working this one out. I've tried using the example in 
> the book with no success.
>
> Model:
>
> db.define_table('file',
>Field('client', 'reference client'),
>Field('file', type='upload', autodelete=True),
>Field('filename', 'string'),
>format='%(file)s')
>
> Controller:
>
> def client():
>fields = dict(client=[db.client.company_name, db.client.live, db.client
> .contact_name, db.client.billing_code])
>form  = SQLFORM.smartgrid(db.client, fields=fields, linked_tables=[
> 'file'])
>
>if request.vars.file != None:
>   form.vars.filename = request.vars.file.filename
>
>return dict(form=form)
>
> Any help is appreciated.
>
> -James
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] problems with import in 2.4.4 and 2.4.5

2013-03-24 Thread puercoespin
With the same packaged app, in 2.3 works well, but in 2.4.4 and 2.4.5 raise 
an import error:

ImportError: cannot import name haversine_distance2



And refers to this sentence : 

from geo_utils import haversine_distance2



geo_utils is in the modules folder, with his _init_.py files and reloading 
the server.





-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: style input class="upload" the Boostrap way

2013-03-24 Thread Anthony
Are you using SQLFORM? Note, you can do SQLFORM(..., 
formstyle='bootstrap'). If that doesn't yield what you're looking for, you 
can do SQLFORM(..., formstyle=custom_function). See 
https://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#773 for an 
example of such a function.

Anthony

On Sunday, March 24, 2013 4:17:04 AM UTC-4, Annet wrote:
>
> I am looking for a way to style this:
>
> 
>
> more in line with the Bootstrap styling of the input and button style, as 
> described
> in the buttons instead of text section of 
> http://twitter.github.com/bootstrap/base-css.html#forms
>
>
> Kind regards,
>
> Annet
>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: style input class="upload" the Boostrap way

2013-03-24 Thread Niphlod
create your own widget http://web2py.com/books/default/chapter/29/07#Widgets

On Sunday, March 24, 2013 9:17:04 AM UTC+1, Annet wrote:
>
> I am looking for a way to style this:
>
> 
>
> more in line with the Bootstrap styling of the input and button style, as 
> described
> in the buttons instead of text section of 
> http://twitter.github.com/bootstrap/base-css.html#forms
>
>
> Kind regards,
>
> Annet
>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread Niphlod
it's just to keep track of projects running on web2py if they are 
open-source even better  I'll notice Anthony or Massimo to get this 
repo included...

On Sunday, March 24, 2013 10:55:32 AM UTC+1, Loïc wrote:
>
> Niphlod,
> I would be pleased to contribute. What should I do?
>
> Le dimanche 24 mars 2013 00:08:40 UTC+1, Niphlod a écrit :
>>
>> candidate for submission on the poweredby ? or appliances ?
>>
>> On Saturday, March 23, 2013 8:34:39 PM UTC+1, Loïc wrote:
>>>
>>> Hi Marcel
>>>
>>> For my personal use I developed a basic CMS. The goal was to have 
>>> something very simple to use.
>>> Some features need to be improved, but I released the project recently.
>>> You can have a look at https://github.com/espern/tiny_website
>>>
>>> Regards
>>>
>>> Le mercredi 13 mars 2013 00:06:09 UTC+1, mjm a écrit :

 Hi Massimo 

 auth.wiki seems useful, but mostly for the site developer, not user 
 friendly enough for site owner/user IMHO. Something like Plone is overkill 
 for a website. I'd like to see something simple and polished somewhere in 
 between.
 I'd be hesitant to use projects like Instant Press and Movuca that seem 
 (almost) abandoned. I'll have a look at w2cms.

 Marcel


 On Tuesday, March 12, 2013 11:18:54 PM UTC+1, Massimo Di Pierro wrote:
>
> The builit-in wiki despite the misleading name, is kind of a CMS. You 
> have pages. Pages have attachements. Pages have 
> permissions. Attachments inherit permissions. If you think of a page as a 
> folder, this is a CMS lite. ;-)
>
> There is InstantPress, there is movu.ca and there is w2cms (
> https://github.com/mdipierro/w2cms experimental to be revived).
>
> On Tuesday, 12 March 2013 16:31:23 UTC-5, mjm wrote:
>>
>> I really like Web2Py to get things done without much fuss. But I am 
>> somewhat surprised there seems to be no CMS for W2P. 
>>
>> Projects mentioned in this context on this list Instant Press and 
>> Movuca are not very active: Instant Press has seen no releases since 
>> 2010. 
>> Movuca almost no commits in the last year, the website is gone. A shame 
>> really, it seemed quite promising. 
>> Auth.wiki is a nice recent addition to W2P but seems geared to 
>> developers, not end users. 
>>
>> Are there any projects I missed? 
>>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error when listing newly created database tables from appadmin

2013-03-24 Thread Alan Etkin

>
> Hi there,
>
> I've created 7 tables from my app and 2 of them cause error when to be 
> listed from Appadmin (/appadmin/select/db?query=db.t_leads.id>0). Don't 
> see anything particular in the table definition that may cause the problem. 
> Any help would be apprecicated.
>

I think the problem may not be about the table definitions, but about the 
data that DAL is trying to retrieve for the datetime type fields. Are you 
reading a database from another application?

I'd check that the values stored for the datetime fields have the proper 
format.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Free host for blog with domain?

2013-03-24 Thread Relsi Hur Maron
- OpenShift
- Amazon Web Services (1 year free)


2013/3/24 Mika Sjöman 

> Hi
>
> I wonder if anyone knows where I can put my we2py based blog up where they
> I also can use myOwnDomain.com for free? Not too much traffic, maybe a 100
> a day
>
> And... I just build a community from scratch in two weeks from scratch
> with web2py, coming from django - I must say I LOVE web2py!
>
> Huge thanks!
>
> --
>
> ---
> 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...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Free host for blog with domain?

2013-03-24 Thread Alan Etkin

>
> I wonder if anyone knows where I can put my we2py based blog up where they 
> I also can use myOwnDomain.com for free? Not too much traffic, maybe a 100 
> a day
>
>  
IIRC there was a list of web2py aware hostings in this group. Did you try a 
group search? Otherwise you can use this list instead 
http://groups.google.com/group/web2py-usuarios/browse_thread/thread/ca02267c4037b5d6
 
(although no one expected it to be in spanish)

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Compute fields are not computed on insert

2013-03-24 Thread Alan Etkin

>
> Hi,
> I have added computed fields to db model, but they are not computed on 
> insert. Code is supplied below.
> Thanks
>
>
Maybe the computation order is failing, since you have three linked 
computed fields. It could be that you need a custom callback for updating 
all the vars in the proper order before db I/O

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread Alan Etkin

>
> Hi,
> Here the codes. Is there a quick way add multiple child objects to a 
> parent in one page?
>
> Which are the children and which are the parets?. It seems that you want 
to add many invoice details without requesting new form pages (within the 
same invoice page).

I think that it's possible to build a customized parent child manager with 
SQLFORM.smartgrid. However, it would require a page reload for each new 
child, AFAIK.

Another possible approach would be a combination of normal crud/SQLFORM 
form, a LOADed, self-submitted child form. and perhaps a component with a 
list of children and a callback bound to the child component submit event.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread mjm
Hi Derek

Web2Py might be backward compatible but neither Movuca nor InstantPress 
work out of the box. That does not inspire others to contribute ;-)

Marcel


On Wednesday, March 13, 2013 1:58:24 AM UTC+1, Derek wrote:
>
> Well, the thing about web2py is that it's been backwards compatible from 
> the start, so an abandoned project should work just fine in the latest 
> version of Web2py. The way it's laid out, it makes modifying code easy as 
> well. Don't be afraid to pick up an older CMS and run with it.
>
> On Tuesday, March 12, 2013 4:06:09 PM UTC-7, mjm wrote:
>>
>> Hi Massimo 
>>
>> auth.wiki seems useful, but mostly for the site developer, not user 
>> friendly enough for site owner/user IMHO. Something like Plone is overkill 
>> for a website. I'd like to see something simple and polished somewhere in 
>> between.
>> I'd be hesitant to use projects like Instant Press and Movuca that seem 
>> (almost) abandoned. I'll have a look at w2cms.
>>
>> Marcel
>>
>>
>> On Tuesday, March 12, 2013 11:18:54 PM UTC+1, Massimo Di Pierro wrote:
>>>
>>> The builit-in wiki despite the misleading name, is kind of a CMS. You 
>>> have pages. Pages have attachements. Pages have 
>>> permissions. Attachments inherit permissions. If you think of a page as a 
>>> folder, this is a CMS lite. ;-)
>>>
>>> There is InstantPress, there is movu.ca and there is w2cms (
>>> https://github.com/mdipierro/w2cms experimental to be revived).
>>>
>>> On Tuesday, 12 March 2013 16:31:23 UTC-5, mjm wrote:

 I really like Web2Py to get things done without much fuss. But I am 
 somewhat surprised there seems to be no CMS for W2P. 

 Projects mentioned in this context on this list Instant Press and 
 Movuca are not very active: Instant Press has seen no releases since 2010. 
 Movuca almost no commits in the last year, the website is gone. A shame 
 really, it seemed quite promising. 
 Auth.wiki is a nice recent addition to W2P but seems geared to 
 developers, not end users. 

 Are there any projects I missed? 

>>>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread mjm
Hi Loïc,

This looks very promising! 

Thx for the tip.

Marcel

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] SQLFORM.factory - is it possible to add multiple child objects to one parent in one view?

2013-03-24 Thread memo
Hi,
Here the codes. Is there a quick way add multiple child objects to a parent 
in one page?

db.define_table('t_invoices',
Field ('f_customer', 
type='reference t_customers',
  label=T ('Customer')),
Field ('f_date', 
type='date',
  label=T ('Date')),
Field ('f_invoice_no', 
type='string',
  label=T ('Invoice No')),
Field ('f_net', 
type='string',
  label=T ('Net')),
Field ('f_tax', 
type='string',
  label=T ('Tax')),
Field ('f_total', 
type='string',
  label=T ('Total')),
auth.signature,
format='%(f_customer)s %(f_date)d',
migrate=settings.migrate)

db.define_table('t_invoices_archive',db.t_invoices,Field 
('current_record','reference 
t_invoices',readable=False,writable=False))


db.define_table('t_invoice_details',
Field ('f_invoice', 
type='reference t_invoices',requires=IS_NOT_EMPTY 
(),readable=False,writable=False,
  label=T ('Invoice')),
Field ('f_description', 
type='string',
  label=T 
('Description')),
Field ('f_quantity', 
type='integer',
  label=T ('Quantity')),
Field ('f_price', 
type='double',
  label=T ('Price')),
Field ('f_total', 
type='double',compute=lambda r: r['f_quantity']*r['f_price'],writable=False,
  label=T ('Total')),
Field 
('f_tax_percentage', 
type='integer',
  label=T ('Tax 
Percentage')),
Field ('f_tax', 
type='double',compute=lambda r: 
r['f_total']*r['f_tax_percentage']/100,writable=False,
  label=T ('Tax')),
Field ('f_total_w_tax', 
type='double',compute=lambda r: r['f_total']+r['f_tax'],writable=False,
  label=T ('Total W 
Tax')),
auth.signature,
format='%(f_invoice)s',
migrate=settings.migrate)

db.t_invoice_details.f_tax_percentage.requires=IS_IN_SET 
(['1','8','18'])
db.define_table('t_invoice_details_archive',db.t_invoice_details,Field 
('current_record','reference 
t_invoice_details',readable=False,writable=False))

*
*

*
*

*
*

*def newInvoice():
form=SQLFORM.factory(db.t_invoices,db.t_invoice_details)
if form.process().accepted:
id=db.t_invoices.insert(**db.t_invoices._filter_fields(form.vars))
form.vars.f_invoice=id

id=db.t_invoice_details.insert(**db.t_invoice_details._filter_fields(form.vars))
response.flash=T('Thanks for filling out the form')
return dict(form=form)*







-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Compute fields are not computed on insert

2013-03-24 Thread memo
Hi,
I have added computed fields to db model, but they are not computed on 
insert. Code is supplied below.
Thanks

db.define_table('t_invoices',
Field ('f_customer', 
type='reference t_customers',
  label=T ('Customer')),
Field ('f_date', 
type='date',
  label=T ('Date')),
Field ('f_invoice_no', 
type='string',
  label=T ('Invoice No')),
Field ('f_net', 
type='string',
  label=T ('Net')),
Field ('f_tax', 
type='string',
  label=T ('Tax')),
Field ('f_total', 
type='string',
  label=T ('Total')),
auth.signature,
format='%(f_customer)s %(f_date)d',
migrate=settings.migrate)

db.define_table('t_invoices_archive',db.t_invoices,Field 
('current_record','reference 
t_invoices',readable=False,writable=False))


db.define_table('t_invoice_details',
Field ('f_invoice', 
type='reference t_invoices',requires=IS_NOT_EMPTY 
(),readable=False,writable=False,
  label=T ('Invoice')),
Field ('f_description', 
type='string',
  label=T 
('Description')),
Field ('f_quantity', 
type='integer',
  label=T ('Quantity')),
Field ('f_price', 
type='double',
  label=T ('Price')),
Field ('f_total', 
type='double',compute=lambda r: r['f_quantity']*r['f_price'],writable=False,
  label=T ('Total')),
Field 
('f_tax_percentage', 
type='integer',
  label=T ('Tax 
Percentage')),
Field ('f_tax', 
type='double',compute=lambda r: 
r['f_total']*r['f_tax_percentage']/100,writable=False,
  label=T ('Tax')),
Field ('f_total_w_tax', 
type='double',compute=lambda r: r['f_total']+r['f_tax'],writable=False,
  label=T ('Total W 
Tax')),
auth.signature,
format='%(f_invoice)s',
migrate=settings.migrate)

db.t_invoice_details.f_tax_percentage.requires=IS_IN_SET 
(['1','8','18'])
db.define_table('t_invoice_details_archive',db.t_invoice_details,Field 
('current_record','reference 
t_invoice_details',readable=False,writable=False))



def newInvoice():
form=SQLFORM.factory(db.t_invoices,db.t_invoice_details)
if form.process().accepted:
id=db.t_invoices.insert(**db.t_invoices._filter_fields(form.vars))
form.vars.f_invoice=id

id=db.t_invoice_details.insert(**db.t_invoice_details._filter_fields(form.vars))
response.flash=T('Thanks for filling out the form')
return dict(form=form)

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: update existing project model without breaking backward compatibility...

2013-03-24 Thread Mika Sjöman
Hi

Maybe you could dump it to a phone numbers to a csv file or a python dict 
with dump_data = { phone_number : contact.id,}

Then when you created the second table, just run a for loop to populate 
that table with the dumped data with contact_id as a reference to the old 
table.

Thats what I would do

// web2py rookie

cheers


Den söndagen den 24:e mars 2013 kl. 19:29:19 UTC+8 skrev Loïc:
>
> Hello all,
>
> let's imagine I have an app with the following model : 
>
> db.define_table('contact',
> Field('name'),
> Field('phone_number')
> )
>
> I have already deployed my app, and I have several contacts with a name 
> and a phone number.
>
> Then I realise that a contact can have multiple phone numbers. So I add a 
> table :
>
> db.define_table('phone number',
> Field('type'), #mobile phone number, home phone number, business 
> phone number ,...
> Field('phone_number'),
> Field('contact', 'reference contact'),
> )
>
> The first time I launch my app with the new model, I want to move existing 
> phone numbers from *contact *table to *phone_number *table.
> Then I want to remove 'phone_number' field from contact table to avoid 
> using it in the future
>
> What is the best way to do this automatically, and without breaking 
> backward compatibility?
>
> Thank you
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread Loïc
Hi Margaret,

The total size of the app is about 9MB
To populate the default data, I added some pictures, and a PDF file to 
download.
You will find pics in : 
*static/images/photo_gallery*
and a PDF file in
*static/uploaded_files*
If you remove the content of these two folders, you will save about 7MB 
(demo.pdf in uploaded_files folder is about 6.5MB)


Le dimanche 24 mars 2013 15:22:47 UTC+1, greaneym a écrit :
>
> Loic,
>
> this is a beautiful cms package. Thank you.  The only question I would 
> have is how to make the total size smaller?  
> I really like the visual design. Congratulations on your app!
>
> Margaret
>

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread greaneym
Loic,

this is a beautiful cms package. Thank you.  The only question I would have 
is how to make the total size smaller?  
I really like the visual design. Congratulations on your app!

Margaret

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-24 Thread 黄祥
did you use the whole db.py default?
something like this (in this example i also use the company table that is 
related with auth user table):
*db.py*
# -*- coding: utf-8 -*-

#
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db=db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

#
## Here is sample code if you need for
## - email capabilities
## - authentication (registration, login, logout, ... )
## - authorization (role based authorization)
## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
## - old style crud actions
## (more options discussed in gluon/tools.py)
#

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()

# append fields : auth.signature
db._common_fields.append(auth.signature)

# create table : company
db.define_table('company',
Field('company_name'),
Field('website'),
format='%(company_name)s')

# create index : company
db.executesql('CREATE INDEX IF NOT EXISTS idx_company ON company (id, 
company_name);')

# create table : company archive
db.define_table('company_archive', db.company,
Field('current_record', 'reference company'))

# custom auth user table
auth.settings.extra_fields['auth_user']=[
Field('gender', 'list:string'),
Field('address', 'text'),
Field('zip'),
Field('city'),
Field('country'),
Field('phone'),
Field('company', 'reference company')]

## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=True)

## configure email
mail = auth.settings.mailer
mail.settings.server = 'logging' or 'smtp.gmail.com:587'
mail.settings.sender = 'y...@gmail.com'
mail.settings.login = 'username:password'

## configure auth policy
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in 
private/janrain.key
from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth, filename='private/janrain.key')

#
## Define your tables below (or better in another model file) for example
##
## >>> db.define_table('mytable',Field('myfield','string'))
##
## Fields can be 'string','text','password','integer','double','boolean'
##   'date','time','datetime','blob','upload', 'reference TABLENAME'
## There is an implicit 'id integer autoincrement' field
## Consult manual for more options, validators, etc.
##
## More API examples for controllers:
##
## >>> db.mytable.insert(myfield='value')
## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)
## >>> for row in rows: print row.id, row.myfield
#

## after defining tables, uncomment below to enable auditing
# auth.enable_record_versioning(db)

# auth_user
custom_auth_table=db[auth.settings.table_user_name]
custom_auth_table.gender.label=T('Gender')
custom_auth_table.address.label=T('Address')
custom_auth_table.zip.label=T('Zip')
custom_auth_table.city.label=T('City')
custom_auth_table.country.label=T('Country')
custom_auth_table.phone.label=T('Phone')
custom_auth_table.company.label=T('Company')

auth.settings.table_user = custom_auth_table

# company
db.company.company_name.label=T('Company Name')
db.company.website.label=T('Website')

from gluon.cont

[web2py] Re: Sitemap Plugin or Sitemap Generator

2013-03-24 Thread BlueShadow
This Sitemap generator is great! But I got a couple questions about it.can 
you remove all entries which require authorisation?
I tried it for one of my applications and it shows an entry for a long 
deleted function(the view has been deleted too). why is that happening?

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] update existing project model without breaking backward compatibility...

2013-03-24 Thread Loïc
Hello all,

let's imagine I have an app with the following model : 

db.define_table('contact',
Field('name'),
Field('phone_number')
)

I have already deployed my app, and I have several contacts with a name and 
a phone number.

Then I realise that a contact can have multiple phone numbers. So I add a 
table :

db.define_table('phone number',
Field('type'), #mobile phone number, home phone number, business phone 
number ,...
Field('phone_number'),
Field('contact', 'reference contact'),
)

The first time I launch my app with the new model, I want to move existing 
phone numbers from *contact *table to *phone_number *table.
Then I want to remove 'phone_number' field from contact table to avoid 
using it in the future

What is the best way to do this automatically, and without breaking 
backward compatibility?

Thank you

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Free host for blog with domain?

2013-03-24 Thread Mika Sjöman
Hi

I wonder if anyone knows where I can put my we2py based blog up where they 
I also can use myOwnDomain.com for free? Not too much traffic, maybe a 100 
a day

And... I just build a community from scratch in two weeks from scratch with 
web2py, coming from django - I must say I LOVE web2py!

Huge thanks!

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-24 Thread Sarbjit singh
@黄祥,

*Its still giving error: *Table has no attribute 'gender' and '*
*'custom_auth_table' not defined.

Db.py
# -*- coding: utf-8 -*-

from gluon.tools import Auth
db = DAL("sqlite://storage.sqlite")
auth = Auth(db)
auth.settings.create_user_groups=True
auth.define_tables(username=False, signature=True)
db.define_table('person',
Field('name', requires=IS_NOT_EMPTY()),
Field('married', 'boolean'),
Field('gender', requires=IS_IN_SET(['Male', 'Female', 'Other'])),
Field('phone', 'integer'))

auth.settings.extra_fields['auth_user']=[
Field('gender', 'list:string', notnull=True),
Field('address', 'text', notnull=True),
Field('zip', length=10, notnull=True),
Field('city', length=10, notnull=True),
Field('country', length=10, notnull=True),
Field('phone', length=10, notnull=True, unique=True),
Field('company', 'reference company', notnull=True)]

from gluon.contrib.populate import populate
if db(db.auth_user).isempty():

auth.add_group('Manager', 'Manager')
auth.add_group('Admin', 'Admin')

auth.add_membership('1', '1')
auth.add_membership('2', '1')
auth.add_membership('2', '2')

db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' : 
'Manager', 
   'email' : 'mana...@test.com', 
   'password' : 
db.auth_user.password.validate('password')[0],
   'gender' : 'Male', 'address' : 'Address', 
'zip' : '1',
   'city' : 'Jakarta', 'country' : 'Indonesia', 
'phone' : '1',
   'company' : 1}, 
  {'first_name' : 'Admin', 'last_name' : 
'Admin', 
   'email' : 'ad...@test.com', 
   'password' : 
db.auth_user.password.validate('password')[0],
   'gender' : 'Male', 'address' : 'Address', 
'zip' : '1',
   'city' : 'Jakarta', 'country' : 'Indonesia', 
'phone' : '2',
   'company' : 1}])
 
custom_auth_table=db[auth.settings.table_user_name]
custom_auth_table.gender.requires=IS_IN_SET(['Male', 'Female'])
custom_auth_table.address.requires=IS_NOT_EMPTY()
custom_auth_table.zip.requires=IS_MATCH('^\d{5,5}$',
error_message='not a zip code')
custom_auth_table.city.requires=IS_NOT_EMPTY()
custom_auth_table.country.requires=IS_NOT_EMPTY()
custom_auth_table.phone.requires=IS_NOT_IN_DB(db, custom_auth_table.phone)
custom_auth_table.company.requires=IS_IN_DB(db, db.company.id, 
'%(company_name)s')
auth.settings.table_user=custom_auth_table  

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: No CMS for Web2Py?

2013-03-24 Thread Loïc
Niphlod,
I would be pleased to contribute. What should I do?

Le dimanche 24 mars 2013 00:08:40 UTC+1, Niphlod a écrit :
>
> candidate for submission on the poweredby ? or appliances ?
>
> On Saturday, March 23, 2013 8:34:39 PM UTC+1, Loïc wrote:
>>
>> Hi Marcel
>>
>> For my personal use I developed a basic CMS. The goal was to have 
>> something very simple to use.
>> Some features need to be improved, but I released the project recently.
>> You can have a look at https://github.com/espern/tiny_website
>>
>> Regards
>>
>> Le mercredi 13 mars 2013 00:06:09 UTC+1, mjm a écrit :
>>>
>>> Hi Massimo 
>>>
>>> auth.wiki seems useful, but mostly for the site developer, not user 
>>> friendly enough for site owner/user IMHO. Something like Plone is overkill 
>>> for a website. I'd like to see something simple and polished somewhere in 
>>> between.
>>> I'd be hesitant to use projects like Instant Press and Movuca that seem 
>>> (almost) abandoned. I'll have a look at w2cms.
>>>
>>> Marcel
>>>
>>>
>>> On Tuesday, March 12, 2013 11:18:54 PM UTC+1, Massimo Di Pierro wrote:

 The builit-in wiki despite the misleading name, is kind of a CMS. You 
 have pages. Pages have attachements. Pages have 
 permissions. Attachments inherit permissions. If you think of a page as a 
 folder, this is a CMS lite. ;-)

 There is InstantPress, there is movu.ca and there is w2cms (
 https://github.com/mdipierro/w2cms experimental to be revived).

 On Tuesday, 12 March 2013 16:31:23 UTC-5, mjm wrote:
>
> I really like Web2Py to get things done without much fuss. But I am 
> somewhat surprised there seems to be no CMS for W2P. 
>
> Projects mentioned in this context on this list Instant Press and 
> Movuca are not very active: Instant Press has seen no releases since 
> 2010. 
> Movuca almost no commits in the last year, the website is gone. A shame 
> really, it seemed quite promising. 
> Auth.wiki is a nice recent addition to W2P but seems geared to 
> developers, not end users. 
>
> Are there any projects I missed? 
>


-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: insert many rows using a single form

2013-03-24 Thread 黄祥
please check discussion on :
https://groups.google.com/forum/?fromgroups=#!topic/web2py/6wU3AtkwtA0

there are 2 example apps on that.
hope this can help.

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] retrieve data from table and then input it to another table using sqlform grid onvalidation

2013-03-24 Thread 黄祥
hi,

is it possible to retrieve data from table and then input it to another 
table using sqlform grid?
my goal is when i submit the check out form, it will retrieve room and 
guest data from table check in and then insert it to table check out.
below is the code that not work (no error occured, but the result is not 
expected when i submit it the form is not responding)
thank you very much in advance.

*db.py*
db.define_table('check_out',
Field('check_in', 'reference check_in'),
Field('room', 'reference room'),
Field('guest', 'reference guest'),
Field('description', 'text'),
format=lambda r: '%s %s-%s-%s' % (r.guest.first_name, 
r.guest.last_name, 
  r.room.branch.address, 
r.room.room_no))

db.check_out.check_in.requires=IS_IN_DB(db(db.check_in.is_active==True), 
db.check_in.id, 
label=format_check_in)
db.check_out.description.requires=IS_NOT_EMPTY()

*default.py*
def __oncreate_check_out(form):
room=db(db.room.id==form.vars.room).update(status='Checked Out')
check_in=db(db.check_in.room==form.vars.room).update(is_active=False)
return locals()

def __onvalidation_check_out(form):
if form.vars.check_in:
rows = db(db.check_in.id==form.vars.check_in).select()
for row in rows:
form.vars.room = row.room
form.vars.guest = row.guest
else:
form.errors.check_in = 'cannot be empty'

@auth.requires_login()
def check_out():
query = db.check_out.is_active==True
has_membership=auth.has_membership('Manager')
grid=SQLFORM.grid(query, user_signature=False, 
  maxtextlength=100, 
onvalidation=__onvalidation_check_out, 
  oncreate=__oncreate_check_out, onupdate=auth.archive, 
  editable=has_membership, deletable=has_membership)
return locals()

*check_out.html*
{{extend 'layout.html'}}

{{=grid}}


jQuery(document).ready(function(){
jQuery('#check_out_room__row').hide();
jQuery('#check_out_guest__row').hide();
});


-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-24 Thread 黄祥
yes, i'm sorry, i forgot to show the requires too for field gender (because 
i set the type as list string)
please add this code below in models/db.py :

custom_auth_table=db[auth.settings.table_user_name]
custom_auth_table.gender.requires=IS_IN_SET(['Male', 'Female'])
custom_auth_table.address.requires=IS_NOT_EMPTY()
custom_auth_table.zip.requires=IS_MATCH('^\d{5,5}$',
error_message='not a zip code')
custom_auth_table.city.requires=IS_NOT_EMPTY()
custom_auth_table.country.requires=IS_NOT_EMPTY()
custom_auth_table.phone.requires=IS_NOT_IN_DB(db, custom_auth_table.phone)
custom_auth_table.company.requires=IS_IN_DB(db, db.company.id, 
'%(company_name)s')

auth.settings.table_user=custom_auth_table

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] style input class="upload" the Boostrap way

2013-03-24 Thread Annet
I am looking for a way to style this:



more in line with the Bootstrap styling of the input and button style, as 
described
in the buttons instead of text section of 
http://twitter.github.com/bootstrap/base-css.html#forms


Kind regards,

Annet

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: row.update_record(effectiveSize-=1)

2013-03-24 Thread Annet
Thanks for your reply and explanation, I'll use:

db(db.groups.id
==session.groupID).update(effectiveSize=db.groups.effectiveSize-1)


Kind regards,

Annet

-- 

--- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.