woww very very good cms.... nice https://github.com/espern/tiny_website
! Fork in github !!! 2013/3/23 <web2py@googlegroups.com> > Today's Topic Summary > > Group: http://groups.google.com/group/web2py/topics > > - insert many rows using a single form<#13d991390944b9fe_group_thread_0>[1 > Update] > - row.update_record(effectiveSize-=1)<#13d991390944b9fe_group_thread_1>[1 > Update] > - No CMS for Web2Py? <#13d991390944b9fe_group_thread_2> [1 Update] > - simple loop question <#13d991390944b9fe_group_thread_3> [1 Update] > - REF: Upload of Files <#13d991390944b9fe_group_thread_4> [1 Update] > - Help on a web2py query <#13d991390944b9fe_group_thread_5> [1 Update] > - "4 minutes ago" <#13d991390944b9fe_group_thread_6> [3 Updates] > - How to exclude some fields from a form for a database > record?<#13d991390944b9fe_group_thread_7>[1 Update] > > insert many rows using a single > form<http://groups.google.com/group/web2py/t/20a18c77b0eb03e6> > > Rohit <rohit.ba...@gmail.com> Mar 23 01:53PM -0700 > > Hi, > > I want to insert multiple rows using a single form like the image > shown > below. > > This is my code: > <div class="newawd"> > <table class="form-table"> > <tr> > <td>{{=form.custom.label.award_name}}:</td> > <td>{{=form.custom.widget.award_name}}</td> > <td>{{=form.custom.label.employee_name}}:</td> > <td>{{=form.custom.widget.employee_name}}</td> > <td>{{=form.custom.label.team_name}}:</td> > <td>{{=form.custom.widget.team_name}}</td> > <td>{{=form.custom.label.description}}:</td> > <td>{{=form.custom.widget.description}}</td> > <td>{{=form.custom.label.image}}:</td> > <td>{{=form.custom.widget.image}}</td> > </tr> > </table> > </div> > <div id="nwrw"></div> > {{=form.custom.submit}} > {{=form.custom.end}} > > <div> <button name="Add New Award" value="new row" id="newBtn">Add New > entry</button></div> > <script type="text/javascript"> > $("#newBtn").click(function(){ > > > > $("#nwrw").append('<div>{{=form.custom.label.award_name}}:{{=form.custom.widget.award_name}}{{=form.custom.label.employee_name}}:{{=form.custom.widget.employee_name}}{{=form.custom.label.team_name}}:{{=form.custom.widget.team_name}}{{=form.custom.label.description}}:{{=form.custom.widget.description}}{{=form.custom.label.image}}:{{=form.custom.widget.image}}</div>'); > }); > </script> > > > > > Please let me know how can we achieve this in web2py. > > > > > row.update_record(effectiveSize-=1)<http://groups.google.com/group/web2py/t/2f6cdf39174e15a1> > > Niphlod <niph...@gmail.com> Mar 23 01:04PM -0700 > > it's kinda unclear what you want from the posted snippet, however your > original snippet would fail because of an invalid syntax (you can't do > row.update_record(something-=1), no matter what) > > from my pov, you asked for something able to decrease a column value > of a > preselected row by 1, and that is accomplishable with > row.update_record(something=row.something-1) > > the second snippet suggested > effectiveSize = db(db.groups.id==session.groupID).count() > > just counts how many groups.id are there with session.groupID as value. > > So, you can do > row=db(db.groups.id > ==session.groupID).select(db.groups.effectiveSize).first() > if row: > row.update_record(row.effectiveSize-=1) > > or > count=db(db.groups.id==session.groupID).count() > if count: > row=db(db.groups.id > ==session.groupID).select(db.groups.effectiveSize).first() > row.update_record(effectiveSize-=1) > > to have the same result, but you're just adding an unneccessary query. > If you plan to have a lot of groups the speed wouldn't matter in this > case, > cause groups.id is a primary key and your query either returns 1 row > or 0 > row. Counting or selecting will end up doing the same thing in more or > less > the same time, cause the biggest "operation" on a large scale table > with > that query would be the "filtering" part, the one in common with both > methods, db.groups.id == session.groupID > > A shorter version of a working snippet can also be > db(db.groups.id > ==session.groupID).update(effectiveSize=db.groups.effectiveSize-1) > > in which case, if a group row is found it will get decreased, if not, > nothing will happen. > > > > No CMS for Web2Py?<http://groups.google.com/group/web2py/t/a64e63faf9f4ce6d> > > Loïc <loic.esp...@gmail.com> Mar 23 12:34PM -0700 > > 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 : > > > > simple loop > question<http://groups.google.com/group/web2py/t/1eba5d4fb34e5eba> > > greaneym <grean...@gmail.com> Mar 23 12:15PM -0700 > > Hi Alex, > > www.programr.com > has python object-oriented examples > > www.coursera.org has a python course in April. > > The mvc approach can be learned by trying the examples in web2py's > on-line > manual, using the welcome app that comes with the install. Trying > examples > yourself is a great way to > learn web2py. > > Margaret > > On Saturday, March 23, 2013 9:37:06 AM UTC-5, Alex Glaros wrote: > > > > REF: Upload of > Files<http://groups.google.com/group/web2py/t/a33639064032591b> > > wwwgong <wen.g.g...@gmail.com> Mar 23 11:52AM -0700 > > Thanks for sharing the solution, I did not know that quotes_file holds > the > file content > > On Friday, March 22, 2013 2:34:16 AM UTC-4, software.ted wrote: > > > > Help on a web2py > query<http://groups.google.com/group/web2py/t/6b82b4411cdc396a> > > Tito Garrido <titogarr...@gmail.com> Mar 23 03:14PM -0300 > > Yes, you got it... > > > > -- > > Linux User #387870 > .........____ > .... _/_õ|__| > ..º[ .-.___.-._| . . . . > .__( o)__( o).:_______ > > > > "4 minutes ago"<http://groups.google.com/group/web2py/t/756724eede8ac614> > > "Ricardo Cárdenas" <ricardo.carde...@gmail.com> Mar 22 06:27PM -0700 > > My google-fu has not helped me come up with an answer... > > Django has a set of template filters they call "humanize" which will > add a > nice touch to data. (Java also has a lib called PrettyTime.) For > example it > will convert "Fri Mar 22, 20:23" into "4 minutes ago", or "Fri Mar 21" > into > "yesterday". Is there something similar in web2py? > > best regards -Ricardo > > > > > LightDot <light...@gmail.com> Mar 22 06:50PM -0700 > > Sure, described here: > > http://web2py.com/books/default/chapter/29/14#Pretty-dates > > Regards, > Ales > > On Saturday, March 23, 2013 2:27:32 AM UTC+1, Ricardo Cárdenas wrote: > > > > > "Ricardo Cárdenas" <ricardo.carde...@gmail.com> Mar 22 07:10PM -0700 > > Got it - thanks. > > On Friday, March 22, 2013 8:27:32 PM UTC-5, Ricardo Cárdenas wrote: > > > > How to exclude some fields from a form for a database > record?<http://groups.google.com/group/web2py/t/5b1a2bd79270a368> > > Alan Etkin <spame...@gmail.com> Mar 22 02:29PM -0700 > > A good one. And for you initial requirement which was taking a > particular > field out of the form (not choosing the whole set of fields that the > registration form should show), this is more compact, specially if you > are > populating the scaffolding auth_user table with custom fields: > > auth.settings.register_fields = db.auth_user.fields() > auth.settings.register_fields.remove("<field to remove>") > > > > You received this message because you are subscribed to the Google Group > web2py. > You can post via email <web2py@googlegroups.com>. > To unsubscribe from this group, send <web2py+unsubscr...@googlegroups.com>an > empty message. > For more options, visit <http://groups.google.com/group/web2py/topics>this > group. > > -- > > --- > 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.