[web2py] Interesting project....

2010-03-06 Thread Jason Brower
https://launchpad.net/drizzle
I wonder how useful it actually is and if it would be something web2py
would support. (Perhaps as a plugin as I doubt it will be in python any
time soon.)
BR,
Jason

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py beautification

2010-03-05 Thread Jason Brower
But then this isn't automated. First time I have seen it, so if it's in
the application built in I missed it. And let's not forget lots of us,
like me don't have internet all the time.
BR,
Jason

On Fri, 2010-03-05 at 20:27 -0800, mdipierro wrote: 
> Why when they can already chose hundreds from web2py.com/layouts
> What somebody should actually do is go over them all and delete some.
> Some do not look very nice because tha conversion process broke them.
> 
> Massimo
> 
> On Mar 5, 10:24 pm, weheh  wrote:
> > +1
> >
> > On Mar 5, 11:19 pm, "mr.freeze"  wrote:
> >
> > > Idea: tweak 10 (or more) of the best gpl css templates we can find to
> > > work with web2py and give people a choice of templates when they
> > > create an app.  Also, change admin to use one of these.  I think the
> > > welcome and admin apps look too utilitarian and web 1.0 (no offense to
> > > whoever designed them).
> >
> > > Thoughts?
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: web2py beautification

2010-03-05 Thread Jason Brower
+1 I think beginners would especially like it as they can pick the theme
they like.
I think what might be a step in an even cooler direction would be a
color selector that helps you setup your css to the color theme you
like.  It's very helpful to me, as design is something I go for right
away. (I dislike the table layout very much. :P)
---
BR,
Jason

On Fri, 2010-03-05 at 20:24 -0800, weheh wrote: 
> +1
> 
> On Mar 5, 11:19 pm, "mr.freeze"  wrote:
> > Idea: tweak 10 (or more) of the best gpl css templates we can find to
> > work with web2py and give people a choice of templates when they
> > create an app.  Also, change admin to use one of these.  I think the
> > welcome and admin apps look too utilitarian and web 1.0 (no offense to
> > whoever designed them).
> >
> > Thoughts?
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: interesting stats

2010-03-05 Thread Jason Brower
Notice the 1 at the end. :)
BR,
Jason Brower
On Fri, 2010-03-05 at 11:05 -0800, mdipierro wrote: 
> You are right. The numbers are way off.
> 
> The entire number of html lines of web2py html is 4174 and the entire
> number of python lines (including comments) is 40001.
> 
> Massimo
> 
> On Mar 5, 12:35 pm, villas  wrote:
> > Hmm,  Web2py has 85,000 lines of HTML.
> > I wonder how that is measured?  Is that credible?
> >
> > On Mar 5, 6:08 pm, mdipierro  wrote:
> >
> > > I just came across these:
> >
> > >https://www.ohloh.net/p/web2py/analyses/latesthttps://www.ohloh.net/p...
> >
> > > It shows that web2py code has less comments in code (in %) then Django
> > > by a factor 2, but more than TG (+10%). We have more HTML than both of
> > > them. The total code base is not as small as I though compared with
> > > Django. Including the HTML we have more lines of code.
> >
> > > Massimo
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] shell only web2py

2010-03-02 Thread Jason Brower
Very nice article.  Thanks, it's good to know this side as well,
especially when deploying remotely.
BR,
Jason Brower
On Tue, 2010-03-02 at 09:59 -0800, mdipierro wrote: 
> http://gluonframework.wordpress.com/
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Question about web2py license

2010-02-22 Thread Jason Brower
The software created with Web2py can be any license that you like.
On Mon, 2010-02-22 at 09:29 +, Miguel Lopes wrote:
> Hello Massimo,
> 
> I wonder if web2py's license would allow for a SaaS kind of
> application?
> 
> By SaaS I mean access to the site (web app) would be paid for. In
> practice end users would pay a fee for accessing the site
> functionality. This seems very, very borderline to me. I know you are
> not laywers. But would this be possible?
> 
> br,
> Miguel
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: small improvement to TK gui

2010-02-22 Thread Jason Brower
+1
And it would be nice to see a list of error links and they happen on the
server.  Or a link or viewer for the error logs. Etc...
That brings up another point.  I would like to have an error log viewer
that I can run from the console as well, so I can easily parse through
errors on my server.
BR,
Jason
On Sun, 2010-02-21 at 23:53 -0800, hamdy.a.farag wrote: 
> >actually if you do
> >python web2py.py -i ip_address -p port_number -a "password"
> >there will be no gui.
> 
> 
> >The tk gui could use some general cleanup by somebody who understands tk a 
> >lot better than I do.
> 
> 
> :) I know that ,
> 
>actually There is no need to do many improvements in the TK gui,
> it's working and that's all needed for now , in real development
> world actually you don't  need it at all
>but the fact that there's no listener for the Enter Key annoys me
> whenever I do some quick test
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: they are copying us....

2010-02-16 Thread Jason Brower
Hmm...
If I though someone was plagurizing my idea I would say it.  But I think
copy is the best term you could use here.  I don't know of a better way
to say it. Copy is an ok thing to say, it's just the media has turned it
into a bad thing. My two cents.
---
Best Regards,
Jason Brower
On Tue, 2010-02-16 at 01:25 -0800, pistacchio wrote: 
> hi massimo,
> i really appreciate your work on web2py. the product is excellent,
> i've just launched my first site using it and other two are on the
> work. i like the new documentation (how it's shaping up) and the way
> you "rule" the community around web2py prove that your way is right. i
> mean, you do a lot of work and coordinate inputs.
> 
> one thing i really don't understand is your approach to the opensource
> philosophy. i already pointed it out weeks ago about the non free, pdf
> documentation that is something really sick in a opensource
> environment. fortunately i was not the only one thinking this way and,
> in the end, the online book is now there and shining.
> 
> now, i think this "copying us" is utterly out of place. as you stated
> somewhere, your sources of inspiration were initially django and
> rails. are you copying them? did you make the idea of "web framework"
> by yourself? were you the first one to come out with the mvc pattern?
> i don't think so, and this is perfect.
> 
> the opensource community, seen as a whole, not as a series of rival
> smaller communities that gather around isolated projects, drains its
> power from the openness of the ideas, from making them circulate and
> the word "copy", with the negative connotation of "plagiarize" hidden
> within it, has nothing to do with this.
> the guy may or may be not been inspired by web2py, but if he was, it
> is a good thing that web2py did something so valid that other people
> want to take inspiration from it. if he ends up writing a piece of
> software that is better than the current web2py's online editor, we
> can replace it with the new, better one and the circle will be
> completed as opening an idea would lead to end up with a better
> product. that's the whole point of opensource.
> 
> On Feb 16, 5:57 am, mdipierro  wrote:
> > http://haineault.com/blog/125/
> >
> > P.S. Of course we have 3 years of head start and the web2py
> > architecture was designed for this, theirs isn't.
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: how to display date and time nicely?

2010-02-15 Thread Jason Brower
These examples would be a very good edition to the book
--
J
On Mon, 2010-02-15 at 16:19 -0800, mdipierro wrote: 
> for lack of a better option I put it in tools for now.
> 
> On Feb 15, 5:56 pm, Richard  wrote:
> > added a few more cases:
> >
> > def prettydate(d):
> > try:
> > dt = datetime.now() - d
> > except:
> > return ''
> > if dt.days >= 2*365:
> > return '%d years ago' % int(dt.days / 365)
> > elif dt.days >= 365:
> > return '1 year ago'
> > elif dt.days >= 60:
> > return '%d months ago' % int(dt.days / 30)
> > elif dt.days > 21:
> > return '1 month ago'
> > elif dt.days >= 14:
> > return '%d weeks ago' % int(dt.days / 7)
> > elif dt.days >= 7:
> > return '1 week ago'
> > elif dt.days > 1:
> > return '%d days ago' % dt.days
> > elif dt.days == 1:
> > return '1 day ago'
> > elif dt.seconds >= 2*60*60:
> > return '%d hours ago' % int(dt.seconds / 3600)
> > elif dt.seconds >= 60*60:
> > return '1 hour ago'
> > elif dt.seconds >= 2*60:
> > return '%d minutes ago' % int(dt.seconds / 60)
> > elif dt.seconds >= 60:
> > return '1 minute ago'
> > elif dt.seconds > 1:
> > return '%d seconds ago' % dt.seconds
> > elif dt.seconds == 1:
> > return '1 second ago'
> > else:
> > return 'now'
> >
> > On Feb 15, 10:54 am, mdipierro  wrote:
> >
> > > Put this in a model
> >
> > > def prettydate(d):
> > > try:
> > > dt = request.now - d
> > > except:
> > > return ''
> > > if dt.days>=365*2:
> > > return '%s years ago' % int(dt.days/365)
> > > elif dt.days>=365:
> > > return '1 years ago'
> > > elif dt.days>=60:
> > > return '%s months ago' % int(dt.days/30)
> > > elif dt.days>21:
> > > return '1 months ago'
> > > elif dt.days>=14:
> > > return '%s weeks ago' % int(dt.days/7)
> > > elif dt.days>=7:
> > > return '1 week ago'
> > > elif dt.days>=2:
> > > return '%s days ago' % int(dt.days)
> > > elif dt.days==1:
> > > return '1 day ago'
> > > else:
> > > return 'today'
> >
> > > On Feb 14, 3:13 pm, selecta  wrote:
> >
> > > > This is not 100% web2py related but I am sure if this will be answered
> > > > many of you will profit at some point from it.
> >
> > > > Is there a python module that helps you to display dates and times
> > > > nice e.g.
> >
> > > > just now (for within the last 5 minutes)
> > > > 2 hours ago
> > > > 2 days ago
> > > > 15th February 2009
> > > > ...
> >
> > > > I guess somebody must have done that already, right?
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Displaying a gantt like chart...

2010-02-15 Thread Jason Brower
I am making a scheduling application and am getting fairly close.
I have it displaying a charts relative to the size of screen.
The data configured in the controller and built on the screen with only
html and css.
But I have a few issues.
I need to create a date that I can add one day to another over and over
to get the day and date and most of all be able to print it to the
screen.  Do I really need to do that all before I get to the view
without importing datetime in both the controller and the view?

This view will mark across the screen with tick marks representing each
day.
I can get each day, but I can't get the date for each day.
I need this and then be able to mark when ever there is a saturday and
sunday. (As the business will be closed.  Any idea how this could be
best done?
Enclosed is the view I am using for it...
I also have encloded my css so you get the idea of how it would look.

Hope you can help out.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

{{extend 'layout.html'}}

{{=day}}
{{color_count = 0}}




{{=start_date.strftime(date_format)}}
{{=end_date.strftime(date_format)}}



{{for item in range(days):}}
M
{{pass}}


{{for bar in bars:}}

{{for item in bars[bar]:}}
{{=item[2]}}
{{pass}}

{{pass}}
@charset "UTF-8";

* {
margin: 0 0;
}
body {
background:url("images/content_bg.png");
background-repeat: repeat;
}
a img{
border:0px;
}
.error {
background:orange;
}
.bar_chart {
width:950px;
height:13px;
background:white;
margin-top:4px;
}
.bar_chart a{
display:block;
background:pink;
height:13px;
float:left;
font-size:8px;
text-align:center;
overflow:hidden;
padding-bottom:1px;
text-decoration:none;
color:black;
}
a.percent {
display:block;
background:pink;
height:13px;
float:left;
font-size:11px;
text-align:center;
overflow:hidden;
padding-bottom:1px;
text-decoration:none;
}
#index_content {
width:400px;
height:350px;
}
a#checkout {
background:url("images/checkout_button.png") right top;
}
a#customer {
background:url("images/customer_button.png") right top;
}
a#table {
background:url("images/table_button.png") right top;
}
a#sales {
background:url("images/sales_button.png") right top;
}
a#report {
background:url("images/report_button.png") right top;
}
a#feedback {
background:url("images/feedback_button.png") right top;
}
a#mail {
background:url("images/mail_button.png") right top;
}
a#administration {
background:url("images/administration_button.png") right top;
}
a#exit {
background:url("images/exit_button.png") right top;
}

a#checkout:hover {
background:url("images/checkout_button.png") right bottom;
}
a#customer:hover {
background:url("images/customer_button.png") right bottom;
}
a#table:hover {
background:url("images/table_button.png") right bottom;
}
a#sales:hover {
background:url("images/sales_button.png") right bottom;
}
a#report:hover {
background:url("images/report_button.png") right bottom;
}
a#feedback:hover {
background:url("images/feedback_button.png") right bottom;
}
a#mail:hover {
background:url("images/mail_button.png") right bottom;
}
a#administration:hover {
background:url("images/administration_button.png") right bottom;
}
a#exit:hover {
background:url("images/exit_button.png") right bottom;
}
#start_date {
float:left;
font-size:11px;
}
#end_date {
float:right;
font-size:11px;
}

a.index_item {
display:block;
width:125px;
height:31px;
float:left;
font-size:11px;
text-align:center;
padding-top:82px;
text-decoration:none;
color:grey;
}

a.index_item:hover {
color:black;
}

#header {
width:100%;
height:100px;;
float:left;
}
#header h1 {
font-size:80px;
}
#header_content {
float:left;
height:100%;
}
#footer {
width:100%;
float:left;
text-align:center;
font-size:11px;
}
#logo {
height:100%;
width:210px;
float:left;
}
#navigation {
width:160px;
float:left;
margin-top:5px;
margin-left:15px;
}
#navigation a {
display:block;
width:154px;
height:27px;
background:url('images/button.png');
overflow:hidden;
background-position:bottom left;
text-align:center;
padding-top:5px;
font-family: Verdana,Arial,sans-serif;
font-size:18px;
text-decoration: none;
float:left;
margin-top:5px;
color:

Re: [web2py] Re: why use the admin interface, at all?

2010-02-12 Thread Jason Brower
Thank you Massimo.  I am happy you remember me. :D
BR,
Jason
On Fri, 2010-02-12 at 14:54 -0800, snfctech wrote:
> Still my intent with web2py is not to serve only the brightest
> > ones. 

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] On the online book

2010-02-12 Thread Jason Brower
The page looks fantastic and very well done.  Hopefully you can earn
some cash with it as well.
BR,
Jason

On Fri, 2010-02-12 at 15:17 -0800, mdipierro wrote: 
> The book
> 
> http://web2py.com/book
> 
> Seems to work well enough. I need to add some editor locking to avoid
> conflicts and I will do next week.
> There are some issues with IE8 so if you want to be an editor, you
> better use Firefox.
> If you want to start creating pages or editing please go ahead
> 
> ... and feel free to te ll your friends. ;-)
> 
> Massimo
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: flash message timeout

2010-02-12 Thread Jason Brower
I actually never thought about having it fade out.  That sounds like a
great idea!
Thanks Hamdy!
BR,
Jason
On Fri, 2010-02-12 at 21:21 -0800, mdipierro wrote:
> {jQuery('.flash').delay(5000).fadeOut();}

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Needed Validation: A-F or 0 but A-F are unique...

2010-02-10 Thread Jason Brower
That doesn't seem to work.  I don't think there is a function called
IS_EMPTY_OR in web2py.
BR,
Jason
On Tue, 2010-02-09 at 02:39 -0800, selecta wrote: 
> IS_EMPTY_OR(IS_IN_SET(["A","B","C","D","E","F"]))
> 
> On Feb 9, 11:36 am, selecta  wrote:
> > IS_EMTPY_OR(IS_IN_SET(["A","B","C","D","E","F"]))
> >
> > On Feb 9, 7:40 am, Jason Brower  wrote:
> >
> >
> >
> > > Don't know if I can discribe this in type but...
> > > I need a validator that can alow only one A B C D E F other wise it
> > > should be 0
> > > I haven't figure out how to make IS_IN_SET(["A","B","C","D","E","F"])
> > > unique=True and default=0 all at the same time...
> > > Best Regards,
> > > Jason Brower
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: PDF manual soon available online in HTML (maybe)

2010-02-09 Thread Jason Brower
All those that think Massimo is either, 1.  A total stud or 2. Freaking
amazing. +1 Your a great guy Massimo.
---
Warmest Regards,
Jason Brower

On Tue, 2010-02-09 at 06:36 -0800, mdipierro wrote: 
> Alexandre is right except this part is now partially solved.
> None of the tools suggested here worked in converting my Latex to wiki
> but I only used my own Latex macros so I stayed awake last night and
> wrote my own tool (works only with my own latex but works much better
> than anything else). I am letting you know so that we do not overlap.
> I will keep you posted...
> 
> Massimo
> 
> On Feb 9, 6:06 am, Alexandre Andrade  wrote:
> > Well,
> > I never discuss about my clients needs. I just understand it and make the
> > specification.
> >
> > 1. Documentation about web2py is poor. Everyone agree.
> > 2. One reason for this is Massimo defines the new versions, and there is no
> > roadmap. New features are added 'ad hoc'
> > 3. Since Massimo decides what will be in new versions and when, only him
> > know about the new functionalities.
> > 4. Since anyone is talking about roadmaps and planned versions, and
> > colaborative developing, documentation depends almost of Massimo
> > 5. So, what him want is what we have.
> >
> > He wants a tool/script to convert latex/wiki and wiki/latex.
> >
> > Talk, talk, talk, is no resolving anything.
> >
> > My sugestion is:
> >
> > 1. Can someone make a budget do develop this tool (wiki in web2py and
> > conversion latex/wiki/latex)?
> > 2. Who agrees to donate (and how much) do pay developing this?
> >
> > To me, open source is not about 'not paid to develop', but once developed,
> > be free to be used.
> >
> > If someone can do it, and enough people agree the value need, we can advance
> > by this way. If none, its time to search another solution.
> >
> > 2010/2/8 mdipierro 
> >
> >
> >
> > > I am not sure this is something people should vote on.
> > > Let me resolve some of the issues on my side first.
> > > This should not be stopping anybody from writing howtos, examples and
> > > tutorials.
> > > this is complementary and putting everything together is a secondary
> > > step.
> >
> > > If people know of a good tool to convert latex to wiki format and vice
> > > versa, I could use that.
> >
> > > Massimo
> >
> > > On Feb 8, 6:39 pm, Richard  wrote:
> > > > In case you missed it Massimo is considering making the manual
> > > > available online in HTML:
> >
> > > > On Feb 9, 3:33 am, mdipierro  wrote:
> >
> > > > > I am considering posting most of the book on line in HTML. This may be
> > > > > possible with a disclaimer about "do not reproduce in print". The main
> > > > > issue is that the book is in latex and not easy to convert.
> >
> > > >http://groups.google.com/group/web2py/browse_thread/thread/ce1c7614ce...
> >
> > > > There have been a number of complaints lately about the documentation
> > > > so it is good this is being considered.
> >
> > > > Some points to ponder:
> > > > - How would the online manual best be hosted? - the wiki app? A
> > > > djangobook clone?
> > > > - Should the PDF/latex be manually inserted into this app, or is there
> > > > an automatic method?
> > > > - How would online edits be fed back into the official PDF version?
> >
> > > > Richard
> >
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > web2py+unsubscr...@googlegroups.com
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/web2py?hl=en.
> >
> > --
> > Atenciosamente
> >
> > --
> > =
> > Alexandre Andrade
> > Hipercenter.com
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Needed Validation: A-F or 0 but A-F are unique...

2010-02-09 Thread Jason Brower
Gees, I get fancy new command thrown at me all the time. :P
Thanks!
BR,
Jason Brower

On Tue, 2010-02-09 at 02:39 -0800, selecta wrote: 
> IS_EMPTY_OR(IS_IN_SET(["A","B","C","D","E","F"]))
> 
> On Feb 9, 11:36 am, selecta  wrote:
> > IS_EMTPY_OR(IS_IN_SET(["A","B","C","D","E","F"]))
> >
> > On Feb 9, 7:40 am, Jason Brower  wrote:
> >
> >
> >
> > > Don't know if I can discribe this in type but...
> > > I need a validator that can alow only one A B C D E F other wise it
> > > should be 0
> > > I haven't figure out how to make IS_IN_SET(["A","B","C","D","E","F"])
> > > unique=True and default=0 all at the same time...
> > > Best Regards,
> > > Jason Brower
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Customize classes or ids on SQLFORM submit button...

2010-02-08 Thread Jason Brower
I can see the customized forms and other what not, but is there a way to
set the classes for the submit buttons and other what not.  I just want
to change the styling, not validations or anything like that.
---
Best Regards,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Needed Validation: A-F or 0 but A-F are unique...

2010-02-08 Thread Jason Brower
Don't know if I can discribe this in type but...
I need a validator that can alow only one A B C D E F other wise it
should be 0
I haven't figure out how to make IS_IN_SET(["A","B","C","D","E","F"])
unique=True and default=0 all at the same time... 
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: AutocompleteWidget: experimental, magic, RFC

2010-02-08 Thread Jason Brower
I will try it when it's in a release, I want to test the ÖÄÅ features as
I can't get it to work in my setup.
Best Regards,
Jason
On Sun, 2010-02-07 at 14:26 -0800, mdipierro wrote: 
> 
> On Feb 7, 3:12 pm, "mr.freeze"  wrote:
> > Nice! I like this but I think it needs a few more tweaks. Can you
> > modify it to allow the arrow keys to select an item? Also, when you
> > clear the input after typing something, all of the options show.
> 
> Yes it can be done. It is on my to do list.
> 
> >
> > I personally think that javascript should be used more in the
> > framework (with proper attention paid so that things degrade
> > gracefully when it's off).
> 
> Something like auto-completion is just going to break if jQuery is not
> present. I am not sure if it is possible to make degrade gracefully.
> 
> 
> >
> > On Feb 7, 2:11 pm, mdipierro  wrote:
> >
> > > How about we change IS_IN_DB so that, if the number of referenced
> > > records exceeds a maximum the auto complete widget is on by default?
> >
> > > Massimo
> >
> > > On Feb 7, 1:02 am, mdipierro  wrote:
> >
> > > > I do not know that. I am still playing with it...
> >
> > > > On Feb 6, 11:40 pm, Jason Brower  wrote:
> >
> > > > > I have my current autocomplete but it doesn't do öäå in a search.  
> > > > > Does
> > > > > this handle that?
> > > > > Best Regards,
> > > > > Jason
> >
> > > > > On Sat, 2010-02-06 at 12:30 -0800, mdipierro wrote:
> > > > > > People say there is some magic in web2py.
> > > > > > Here is some real magic now in trunk that I am sure you have never
> > > > > > seen.
> >
> > > > > > Caveats:
> > > > > > 0) requires latest trunk (bzr 1603, hg 175:e42b559254f6)
> > > > > > 1) this is an experiment, not sure it is a good idea
> > > > > > 2) this is the first function in web2py that REQUIRES jQuery
> > > > > > 3) works but I am not yet convinced it should stay there
> > > > > > 4) even if it stays, I am sure the API should stay
> >
> > > > > > Example:
> >
> > > > > > ### assume this model
> > > > > > db.define_table('target',Field('name'))
> > > > > > if not db(db.target.id>0).count():
> > > > > > db.target.insert(name="Klingon")
> > > > > > db.target.insert(name="Romulans")
> > > > > > db.target.insert(name="Borg")
> > > > > > db.target.insert(name="Borg2")
> > > > > > db.define_table('photon_torpedo',Field('target',db.target))
> >
> > > > > > ### assume this action in controller default.py
> > > > > > def launch():
> > > > > > db.photon_torpedo.target.represent=lambda target: target.name
> > > > > > return dict(new_torpedo=crud.create(db.photon_torpedo),
> > > > > > 
> > > > > > launched_torpedos=db().select(db.photon_torpedo.ALL))
> >
> > > > > > So far nothing new.
> >
> > > > > > Now append to the model or insert at top of controller the 
> > > > > > following:
> >
> > > > > > from gluon.sqlhtml import AutocompleteWidget
> > > > > > db.photon_torpedo.target.widget=AutocompleteWidget(request,db.target.name,db.target.id)
> >
> > > > > > No need to define any callback action (there is no callback action!)
> > > > > > No plugin required (perhaps some optional css to style).
> > > > > > No js coding required.
> > > > > > Applies to existing apps, including those that use custom forms.
> >
> > > > > > Let's see who can figure out how it works!
> >
> > > > > > Massimo
> >
> >
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: immediate web2py job opening

2010-02-06 Thread Jason Brower
I don't have to much interest in them. :D  But I will pass the word
around.  How long is the contract for?  I can find someone here that may
be able to go to the states to work.
BR,
Jason Brower

On Sat, 2010-02-06 at 22:26 -0800, weheh wrote: 
> @villas: lol.
> @ Jason B: the team will be as small as possible so there will be more
> models to go around.
> 
> On Feb 6, 7:38 am, villas  wrote:
> > On Feb 3, 9:24 am, Jason Brower  wrote:
> >
> > > Sounds fun
> >
> > Yes, you can just imagine the banter...
> > "Now you finish off the controllers and views, while I take care of
> > those models!"
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] AutocompleteWidget: experimental, magic, RFC

2010-02-06 Thread Jason Brower
I have my current autocomplete but it doesn't do öäå in a search.  Does
this handle that?
Best Regards,
Jason
On Sat, 2010-02-06 at 12:30 -0800, mdipierro wrote: 
> People say there is some magic in web2py.
> Here is some real magic now in trunk that I am sure you have never
> seen.
> 
> Caveats:
> 0) requires latest trunk (bzr 1603, hg 175:e42b559254f6)
> 1) this is an experiment, not sure it is a good idea
> 2) this is the first function in web2py that REQUIRES jQuery
> 3) works but I am not yet convinced it should stay there
> 4) even if it stays, I am sure the API should stay
> 
> Example:
> 
> ### assume this model
> db.define_table('target',Field('name'))
> if not db(db.target.id>0).count():
> db.target.insert(name="Klingon")
> db.target.insert(name="Romulans")
> db.target.insert(name="Borg")
> db.target.insert(name="Borg2")
> db.define_table('photon_torpedo',Field('target',db.target))
> 
> ### assume this action in controller default.py
> def launch():
> db.photon_torpedo.target.represent=lambda target: target.name
> return dict(new_torpedo=crud.create(db.photon_torpedo),
> launched_torpedos=db().select(db.photon_torpedo.ALL))
> 
> So far nothing new.
> 
> Now append to the model or insert at top of controller the following:
> 
> from gluon.sqlhtml import AutocompleteWidget
> db.photon_torpedo.target.widget=AutocompleteWidget(request,db.target.name,db.target.id)
> 
> No need to define any callback action (there is no callback action!)
> No plugin required (perhaps some optional css to style).
> No js coding required.
> Applies to existing apps, including those that use custom forms.
> 
> Let's see who can figure out how it works!
> 
> Massimo
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] proposal for online documentation

2010-02-05 Thread Jason Brower
I also agree, then we create a dynamic and growing collection of
documentation and when I need the information from the book I can get it
there as well.  Very fun idea indeed.
BR,
J
On Fri, 2010-02-05 at 08:11 -0800, mdipierro wrote: 
> I got a private email from David and we have an idea:
> 
> 1) organize a wiki with the same table of content as the book. Each
> page will have an errata and a a faq. It will include some parts of
> the book (when possible) and link the scribd book chapters when not
> possible.
> 
> 2) integrate the above with a small web2py app that turns web2py
> docstrings into wiki pages. When users edit the wiki, the docstrings
> get updated, and I get a patch.
> 
> What do people think?
> 
> Massimo
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Dumb syntax error! Can't fix it!

2010-02-04 Thread Jason Brower
Gees thanks, I never thought about that one...
Password changed, thanks...
BR,
Jason Brower

On Thu, 2010-02-04 at 10:48 -0800, mr.freeze wrote: 
> I think 'transaction' is a reserved word. Try changing it to
> 'transactions'.
> 
> On Feb 4, 12:35 pm, Jason Brower  wrote:
> > Prolly obvious, but I can't see it... can you?
> >
> >  db.py
> > 6KViewDownload
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Dumb syntax error! Can't fix it!

2010-02-04 Thread Jason Brower
Yes of course... (:
Traceback (most recent call last): 
File "/home/encompass/Programming/Web Pages/2hand/gluon/restricted.py", line 
173, in restricted
exec ccode in environment
  File "/home/encompass/Programming/Web 
Pages/2hand/applications/2hand/models/db.py", line 57, in 
SQLField('created', 'datetime', default=now, readable=False))
  File "/home/encompass/Programming/Web Pages/2hand/gluon/sql.py", line 1252, 
in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "/home/encompass/Programming/Web Pages/2hand/gluon/sql.py", line 1669, 
in _create
self._db._execute(query)
  File "/home/encompass/Programming/Web Pages/2hand/gluon/sql.py", line 890, in 

self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: near "transaction": syntax error
On Thu, 2010-02-04 at 12:41 -0600, Thadeus Burgess wrote: 
> A traceback might help :)
> 
> -Thadeus
> 
> 
> 
> 
> 
> On Thu, Feb 4, 2010 at 12:35 PM, Jason Brower  wrote:
> > Prolly obvious, but I can't see it... can you?
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group at 
> > http://groups.google.com/group/web2py?hl=en.
> >
> >
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Dumb syntax error! Can't fix it!

2010-02-04 Thread Jason Brower
Prolly obvious, but I can't see it... can you?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

# coding: utf8

from datetime import datetime, date, time
now = datetime.utcnow()
today = date.today()

db = SQLDB('sqlite://2hand.db')


### 2hand DB
db.define_table('users',
SQLField('first_name', 'string', length=20),
SQLField('last_name', 'string', length=20),
SQLField('username', 'string', length=20),
SQLField('password', 'password'),
SQLField('status', 'string', requires=IS_IN_SET(['Admin','SuperAdmin'])),
SQLField('created', 'datetime', default=now, readable=False, writable=False))

db.define_table('customer',
SQLField('first_name', 'string', length=50),
SQLField('last_name', 'string', length=50),
SQLField('address', 'string', length=50),
SQLField('postal_code', 'string', length=15),
SQLField('city', 'string', length=25),
SQLField('email', 'string', length=50),
SQLField('phone_no', 'string', length=50),
SQLField('note', 'text'),
SQLField('email_date', 'datetime'),
SQLField('created', 'datetime', default=now, readable=False, writable=False))

db.define_table('taable',
SQLField('price', 'integer', length=11),
SQLField('note', 'text'))

db.define_table('customer_table',
SQLField('customer_id', db.customer),
SQLField('taable_id', db.taable),
SQLField('taable_price', db.taable),
SQLField('total_price', 'double', length=11),
SQLField('rent_start','date'),
SQLField('rent_end','date'),
SQLField('discount_start','date'),
SQLField('discount_end','date'),
SQLField('discount', 'string', length=10),
SQLField('discount_rate', 'string', length=10),
SQLField('description','text'))

db.define_table('transaction',
SQLField('customer_id', db.customer),
SQLField('receipt_no', 'integer', length=11),
SQLField('price', 'double', length=11),
SQLField('description', 'text'),
SQLField('taable_id', db.taable),
SQLField('overall', 'double', length=11),
SQLField('status', 'integer', length=3),
SQLField('pay_method', 'string', length=15),
SQLField('created', 'datetime', default=now, readable=False))

db.define_table('basket',
SQLField('receipt_no', 'string', length=5),
SQLField('customer_id', db.customer),
SQLField('transaction_id', db.transaction),
SQLField('price', 'double', length=11),
SQLField('description', 'text'),
SQLField('taable_id', db.taable),
SQLField('discount','string', length=5),
SQLField('status', 'string', length=5),
SQLField('created', 'datetime', default=now, readable=False, writable=False))

db.define_table('feedback',
SQLField('sender', db.customer),
SQLField('customer_id', db.customer),
SQLField('transaction_id', db.transaction),
SQLField('price', 'double', length=11),
SQLField('description', 'text'),
SQLField('taable_id', db.taable),
SQLField('discount','string', length=5),
SQLField('status', 'string', length=5),
SQLField('created', 'datetime', default=now, readable=False, writable=False))

# Dependencies & constraints
db.users.first_name.requires = IS_NOT_EMPTY()
db.users.last_name.requires = IS_NOT_EMPTY()
db.users.username.requires = IS_NOT_EMPTY()
db.users.password.requires = IS_NOT_EMPTY()
db.users.status.requires = IS_NOT_EMPTY()

db.customer.first_name.requires = IS_NOT_EMPTY()

db.taable.price.requires = IS_NOT_EMPTY()
db.taable.note.requires = IS_NOT_EMPTY()

db.customer_table.customer_id.requires = IS_IN_DB(db,'customer.id')
db.customer_table.taable_id.requires = IS_IN_DB(db,'taable.id')
db.customer_table.taable_price.requires = IS_IN_DB(db,'taable.price')
db.customer_table.total_price.requires = IS_NOT_EMPTY()
db.customer_table.rent_start.requires = IS_NOT_EMPTY()
db.customer_table.rent_end.requires = IS_NOT_EMPTY()
db.customer_table.discount_rate.requires = IS_NOT_EMPTY()

db.transaction.customer_id.requires = IS_IN_DB(db,'customer.id')
db.transaction.taable_id.requires = IS_IN_DB(db,'taable.id')
db.transaction.receipt_no.requires = IS_NOT_EMPTY()
db.transaction.price.requires = IS_NOT_EMPTY()
db.transaction.overall.requires = IS_NOT_EMPTY()
db.transaction.status.requires = IS_NOT_EMPTY()
db.transaction.pay_method.requires = IS_NOT_EMPTY()

db.basket.customer_id.requires = IS_IN_DB(db,'customer.id')
db.basket.transaction_id.requires = IS_IN_DB(db,'transaction.id')
db.basket.taable_id.requires = IS_IN_DB(db,'taable.id')
db.b

[web2py] Autocomplete with foreign chars...

2010-02-04 Thread Jason Brower
I have my nifty little autocomplete working thanks to your gracious help
but I have one more issue to resolve
It seems that searchs with öäå don't work.  I think it has to do with
how I send the data to the server so let me show you my search page:
I can't send the äåö in the url so how could I send it another way with
autocomplete?

def possible_paints():
paints=db(db.paint.name.upper().like("%"+request.vars.q'%')).select(orderby=db.paint.name)
return dict(paints=paints)
Weird how my email is formating... but that's it...
It takes the q in my url...
I send the request with that... and I wonder if it looses the formating
at that point?
For example if I search for naturgrå firebug tells me that I made a
request for 1=naturgr%C3%A5
But if I go to that address with firefox I get naturgrå
Weird eh?
---
Best Regards,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Autocomplete issues...

2010-02-03 Thread Jason Brower
I have autocomplete working... it properly displays the information I
want.  I also have it integrated with my model that is being rendered.
But I used this before:
db.orders.paints.requires = IS_IN_DB(db, 'paint.id', '%(name)s')
Which worked very nicely because it used the ID in that feild but
displayed the name.
How do I get the form to get the id rather than the name in that feild.
With the way it is now it takes a text feild and errors telling me I
don't have an integer. :/
I see two ways of fixing it, but dont' know how to do it...
1. Change the submit of the form to look for the id based on paint.name.
2. Make the form submit the actual ID but still show the name.
The second sounds faster as I don't have to query that database for that
unique name.  I just know it. :D
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: immediate web2py job opening

2010-02-03 Thread Jason Brower
Sounds fun, but I wonder, how big is the team and so forth? It may be
helpful for interested people to look into it.
Are you willing to hire those coming out of school? (I have a few if
so...)
It could also be nice to have a few other details.  For example, I can
program very well, but I don't like having to design for IE 6. I am a
better programmer than a designer.  So I look for programming jobs not
web jobs. (Makes me gag just thinking about it.)
Best Regards,
Jason Brower

On Tue, 2010-02-02 at 22:06 -0800, weheh wrote: 
> I just want to note that my post is not an exaggeration. The
> enterprise which I represent is routinely visited by top supermodels
> and movie stars and is in the same building as a top modeling agency.
> Not that that would make any difference to a serious web2py coder, now
> would it?
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Importing large amounts of data incremently gets slower...

2010-01-31 Thread Jason Brower
It's interesting, but now that my little import tool works.. I have
noticed with very large imports 16,000+ records to 3 different tables it
gets slower and slower over time.  I started one import and it took over
3 hours.  But started very fast and slowed down in about 15 mintues to
about 1 record a second. (OR something like that, not exactly sure.) The
other sites on the server where slow as well.
Now that's not to big of a deal for me as I hope to do imports only a
few times a year, but I wanted to let the list be aware of it, and I
wonder if it is an issue with what I have done, a little with python
(reassigning variable space over and over or something similar) or
something with the db.
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] clean in admin

2010-01-29 Thread Jason Brower
Yup.  It's cleared your login session. :)  So no one, including you in
logged in. :D
BR,
Jason 
On Fri, 2010-01-29 at 09:44 -0700, Wes James wrote: 
> When I click on clean in admin it takes me to the admin login page
> 
> w2p 1.74.8
> 
> -wes
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] New site in web2py

2010-01-29 Thread Jason Brower
I think those are tango icons, they are public domain.
On Fri, 2010-01-29 at 12:50 +, Miguel Lopes wrote: 
> There's some problem with the "noticia" view since the html of the
> news body is rendering as text.
> 
> 
> Congratulations on the site. Nice icon set. Is it opensource / free?
> 
> 
> Miguel
> -- 
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Form not working....

2010-01-29 Thread Jason Brower
Ok I think I got it...
I needed to check if it was accepted before it would take it...
so I added after the form = bla bla
if form.accepts(request.vars, session):
response.flash="New order added"
And it works perfectly.  Thanks for the help!!
BR,
Jason Brower

On Fri, 2010-01-29 at 01:00 -0800, pistacchio wrote: 
> hi jason,
> by writing
> 
> orders = SQLFORM(db.numbers)
> 
> you are assigning to the variable "orders" the form. in the following
> line you return form=form, but the latter is a null object.
> 
> so, either you change the name of the variable like this:
> form = SQLFORM(db.numbers)
> return dict(form=form)
> {{=form}}
> 
> or you pass order:
> 
> order = SQLFORM(db.numbers)
> return dict(form=order)
> {{=form}}
> 
> or
> 
> order = SQLFORM(db.numbers)
> return dict(order=order)
> {{=order}}
> 
> hope this helps understanding the logic behind it.
> 
> On Jan 29, 9:00 am, Jason Brower  wrote:
> > I have this in the end of my controller...
> > orders = SQLFORM(db.numbers)
> > return dict(form=form)
> >
> > And I simply print it with the view...
> > {{=form}}
> >
> > In that view I use ajax pulls that look for new content in orders and
> > print it on that same page. (I need it so that other people on other
> > browsers can add content and it's seen in idle viewers canvas's.)  The
> > form is unaffected by the ajax pull as far as I know.
> > The form never seems to accept anything.  Nor do I get any errors.  I
> > can go into the database admin and add items and they add just fine even
> > with the same content.
> > Any ideas what I could be doing wrong?
> > BR,
> > Jason
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Form not working....

2010-01-29 Thread Jason Brower
I have this in the end of my controller...
orders = SQLFORM(db.numbers)
return dict(form=form)

And I simply print it with the view...
{{=form}}

In that view I use ajax pulls that look for new content in orders and
print it on that same page. (I need it so that other people on other
browsers can add content and it's seen in idle viewers canvas's.)  The
form is unaffected by the ajax pull as far as I know.
The form never seems to accept anything.  Nor do I get any errors.  I
can go into the database admin and add items and they add just fine even
with the same content.
Any ideas what I could be doing wrong?
BR,
Jason


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Checking my site in other browsers...

2010-01-28 Thread Jason Brower
I used to use this...
http://browsershots.org/
But it seems that I need a robots.txt file in the root of my site
here...
http://www.bullseyedesign4u.com/welcome/default/index
Is there an easy way to make this file in
http://www.bullseyedesign4u.com/robots.txt in my web2py install?  I
wonder if other sites demand the robot there as well. :/
Are there any other sites to get screenshots from other browsers?  I
can't find anyone with ie6 to get me a screenshot. I would love it if
someone here could too. :P
BR,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Mobile devices + web2py

2010-01-28 Thread Jason Brower
And if you need something more advanced than that... pywurfl is very
good.  Tells all the capabilities of the phone as well.  Even things
like if it has a camera and the screensizes.  Very powerful.  Used it in
my thesis project in web2py. (woot woot)
BR,
Jason Brower
On Thu, 2010-01-28 at 10:53 -0600, Thadeus Burgess wrote: 
> wow Massimo where did that one creep out of the depths from!
> 
> Lol I never knew :)
> 
> -Thadeus
> 
> 
> 
> 
> 
> On Thu, Jan 28, 2010 at 9:27 AM, tiago almeida
>  wrote:
> > Great! I missed that one.
> >
> > Thank you very much,
> > Tiago
> > -
> > On Thu, Jan 28, 2010 at 3:15 PM, mdipierro  wrote:
> >>
> >> http://www.web2py.com/examples/static/mobile_device_detect.py
> >>
> >> On Jan 28, 6:01 am, tiago almeida  wrote:
> >> > Hello,
> >> > does web2py have any mechanism for dealing with mobile devices? I'm
> >> > talking
> >> > about *determining if the user is on a mobile device* so that pages can
> >> > be
> >> > tailored for those screens.
> >> >
> >> > I've searched in the book and in web2pyslices and don't see anything
> >> > like
> >> > that.
> >> >
> >> > Thanks a lot in advance,
> >> > Tiago Almeida
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "web2py-users" group.
> >> To post to this group, send email to web...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> web2py+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/web2py?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/web2py?hl=en.
> >
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Couldn't we just ahve a / after everything address?

2010-01-28 Thread Jason Brower
I wonder if we could have the server always redirect to a / after all
address.
This makes it so our extra values can always work without having to use
a long URL(bla) string.
Having it different all the time can be a bit annoying.  There may be
better examples. :)
So:
www.jason.com/default/part
would always redirect to:
www.jason.com/default/part/

Is there anything wrong with that?
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Issues with join...

2010-01-27 Thread Jason Brower
I have the paint table and the order_que...
I wnat to join them to show only tables that have a que_letter. (Not
none but anything else.)
BR,
Jason Brower

On Wed, 2010-01-27 at 06:21 -0800, mdipierro wrote: 
> This is not a valid DAL query
> plate_que = db((db.order_que.que_letter != None)==db.paint.name).select
> ()
> (a!=b)==c?
> 
> can you say in words (or in SQL) what you need to do?
> 
> Massimo
> 
> On Jan 27, 12:49 am, Jason Brower  wrote:
> > I have a database as follow:
> > # coding: utf8
> > from datetime import datetime, date, time
> > now = datetime.utcnow()
> > today = date.today()
> >
> > db = SQLDB('sqlite://paint.sqlite')
> >
> > db.define_table('order_que',
> > Field('customer_code', length=30),
> > Field('paint'),
> > Field('can_size', requires=IS_IN_SET(['½ Litre', '1 Litre', '10
> > Litre', '30 Litre'])),
> > Field('pickup_time'),
> > Field('que_letter',
> > requires=IS_IN_SET([None,"A","B","C","D","E","F"])))
> >
> > db.define_table('paint',
> > Field('name', length=30, requires=IS_NOT_EMPTY(), unique=True),
> > Field('base_paint', length=3, requires=IS_NOT_EMPTY()),
> > Field('hex_color', length=6))
> >
> > db.define_table('tint',
> > Field('name', length=3, requires=IS_NOT_EMPTY()))
> >
> > db.define_table('paint_tints',
> > Field('paint_id', db.paint),
> > Field('tint_id', db.tint),
> > Field('units', 'integer'))
> >
> > db.order_que.paint.requires = IS_IN_DB(db, 'paint.id',  '%(name)s')
> > db.paint_tints.paint_id.requires=IS_IN_DB(db, 'paint.id', '%(name)s')
> > db.paint_tints.tint_id.requires=IS_IN_DB(db, 'tint.id', '%(name)s')
> > db.order_que.customer_code.requires=IS_NOT_EMPTY()
> >
> > And I am trying to do a join like this...
> > plate_que = db((db.order_que.que_letter != None) ==
> > db.paint.name).select()
> > But no matter what I put into order_que.que_letter I don't get any
> > results.  Any ideas?
> > BR,
> > Jason
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] point to line of error in built in editor

2010-01-27 Thread Jason Brower
It would be nice if the line where the error accured would be pointed to
in the editor when you go to edit the file.
BR,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] create folder in view when new controller is made

2010-01-27 Thread Jason Brower
It would be nifty if the folder for a newly created controller file was
made.
What do you think?
---
Jason


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Huge amount of data slowing page loads...

2010-01-27 Thread Jason Brower
It's nice... but can I get it to work with things like in my example...
Where I press "a" and it gives me
Army
Jane
Jason
Gane
Best Regards,
Jason
On Tue, 2010-01-26 at 23:55 -0800, desfrenes wrote: 
> this works like a charm: http://docs.jquery.com/Plugins/Autocomplete
> 
> On 27 jan, 08:24, Jason Brower  wrote:
> > I have a database with 16k entries in it...
> > I have a one to many relation with them.
> > When I create a form with the requiers=IS_ID_DB() feature I notice a
> > huge lag in page load time. (I would to if I had 16k entries in one drop
> > down too.)
> > Is there a way to do this similar to the autocompletion but have it so I
> > can search for any part of it. (Like the awesome bar in firefox)
> > So I have
> > Jason
> > Jane
> > John
> > Gane
> > and when I press "a" it gives:
> > Jason
> > John
> > Gane
> > and so forth.
> > Best Regards,
> > Jason Brower
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Huge amount of data slowing page loads...

2010-01-26 Thread Jason Brower
I have a database with 16k entries in it...
I have a one to many relation with them.
When I create a form with the requiers=IS_ID_DB() feature I notice a
huge lag in page load time. (I would to if I had 16k entries in one drop
down too.)
Is there a way to do this similar to the autocompletion but have it so I
can search for any part of it. (Like the awesome bar in firefox)
So I have
Jason
Jane
John
Gane
and when I press "a" it gives:
Jason
John
Gane
and so forth.
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Issues with join...

2010-01-26 Thread Jason Brower
I have a database as follow:
# coding: utf8
from datetime import datetime, date, time
now = datetime.utcnow()
today = date.today()

db = SQLDB('sqlite://paint.sqlite')

db.define_table('order_que',
Field('customer_code', length=30),
Field('paint'),
Field('can_size', requires=IS_IN_SET(['½ Litre', '1 Litre', '10
Litre', '30 Litre'])),
Field('pickup_time'),
Field('que_letter',
requires=IS_IN_SET([None,"A","B","C","D","E","F"])))

db.define_table('paint',
Field('name', length=30, requires=IS_NOT_EMPTY(), unique=True),
Field('base_paint', length=3, requires=IS_NOT_EMPTY()),
Field('hex_color', length=6))

db.define_table('tint',
Field('name', length=3, requires=IS_NOT_EMPTY()))

db.define_table('paint_tints',
Field('paint_id', db.paint),
Field('tint_id', db.tint),
Field('units', 'integer'))


db.order_que.paint.requires = IS_IN_DB(db, 'paint.id',  '%(name)s')
db.paint_tints.paint_id.requires=IS_IN_DB(db, 'paint.id', '%(name)s')
db.paint_tints.tint_id.requires=IS_IN_DB(db, 'tint.id', '%(name)s')
db.order_que.customer_code.requires=IS_NOT_EMPTY()

And I am trying to do a join like this...
plate_que = db((db.order_que.que_letter != None) ==
db.paint.name).select()
But no matter what I put into order_que.que_letter I don't get any
results.  Any ideas?
BR,
Jason

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] 1.74.7 is OUT

2010-01-23 Thread Jason Brower
In email...
On Sat, 2010-01-23 at 14:03 -0800, mdipierro wrote: 
> New features:
> 
> 1) request_password_reset and password reset verification
> 2) python web2py.py -S app -M -R script.py -A arg1 arg2 arg3
> 3) support for T("%(a)s") % dict(a="hello")
What does this one mean?  Does this mean I can translate feilds in my
database? (if not I would love to know how as I have to translate
everything in to three languages here in finland. :D)
BR, Jason 
> 
> I still have a couple of pending patches and I will try to include
> them during them tomorrow.
> 
> Meanwhile please test this.
> 
> Massimo
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Request/Idea

2010-01-21 Thread Jason Brower
I don't know if this would work. But perhaps we could have a selected
list of plug-ins.  One for each task.  A good example if the ubuntu
software center.  It skips all the extras, and half done stuff and let's
people see stuff with clean and clear information, unlike synaptic
package manager(everything all at once).  People that want there plug-in
would need to promote it here and under the dictators feelings it could
be accepted or rejected.
Perhaps that's to bureaucratic, but it may work.
On Thu, 2010-01-21 at 17:08 -0600, Thadeus Burgess wrote: 
> We're going to have a problem though that there will be multiple
> versions of the same plugin that does the same thing. I also have a
> comments/tagging/star-rating for my blog, if they offer the exact same
> functionality (i already have a markdown embeded into my comment
> plugin) then we don't need two.
> 
> -Thadeus
> 
> 
> 
> 
> 
> On Thu, Jan 21, 2010 at 4:56 PM, selecta  wrote:
> > great idea, i wrote a couple of plug-ins by now which i guess some of
> > could find useful (user admin, generic star-rating, binarry rating,
> > comments (improved), tagging (improved), systems biology annotations)
> > but since i got like no feedback on posting my fist plug-in and seeing
> > no one else post plug-ins i am not quite willing to share them.
> > Instead i would trade them while waiting for this new plug-in app
> > store.
> >
> > Plug-ins that I need are
> >
> > - Decentralized Authentication
> >  log-in/sign-up from facebook/twitter/... any open id service, i've
> > seen this as a slice
> > - Geo-tagging
> >  anything that easily lets your geotag records
> > - Nice Usage Statistics
> >  log file analyser that makes some nice plots
> > - Issue Tracker
> >  bug/feature tracker with at least rating of item priority (1-10 with
> > color highlighting) and item status, even better would be a
> > integration with the error tracking in web2py
> > - Shorten Link
> >  create damn short url from a random long url
> > - Twitter Plug-in
> >  that remembers twitter messages and updates them automatically and
> > where you can configure how many messages you want to display (maybe I
> > just have to read the twitter api a little better for that one)
> >
> > Plug-ins that I have
> > -user admin
> > create groups, add/remove users from groups, confirm user
> > -star-rating,
> > make a star-rating widget (with an arbitrary number of stars and
> > splits like half and quarter stars) for any db record with {{=star-rate
> > ('movie',movie.id,20,2,)}}, only logged in users can rate, your can
> > put multiple star-rating widgets in one view, information is submitted
> > with ajax,
> > -binary rating
> > logged in user can bin-rate (thumbs up/thumbs down) or approve (tick/
> > red X) any db record
> > -comments (improved)
> > logged in user can write comments and bin-rate (see above) comments
> > from other users, currently i am adding a WYSIWYG markdown edit
> > interface (some troubles there)
> > -tagging (improved)
> > logged in users can tag, generates tag clouds for all tags, one table,
> > one record, a user, I also have some code to find items by tag so the
> > tag clouds can be links! (based on Massimos basic tagging plug-in)
> >
> > If you have any of the plug-ins that I want or something that I might
> > like (social network/web2.0 stuff/...) and you want to trade please
> > tell me. It is not that I do not want to publish the plug-ins at some
> > point but since nobody seemed to be interested so far I will wait till
> > I see that I get something back
> >
> >
> > On Jan 21, 8:13 pm, Thadeus Burgess  wrote:
> >> +1 and this could easily integrate into plugincentral (of which lately
> >> I have had no time since my real job is taking all of my time
> >> currently)
> >>
> >> -Thadeus
> >>
> >>
> >>
> >> On Thu, Jan 21, 2010 at 7:56 AM, mdipierro  wrote:
> >> > I completely agree with this but one more step is necessary.
> >>
> >> > Currently with "web2py plugin" we just mean an autonomous subset of an
> >> > app.
> >>
> >> > To do what you want we need a sophisticated kind of plugin. I think we
> >> > need a CMS and plugins that can talk to the CMS. We need a protocol.
> >>
> >> > Massimo
> >>
> >> > On Jan 21, 4:15 am, Jason Brower  wrote:
> >> >> I am glad you guys agree.  I actually don't even know where to get
> >> >

Re: [web2py] Re: ImportError: No module named ...

2010-01-21 Thread Jason Brower
Hei,
Totally off topic.  But wanted to say thanking for using web2py in
finland!
Best Regards,
Jason Brower
(Oulu)

On Wed, 2010-01-20 at 21:45 -0800, kari wrote: 
> Thanks for the reply - I think a typo in my original message might
> have
> given a wrong impression of the problem I am facing.
> 
> Instead of '... replaced by a model I have used in the import
> statement'
> it should have said '... replaced by a MODULE I have used...', for
> example:
> 
> import numpy
> 
> But then when trying too run the application in web2py I get an error:
> ImportError: No module named numpy
> 
> I should also add that the same applications work fine on web2py in my
> Ubuntu 9.10 box.
> 
> I tried to add
> numpy = local_import('numpy') to the beginning of the default.py to no
> avail (if I understood your advice correctly).
> 
> kari
> 
> On Jan 20, 5:18 pm, mdipierro  wrote:
> > You do not import models like you do in Django. models are
> > automatically executed in alphabetic order before the controller.
> >
> > You only import third party modules (as long as they are properly
> > installed) or modules in the /app/modules/ folder using
> >
> >mymodule=local_import('mymodule')
> >
> > Hope this helps.
> >
> > Massimo
> >
> > On Jan 20, 5:34 am, kari  wrote:
> >
> > > Hi,
> > > I am facing a problem on Windows installation of web2py. When trying
> > > to run applications I get the following error:
> >
> > > ImportError: No module named ...
> >
> > > ... replaced by a model I have used in the import statement in
> > > default.py
> >
> > > All the modules I have used are installed and thety can be imported
> > > when called from the python console or with any ordinary python
> > > application by 'python foo.py' type of a call.
> >
> > > It seems web2py does not understand the paths the same way as my
> > > python installation. Any ideas how this could be fixed?
> >
> > > Many thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: Request/Idea

2010-01-21 Thread Jason Brower
I am glad you guys agree.  I actually don't even know where to get
pluggins at this point.  For example, I could jsut add all the pluggins
I need at ones for an app I am buildings in one quick snap.
--Plugins---
|X| Creditcard transations
| | Blog Tool
|X| Admin Tool
|X| Bandwidth Throttler
| | Pork and Beans
| | Avatar Builder
| | User Admin
-
|submit|
-
Something like that.

On Wed, 2010-01-20 at 22:53 -0800, waTR wrote: 
> +1
> 
> 
> 
> On Jan 19, 5:08 am, mdipierro  wrote:
> > +1
> >
> > On Jan 18, 11:00 pm, Anand Vaidya  wrote:
> >
> > > +1
> >
> > > Excellent feature to possess.
> >
> > > -Anand
> >
> > > On Jan 19, 12:16 pm, Jason Brower  wrote:
> >
> > > > I think it would be nifty to have an interface (app store?) to install
> > > > and remove pluggins from your web2py installation.  I suppose that
> > > > feature should be at the application level and not the web2py level.
> > > > Any thoughts on it?  It could parse a feed and then from it's name could
> > > > tell if it's been installed in that app or not.  It could also handle
> > > > the updates too. :D
> > > > Just my thoughts,
> > > > Jason


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] One submit for multiple forms. Is it possible?

2010-01-18 Thread Jason Brower
Couldn't you put all of them under one form?

On Mon, 2010-01-18 at 19:59 -0800, ionel wrote: 
> Hello,
> 
> I have multiple forms (multiple submit buttons) and I need to submit
> all forms when I click any submit button.
> Is it possible?
> 
> Thank you.
> 
> i.a.
> 


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] Request/Idea

2010-01-18 Thread Jason Brower
I think it would be nifty to have an interface (app store?) to install
and remove pluggins from your web2py installation.  I suppose that
feature should be at the application level and not the web2py level.
Any thoughts on it?  It could parse a feed and then from it's name could
tell if it's been installed in that app or not.  It could also handle
the updates too. :D
Just my thoughts,
Jason

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] showcase

2010-01-18 Thread Jason Brower
Looks great!  Good job!
On Mon, 2010-01-18 at 06:19 -0800, Chris wrote: 
> Hello,
> I am newbie in python and web2py. This is my first app.
> http://genille.vievox.com


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] How would you best implement a countdown?

2010-01-17 Thread Jason Brower
I want a countdown that works for that session that will never be
interupted by the refresh of the browser.
My guess, in theory, is to the following:
Set the time of the count down and when it started.
When ever the page is loaded it subtracts the time passed by the total
of the countdown, then use Javascript to let it keep counting down (Or
reload it with an ajax call.)
Is there a better way for this?
---
Best Regards,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: Importing a file and can't get some characters...

2010-01-12 Thread Jason Brower
There is no error reported it simple shows different(multiple)
charactors for ÖÄÅ in the view.
I am using sqlight3.
Best Regards,
Jason 
On Tue, 2010-01-12 at 06:57 -0800, Brian M wrote: 
> Which database are you using? What's the error message you're
> receiving?
> 
> On Jan 12, 5:06 am, Jason Brower  wrote:
> > In importing my file I seem to not be able to import ÄäÖöÅå properly.
> > The file I am pulling from is UTF-8 according to my text editor.  Could
> > I be doing something wrong with the import?
> > Best Regards,
> > Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] Importing a file and can't get some characters...

2010-01-12 Thread Jason Brower
In importing my file I seem to not be able to import ÄäÖöÅå properly.
The file I am pulling from is UTF-8 according to my text editor.  Could
I be doing something wrong with the import?
Best Regards,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: Importing a large file

2010-01-12 Thread Jason Brower
Cool!  That seemed to be importing properly.  I have to be careful with
displaying that much data in my browser.  Actually filled my 2gb of ram!
One more small thing to note here is that it doesn't account for old
paint names in the database. So running the same file twice dupplicates,
what seems to be everything.  This doesn't bother me as I will be
dropping all data before importing anything from the file. (at least for
now.)
Thank you for your patients and help.  I have learned a lot!
Best Regards,
Jason
On Mon, 2010-01-11 at 07:23 -0800, Brian M wrote: 
> Jason, put your csv file in the private subfolder of your application
> and call it "paint.csv"  and then add the following code to your
> controller and it should work. (Well at least it imported the few
> records you provided, I haven't taken the time to totally check that
> everything lines up.
> ~Brian
> 
> 
> def import_formulas():
> import csv
> import os.path
> csv_path = os.path.join(request.folder,'private','paint.csv')
> paint_formulas = csv.reader(open(csv_path))
> 
> header = None
> 
> #variable to store the paints we've already put in
> #database (avoiding duplications and/or having to
> #constantly query db)
> paints = dict()
> 
> #variable to store the colorants already put in database
> known_colorants = dict()
> 
> #we'll use them to help get all the colorants
> #these are the indexes that have colorant names
> colorant_indexes = [2,4,6,8,10]
> 
> db.paint.truncate()#forget all paints for now so don't duplicate.
> 
> for formula in paint_formulas:
> formula_colorants = [] #will hold the colorants in this
> formula, however many there are
> if not header:
> header = formula #give value
> #and do nothing else cause it's just the column names
> else:
> #it's a paint formula
> #print formula
> #print "=="
> name = formula[0]
> base_coat = formula[1]
> #deal with the colorants
> for c in colorant_indexes:
> if formula[c] <> None and formula[c] <> '':
> colorant = formula[c]
> amount = formula[c+1] #next index is the amount
> #there's a colorant value to add
> if colorant in known_colorants:
> #already have this colorant in the database
> colorant_id = known_colorants[colorant]
> #retreive id from our knowns
> else:
> #new colorant, add to database
> known_colorants[colorant]=db.colorant.insert
> (name=colorant)
> colorant_id = known_colorants[colorant]
> #print "colorant id", colorant_id
> 
> #now add to this formula's list of colorants
> formula_colorants.append([colorant_id, amount])
> else:
> #no more colorants
> pass
> 
> #add the paint
> if not name in paints:
> paints[name]=db.paint.insert(name=name, base_coat =
> base_coat)
> 
> #then add each of the colorants
> for colorant in formula_colorants:
> 
> db.paint_colorants.insert(paint_id=paints[name],
> colorant_id=colorant[0], units = colorant[1])
> 
> my_paints = db((db.paint.id>0) & (db.paint_colorants.paint_id ==
> db.paint.id) & (db.colorant.id ==
> db.paint_colorants.colorant_id)).select(orderby=db.paint.name|
> db.colorant.name)
> 
> return dict(my_paints = my_paints)
> 
> On Jan 11, 7:42 am, Jason Brower  wrote:
> > Your requested some more data...
> > "paint_name","base_paint","colorant","amount","colorant","amount","colorant 
> > ","amount","colorant","amount","colorant","amount"
> > "10 JORASDUN",C,DD1,56,fS1,42,So1,110,AA1,8,,
> > "10 SVFGH",W,To1,180
> > 1002-DG5R,R,Co2,30,la1,4,To1,5
> > 1008-Y24R,A,DD2,88,la1,17,Fo1,60
> > "147 BARWSSFD",E,do1,74,fa1,38,Ha1,44
> > "148 DUNKNMFRUN",D,Do1,56,Fa1,42,Go1,110,ti1,8,,
> > Thank you for your help in this regard, it's a complicated process
> > relative to what I am used to doing.
> > BR,
> > Jason Brower
> >

Re: [web2py] Re: Importing a large file

2010-01-11 Thread Jason Brower
Your requested some more data...
"paint_name","base_paint","colorant","amount","colorant","amount","colorant","amount","colorant","amount","colorant","amount"
"10 JORASDUN",C,DD1,56,fS1,42,So1,110,AA1,8,,
"10 SVFGH",W,To1,180
1002-DG5R,R,Co2,30,la1,4,To1,5
1008-Y24R,A,DD2,88,la1,17,Fo1,60
"147 BARWSSFD",E,do1,74,fa1,38,Ha1,44
"148 DUNKNMFRUN",D,Do1,56,Fa1,42,Go1,110,ti1,8,,
Thank you for your help in this regard, it's a complicated process
relative to what I am used to doing.
BR,
Jason Brower

On Sat, 2010-01-09 at 07:32 -0800, Brian M wrote: 
> paint_formulas is supposed to get the contents of the csv file. (See
> http://docs.python.org/library/csv.html) It should be populated by the
> line:
> paint_formulas = csv.reader(csvfile)
> where csv file should be the path to your csv file.
> 
> Actually, I think that line should read like this instead:
> paint_formulas = csv.reader(open(csvfile)) #was missing the open()
> before
> 
> Try this as a test of reading the csv file in a controller (should
> only show the first few records [0:10] instead of all 14K or whatever
> you've got).
> 
> def read_csv():
> import csv
> paint_formulas = csv.reader(open(csvfile))
> return dict(paint_formulas = paint_formulas[0:10], count = len
> (paint_formulas))
> 
> On Jan 9, 1:36 am, Jason Brower  wrote:
> > It is much more understandable.  But it seems that the name
> > paint_formulas is not defined.  What is supposed to be populated there?
> > Best Regards,
> > Jason
> >
> >
> >
> > On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote:
> > > Jason,
> > > What's the syntax error?
> > > Try this, it's untested but should be verbose enough to get you there.
> > > If you have trouble perhaps provide a sample file (few dozen records)
> > > that we can test against.
> >
> > > import csv
> > > paint_formulas = csv.reader(csvfile)
> > > header = None
> >
> > > #variable to store the paints we've already put in
> > > #database (avoiding duplications and/or having to
> > > #constantly query db)
> > > paints = dict()
> >
> > > #variable to store the colorants already put in database
> > > known_colorants = dict()
> >
> > > #these are the indexes that have colorant names
> > > #we'll use them to help get all the colorants
> > > colorant_indexes = [2,4,6,8,10]
> >
> > > for formula in paint_formulas:
> > > formula_colorants = [] #will hold the colorants in this formula,
> > > however many there are
> > > if not header:
> > > header = formula #give value
> > > #and do nothing else cause it's just the column names
> > > else:
> > > #it's a paint formula
> > > name = row[0]
> > > base = row[1]
> > > #deal with the colorants
> > > for c in colorant_indexes:
> > > if row[c] <> None:
> > > colorant = row[c]
> > > amount = row[c+1] #next index is the amount
> > > #there's a colorant value to add
> > > if colorant in known_colorants:
> > > #already have this colorant in the database
> > > colorant_id = known_colorants[colorant]#retreive
> > > id from our knowns
> > > else:
> > > #new colorant, add to database
> > > known_colorants[colorant]=db.colorant.insert
> > > (name=colorant)
> > > colorant_id = known_colorants[colorant]
> >
> > > #now add to this formula's list of colorants
> > > formula_colorants.append(dict(id = colorant_id, amount
> > > = amount))
> > > else:
> > > #no more colorants
> > > pass
> >
> > > #add the paint
> > > if not name in paints:
> > > paints[name]=db.paint.insert(name=name)
> >
> > > #then add each of the colorants
> > > for colorant in formula_colorants:
> > > db.paint_colorants.insert(paint_id=paints[name],
> > > base_coat = base,
> > > colorant_id=colorant[id], units = colorant
> > > [amount]

Re: [web2py] Re: Importing a large file

2010-01-11 Thread Jason Brower
Using only what I know I have implemented this...
def rebuild_database:
import sys
data = open("/home/jason/Desktop/colorant_tints.txt")
parsed_data = []
for line in data.readlines():
parsed_data.append(line.rsplit(","))
sys.stdout.write(".")
for line in parsed_data:
paint_name = line.pop(0)
base_paint = line.pop(0)
#split them up
tint_amount = []
tint_names = []
tint = True
#Add the paint before we see what tints are available
if db(db.paint.name == paint_name):
db(db.paint.name == paint_name).update(base_paint =
base_paint)
else:
db.paint.insert(name = paint_name, base_coat=base_coat)
for item in line:
if tint:
tint_names.append(item)
tint = False
else:
amount.append(item)
tint = True
#add the tints
for item in range(len(tint_names)):
if not db(db.tint.name == tint_names[item]):
db.tint.insert(name = tint_names[item])
#Add the paints tints and their amounts
tint_item = db(db.tint.name ==
tint_names[item]).select()
paint_item = db(db.paint.name == paint_name).select()
paint_item = db(db.paint.name == paint_name).select()
db.paint_tints.insert(paint_id = paint_item.id, tint_id
= tint_item.id, amount = tint_amounts[item])
return dict()

Weird enough, I haven't played with the DAL to get what I am doing wrong
in those last 3 or 4 lines.  Then again, your code semes alot cooler. (:
---
Best Regards,
Jason Brower
On Sat, 2010-01-09 at 07:32 -0800, Brian M wrote: 
> paint_formulas is supposed to get the contents of the csv file. (See
> http://docs.python.org/library/csv.html) It should be populated by the
> line:
> paint_formulas = csv.reader(csvfile)
> where csv file should be the path to your csv file.
> 
> Actually, I think that line should read like this instead:
> paint_formulas = csv.reader(open(csvfile)) #was missing the open()
> before
> 
> Try this as a test of reading the csv file in a controller (should
> only show the first few records [0:10] instead of all 14K or whatever
> you've got).
> 
> def read_csv():
> import csv
> paint_formulas = csv.reader(open(csvfile))
> return dict(paint_formulas = paint_formulas[0:10], count = len
> (paint_formulas))
> 
> On Jan 9, 1:36 am, Jason Brower  wrote:
> > It is much more understandable.  But it seems that the name
> > paint_formulas is not defined.  What is supposed to be populated there?
> > Best Regards,
> > Jason
> >
> >
> >
> > On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote:
> > > Jason,
> > > What's the syntax error?
> > > Try this, it's untested but should be verbose enough to get you there.
> > > If you have trouble perhaps provide a sample file (few dozen records)
> > > that we can test against.
> >
> > > import csv
> > > paint_formulas = csv.reader(csvfile)
> > > header = None
> >
> > > #variable to store the paints we've already put in
> > > #database (avoiding duplications and/or having to
> > > #constantly query db)
> > > paints = dict()
> >
> > > #variable to store the colorants already put in database
> > > known_colorants = dict()
> >
> > > #these are the indexes that have colorant names
> > > #we'll use them to help get all the colorants
> > > colorant_indexes = [2,4,6,8,10]
> >
> > > for formula in paint_formulas:
> > > formula_colorants = [] #will hold the colorants in this formula,
> > > however many there are
> > > if not header:
> > > header = formula #give value
> > > #and do nothing else cause it's just the column names
> > > else:
> > > #it's a paint formula
> > > name = row[0]
> > > base = row[1]
> > > #deal with the colorants
> > > for c in colorant_indexes:
> > > if row[c] <> None:
> > > colorant = row[c]
> > > amount = row[c+1] #next index is the amount
> > > #there's a colorant value to add
> > > if colorant in known_colorants:
> > > #already have this colorant in the database
> > > colorant_id = known_colorants[colorant]#retreive
> > > id from our knowns
> > > else:
> > >   

Re: [web2py] Re: Importing a large file

2010-01-11 Thread Jason Brower
It seems to give me the error:
type error '_csv.reader' object is unsubscriptable
Regards,
Jason 

On Sat, 2010-01-09 at 07:32 -0800, Brian M wrote: 
> paint_formulas is supposed to get the contents of the csv file. (See
> http://docs.python.org/library/csv.html) It should be populated by the
> line:
> paint_formulas = csv.reader(csvfile)
> where csv file should be the path to your csv file.
> 
> Actually, I think that line should read like this instead:
> paint_formulas = csv.reader(open(csvfile)) #was missing the open()
> before
> 
> Try this as a test of reading the csv file in a controller (should
> only show the first few records [0:10] instead of all 14K or whatever
> you've got).
> 
> def read_csv():
> import csv
> paint_formulas = csv.reader(open(csvfile))
> return dict(paint_formulas = paint_formulas[0:10], count = len
> (paint_formulas))
> 
> On Jan 9, 1:36 am, Jason Brower  wrote:
> > It is much more understandable.  But it seems that the name
> > paint_formulas is not defined.  What is supposed to be populated there?
> > Best Regards,
> > Jason
> >
> >
> >
> > On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote:
> > > Jason,
> > > What's the syntax error?
> > > Try this, it's untested but should be verbose enough to get you there.
> > > If you have trouble perhaps provide a sample file (few dozen records)
> > > that we can test against.
> >
> > > import csv
> > > paint_formulas = csv.reader(csvfile)
> > > header = None
> >
> > > #variable to store the paints we've already put in
> > > #database (avoiding duplications and/or having to
> > > #constantly query db)
> > > paints = dict()
> >
> > > #variable to store the colorants already put in database
> > > known_colorants = dict()
> >
> > > #these are the indexes that have colorant names
> > > #we'll use them to help get all the colorants
> > > colorant_indexes = [2,4,6,8,10]
> >
> > > for formula in paint_formulas:
> > > formula_colorants = [] #will hold the colorants in this formula,
> > > however many there are
> > > if not header:
> > > header = formula #give value
> > > #and do nothing else cause it's just the column names
> > > else:
> > > #it's a paint formula
> > > name = row[0]
> > > base = row[1]
> > > #deal with the colorants
> > > for c in colorant_indexes:
> > > if row[c] <> None:
> > > colorant = row[c]
> > > amount = row[c+1] #next index is the amount
> > > #there's a colorant value to add
> > > if colorant in known_colorants:
> > > #already have this colorant in the database
> > > colorant_id = known_colorants[colorant]#retreive
> > > id from our knowns
> > > else:
> > > #new colorant, add to database
> > > known_colorants[colorant]=db.colorant.insert
> > > (name=colorant)
> > > colorant_id = known_colorants[colorant]
> >
> > > #now add to this formula's list of colorants
> > > formula_colorants.append(dict(id = colorant_id, amount
> > > = amount))
> > > else:
> > > #no more colorants
> > > pass
> >
> > > #add the paint
> > > if not name in paints:
> > > paints[name]=db.paint.insert(name=name)
> >
> > > #then add each of the colorants
> > > for colorant in formula_colorants:
> > > db.paint_colorants.insert(paint_id=paints[name],
> > > base_coat = base,
> > > colorant_id=colorant[id], units = colorant
> > > [amount])
> >
> > > Good Luck,
> > > Brian
> >
> > > On Jan 8, 7:57 pm, Jason Brower  wrote:
> > > > I tried the script but couldn't get through the syntax error. Sorry,
> > > > lots of commands I don't know there. :/
> > > > BR,
> > > > Jason
> >
> > > > On Fri, 2010-01-08 at 09:17 -0800, Brian M wrote:
> > > > > I have been working on using web2py to import csv files and find that
> > > > > in general it works very wel

Re: [web2py] Share some wisdom

2010-01-08 Thread Jason Brower
On Fri, 2010-01-08 at 23:56 -0600, Thadeus Burgess wrote: 
> I am a young programmer. The thought of managing a semi-large
> application seems a bit... daunting to me. I was hoping some older
> programmers, and those with experience managing projects that were
> either large, or had multiple developers work on, could share some
> insights with me.
> 
> Here are some of my larger questions. These mostly pertain to working
> in a corporate environment, either in a multi-developer or
> single-developer. The kind of stuff they don't teach you in school.
> 
> With a large project, how do you handle the tracking of bugs ? I
> figure this can be broken up into two areas. The first being tracking
> bugs caught by developers. These are bugs that are in the current
> development trunk. How are these bugs handled, between developers? The
> second are bugs that make it into the release version, bugs that get
> reported by the end users, how are these bugs
> tracked/handled/communicated? Usually I just keep a simple text file
> with a list of what needs to be done, and current bugs, but this has
> gotten out of hand.
It really depends on the company you work with.  Some of common bug
trackers like Bugzilla, some have a sheet of paper they hand you with a
list of bugs to fix.  It really depends on your manager and how he
works.  Some are technical, some are not.  I personally feel that a wiki
is the absolute minumum thing to use.  That way people working on bugs
or features can post there progress there easily without passing emails
to the wholeworld over and over. 
> 
> Now when dealing with multiple developers on the same project, how are
> tasks delegated to the respective individual, and how is each
> individuals status tracked?
Again, depends, both on the feature/bug, or the manager that you work
with.  The project tasks should be given by the manager, but sometimes
you have to work with your other teammates to find what is best for the
team and you pick what you want and so do the other devs. 
> 
> Any other insights gained with the management of software projects I
> would greatly appreciated!
Remember version control, if you don't know that your really in trouble.
It's very important to use version control even if there is one of you.
Also, remember that you, as a beginner maynot be able to do it, but work
hard and do your best, when I worked at one place, I had HUGE tasks in
front of me, but with some heavy research I was able to figure it out.
Don't be afraid to tell your boss the truth before the big update
meeting of your status and that you are having trouble.  It builds a
trust and makes you more predictable when YOU update with the boss. 
> 
> On the notes with bug tracking, I know there are systems (like trac,
> bugzilla, etc) out there... are these a solution that you would use in
> a corporate environment? And how would you "use" these tools?
bugzilla is very heavily used in both open and closed software.  I know
many video game companies that actually use it. 
> 
> -Thadeus


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: Importing a large file

2010-01-08 Thread Jason Brower
It is much more understandable.  But it seems that the name
paint_formulas is not defined.  What is supposed to be populated there?
Best Regards,
Jason
On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote: 
> Jason,
> What's the syntax error?
> Try this, it's untested but should be verbose enough to get you there.
> If you have trouble perhaps provide a sample file (few dozen records)
> that we can test against.
> 
> import csv
> paint_formulas = csv.reader(csvfile)
> header = None
> 
> #variable to store the paints we've already put in
> #database (avoiding duplications and/or having to
> #constantly query db)
> paints = dict()
> 
> #variable to store the colorants already put in database
> known_colorants = dict()
> 
> #these are the indexes that have colorant names
> #we'll use them to help get all the colorants
> colorant_indexes = [2,4,6,8,10]
> 
> for formula in paint_formulas:
> formula_colorants = [] #will hold the colorants in this formula,
> however many there are
> if not header:
> header = formula #give value
> #and do nothing else cause it's just the column names
> else:
> #it's a paint formula
> name = row[0]
> base = row[1]
> #deal with the colorants
> for c in colorant_indexes:
> if row[c] <> None:
> colorant = row[c]
> amount = row[c+1] #next index is the amount
> #there's a colorant value to add
> if colorant in known_colorants:
> #already have this colorant in the database
> colorant_id = known_colorants[colorant]#retreive
> id from our knowns
> else:
> #new colorant, add to database
> known_colorants[colorant]=db.colorant.insert
> (name=colorant)
> colorant_id = known_colorants[colorant]
> 
> #now add to this formula's list of colorants
> formula_colorants.append(dict(id = colorant_id, amount
> = amount))
> else:
> #no more colorants
> pass
> 
> #add the paint
> if not name in paints:
> paints[name]=db.paint.insert(name=name)
> 
> #then add each of the colorants
> for colorant in formula_colorants:
> db.paint_colorants.insert(paint_id=paints[name],
> base_coat = base,
> colorant_id=colorant[id], units = colorant
> [amount])
> 
> 
> Good Luck,
> Brian
> 
> On Jan 8, 7:57 pm, Jason Brower  wrote:
> > I tried the script but couldn't get through the syntax error. Sorry,
> > lots of commands I don't know there. :/
> > BR,
> > Jason
> >
> >
> >
> > On Fri, 2010-01-08 at 09:17 -0800, Brian M wrote:
> > > I have been working on using web2py to import csv files and find that
> > > in general it works very well. You will need to be careful with
> > > pulling in the colorant and amount fields - if you use the
> > > csv.DictReader() to refer to columns in the CSV file by name instead
> > > of index you'll find that you only get the value for the *last*
> > > colorant and amount. In other words, just using row['Colorant'] and row
> > > ['Amount'] will very likely cause you to loose data - you've got 5
> > > 'Colorant' entries in a single row, so each one in a row simply over-
> > > writes the earlier ones.  You will most likely need to use the
> > > indexes, or just rename the column headers in the csv file so they are
> > > unique.
> >
> > > ~Brian
> >
> > > On Jan 8, 4:51 am, mdipierro  wrote:
> > > > Something like this?
> >
> > > > import csv
> > > > reader = csv.reader(csvfile)
> > > > header = None
> > > > paints = {}
> > > > colorants = {}
> > > > for line in reader:
> > > > if not header: header = line
> > > > else:
> > > > row = dict([header[i],item) for i,item in enumerate(line)])
> > > > name = row['Color Name']
> > > > colorant = row['Colorant']
> > > > if not name in paints:
> > > > paints[name]=db.paint.insert(name=name)
> > > > if not colorant in colorants:
> > > > colorants[colorant]=db.colorant.insert(name=colorant)
> > > > db.paint_colorants.insert(paint_id=paints
> > > > [n

Re: [web2py] Re: Importing a large file

2010-01-08 Thread Jason Brower
I tried the script but couldn't get through the syntax error. Sorry,
lots of commands I don't know there. :/
BR,
Jason

On Fri, 2010-01-08 at 09:17 -0800, Brian M wrote: 
> I have been working on using web2py to import csv files and find that
> in general it works very well. You will need to be careful with
> pulling in the colorant and amount fields - if you use the
> csv.DictReader() to refer to columns in the CSV file by name instead
> of index you'll find that you only get the value for the *last*
> colorant and amount. In other words, just using row['Colorant'] and row
> ['Amount'] will very likely cause you to loose data - you've got 5
> 'Colorant' entries in a single row, so each one in a row simply over-
> writes the earlier ones.  You will most likely need to use the
> indexes, or just rename the column headers in the csv file so they are
> unique.
> 
> ~Brian
> 
> On Jan 8, 4:51 am, mdipierro  wrote:
> > Something like this?
> >
> > import csv
> > reader = csv.reader(csvfile)
> > header = None
> > paints = {}
> > colorants = {}
> > for line in reader:
> > if not header: header = line
> > else:
> > row = dict([header[i],item) for i,item in enumerate(line)])
> > name = row['Color Name']
> > colorant = row['Colorant']
> > if not name in paints:
> > paints[name]=db.paint.insert(name=name)
> > if not colorant in colorants:
> > colorants[colorant]=db.colorant.insert(name=colorant)
> > db.paint_colorants.insert(paint_id=paints
> > [name],colorant_id=colorants[colorant])
> >
> > On Jan 8, 4:10 am, Jason Brower  wrote:
> >
> >
> >
> > > I have data like this in a csv file
> > > "Color Name", Base, Colorant, Amount, Colorant, Amount, Colorant,
> > > Amount, Colorant, Amount, Colorant, Amount
> > > "10 PORDRR",G,fo1,76,da1,32,ro1,111,yi1,1,,
> > > It is for a paint database.
> > > Is it at all possible to import that into this model?
> > > Normally I would just take a few minutes and do it by hand.  But I have
> > > 14,000+ entries, so that's out of the question.  Any ideas?  In
> > > particular, how do you handle the variance in how many kinds of
> > > colorants are added. Notice in this example that is only 4 colorants,
> > > and 5+ could be in the page. (Currently from this extraction, only 5
> > > colorants and their amounts.
> >
> > > db = SQLDB('sqlite://paint.sqlite')
> >
> > > db.define_table('paint',
> > > Field('name', length=30, requires=IS_NOT_EMPTY(), unique=True),
> > > Field('base_coat', length=3, requires=IS_NOT_EMPTY()),
> > > Field('hex_color', length=6))
> >
> > > db.define_table('colorant',
> > > Field('name', length=3, requires=IS_NOT_EMPTY()))
> >
> > > db.define_table('paint_colorants',
> > > Field('paint_id', db.paint),
> > > Field('colorant_id', db.colorant),
> > > Field('units', 'integer'))
> >
> > > db.paint_colorants.paint_id.requires=IS_IN_DB(db, 'paint.id',
> > > '%(name)s')
> > > db.paint_colorants.colorant_id.requires=IS_IN_DB(db, 'paint.id',
> > > '%(name)s')
> >
> > > Best Regards,
> > > Jason Brower



-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] Importing a large file

2010-01-08 Thread Jason Brower
I have data like this in a csv file
"Color Name", Base, Colorant, Amount, Colorant, Amount, Colorant,
Amount, Colorant, Amount, Colorant, Amount
"10 PORDRR",G,fo1,76,da1,32,ro1,111,yi1,1,,
It is for a paint database.
Is it at all possible to import that into this model?
Normally I would just take a few minutes and do it by hand.  But I have
14,000+ entries, so that's out of the question.  Any ideas?  In
particular, how do you handle the variance in how many kinds of
colorants are added. Notice in this example that is only 4 colorants,
and 5+ could be in the page. (Currently from this extraction, only 5
colorants and their amounts.

db = SQLDB('sqlite://paint.sqlite')

db.define_table('paint',
Field('name', length=30, requires=IS_NOT_EMPTY(), unique=True),
Field('base_coat', length=3, requires=IS_NOT_EMPTY()),
Field('hex_color', length=6))

db.define_table('colorant',
Field('name', length=3, requires=IS_NOT_EMPTY()))

db.define_table('paint_colorants',
Field('paint_id', db.paint),
Field('colorant_id', db.colorant),
Field('units', 'integer'))

db.paint_colorants.paint_id.requires=IS_IN_DB(db, 'paint.id',
'%(name)s')
db.paint_colorants.colorant_id.requires=IS_IN_DB(db, 'paint.id',
'%(name)s')

Best Regards,
Jason Brower

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] job

2010-01-07 Thread Jason Brower
On Thu, 2010-01-07 at 11:54 -0800, mdipierro wrote: 
> Any of you behind this?
> 
> http://www.startuply.com/Jobs/Web_Py_Web_Developer_1856_1.aspx
> 
> if you know more I am curious.
I haven't checked lately, but is there a site for people looking for a
job in web2py on the homepage of web2py?  If not, I would recommend
seeing it there.  It could automatically send to the python website job
postings as well.
Best Regards,
Jason Brower


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py] Re: why is "uploads" folder so special?

2010-01-07 Thread Jason Brower
On Wed, 2010-01-06 at 22:58 -0800, weheh wrote: 
> I guess the os.path.join(request.folder...) isn't really necessary in
> the above-given example. Just there as part of my testing why this
> wasn't working.
Unless you uploaded it with your web app, I would put it in static.
Regards

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:38288] Complex Custom Validator

2010-01-04 Thread Jason Brower
Is there a way for me to create a custom form valuator that could
validate
"11 AA BB CC DD EE FF"
Basically a list of hex values with our without spaces.   It can be any
amount of hex values  (not length restricted).
---
Best Regards,
Jason Brower

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38153] Re: LOL

2010-01-01 Thread Jason Brower
Hehe... dang, link broken. :P
Buy it!  Make a site!  Great idea!

On Thu, 2009-12-31 at 12:31 +0100, Laszlo Zsolt Kiss wrote:
> Jake írta: 
> > Good luck with that
> > 
> > On Dec 30, 11:27 pm, Massimo Di Pierro 
> > wrote:
> >   
> > > http://london.craigslist.co.uk/stp/1531016430.html
> > > 
> > 
> > --
> > 
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group at 
> > http://groups.google.com/group/web2py?hl=en.
> > 
> > 
> > 
> >   
> geekgirlsearching.com powered by web2py :D
> 
> 
> --
> 
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:38085] roadmap?!

2009-12-30 Thread Jason Brower
I would highly recommend having this on your homepage.  It's important
for developers to see futureplans and what is new between releases.
BR,
Jason
On Wed, 2009-12-30 at 09:59 -0800, mdipierro wrote: 
> Alvaro said this over and over. We need a roadmap.
> 
> For me the most important things are:
> 
> 1) getting the new DAL done (and include support for more NoDB and
> Sybase)
> 
> 2) Create a set of standard and customizable plugins for:
>   a) comments (*)
>   b) tagging (*)
>   c) voting/rating
>   d) wiki/versioning
>   e) attachements of documents
>   f) google checkout (*)
>   e) quizzes and surveys (we can take it out from kpax)
>   g) autocomplete
>   h) embedding media files (photo gallery, video player, etc)
>   i) customization of layout (*)
> (*) we have some prototyes but not production quality yet.
> 
> I could use help with these and some of you have demonstrated better
> skills than mine on this.
> 
> 3) merge T4 and kpax to use plugins.
> 
> 4) Create a portable StringListProperty model type that works without
> GAE.
> 
> 5) Create a widget to display a StringListProperty field.
> 
> Massimo
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
> 
> 


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37954] Gathering a list of requested features, plugins and other what not for google summer of code...

2009-12-28 Thread Jason Brower
In the hopes of another google summer of code project.  I am hoping on
having web2py as part of the collection of participating organizations.
Could we gather a list of features, fixes, and other additions that
would help web2py become a better platform and help others become great
contributors to this great opensource project?
Basically, we need a single or many features/fixes/add-ons that would
keep a student busy for about 3 or 4 months time. They would be doing
this during their summer holiday period and would get 2500USD for there
work.
So with out further blabbing, what kind of projects could fit this
category?
--- Ideas ---
Put'em here...




--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:37846] Re: Documentation

2009-12-25 Thread Jason Brower
I agree... problem sets would be a good way for teachers to use the book
as well. :D
BR,
Jason Brower

On Fri, 2009-12-25 at 16:45 -0800, ma...@rockiger.com wrote: 
> A suggestion for the book. Could you add some problems sets to the
> new edition? It makes it easier for to learn the topics in the book.
> 
> On Dec 21, 11:17 pm, mdipierro  wrote:
> > You can view it for free on scribd but the only option to download is
> > lulu. There will be anewversion in summer 2010 because we already
> > have some undocumentednewfeatures but, as I did before, I will
> > probably just revise the chapter on DAL and the one on AJAX. I will
> > make those chapters available for free when ready. Nothing in thebook
> > is obsolete. Make sure you get the second edition.
> >
> > Massimo
> >
> > On Dec 21, 4:05 pm, sveinh  wrote:
> >
> >
> >
> > > Hi Massimo
> >
> > > I'mnewto web2py and I'm very impress with what I've seen so far.
> > > Great work!
> >
> > > I've been searching for documentation and the only thing I can get my
> > > hands on are some slide-decks and a small version of thebook.
> >
> > > Will I have to buy thebookor download it for the complete
> > > documentation, or is it available somewhere on the site? I saw the
> > > download was only USD 12 or so, and I'll gladly pay this.
> >
> > > If downloading the is the best option, do you have anewversion of
> > > thebookin the pipeline? When is the next version due?
> >
> > > In advance, thanks!
> >
> > > -sveinh
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
> 
> 


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:37728] SQLite to Postgress

2009-12-22 Thread Jason Brower
It would be another nifty feature to automate with a google summer of
code project. :D
Regards,
Jason

On Tue, 2009-12-22 at 15:16 -0600, Thadeus Burgess wrote:
> db.export_to_csv_file(open('/path/to/my/file.txt', 'w'))
> 
> and then when you switch your DAL over...
> 
> db.import_from_csv_file(open('/path/to/myfile.txt', 'r'))
> 
> -Thadeus
> 
> 
> 
> 
> On Tue, Dec 22, 2009 at 3:07 PM, Adolfo  wrote:
> Hello
> 
> I've been working with sqlite for develpment but now that i
> have
> finish with my app id like to use postgress. So i'd like to
> know if
> someone know a simple way of migrating the data in my Sqlite
> database
> to the one in Postgress.
> 
> Thanks
> 
> Adolfo
> 
> --
> 
> You received this message because you are subscribed to the
> Google Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
> 
> 
> 
> 
> 
> --
> 
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to web2py
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




Re: [web2py:37623] GSoC 2010 ideas

2009-12-21 Thread Jason Brower
I agree.  GSOC changed my life.  And I would love to see Web2py a part
of it.
It would be nice to have a new webdesign with more blattent examples.
(That may be too easy.)
Fix the Visual designer and complete integrating that into web2py.
My 2 cents...
Jason
On Mon, 2009-12-21 at 07:11 -0800, Timmie wrote: 
> Dear web2py developers,
> wouldn't it be great to have web2py participating in the next year's
> rally for coogle summer of code?
> 
> Here is my idea:
> 
> * expand the DAL to spatial data bases.
> 
> starting points:
> - GeoCouch: http://gitorious.org/geocouch/pages/Home
> - GeoAlchemy: http://www.geoalchemy.org/
> 
> What do you guys think?
> 
> Best regards,
> Timmie
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
> 
> 


--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:35166] Re: new in trunk, for fun

2009-11-11 Thread Jason (spot) Brower

AWSOME  This would come in very handy in teaching and testing!

On Thu, Nov 12, 2009 at 8:39 AM, mdipierro  wrote:
>
> I do not know if this should be in web2py or not but it can be useful
> for testing and debugging.
>
> from gluon.contrib.populate import populate
>
> db=DAL()
> db.define_table('person',
>                Field('name'))
>
> db.define_table('dog',
>                Field('name'),
>                Field('person',db.person),
>                Field('description',length=50),
>                Field('birthdate','date'))
>
> populate(db.person,5) ### guess what it does?
> populate(db.dog,10)
>
> print 'owner, dog name, description, birthdate'
> for row in db(db.person.id==db.dog.person).select():
>    print row.person.name, row.dog.name, row.dog.description,
> row.dog.birthdate
>
> sample output:
>
> owner, dog name, description, birthdate
> masasapo cedutopo M.c..Berridge. an untutored bird s wing is famili
> 2000-07-31
> posodaso todacoco Surely follows that these fiery eruptions at 186 0
> 2002-06-16
> posodaso dutocomo Spread over functioning properly the planet the ec
> 1997-05-10
> masasapo macocedu Modes of protozoa and continually added to be shot
> 2003-08-30
> masasapo cetomaso Circling round and explosively from the flesh avai
> 1990-07-27
> posodaso codacopa Fractions showing a dull white polar cap. illustra
> 1987-11-26
> dudamoso cesotaco Economically; a mastery of which the two feet four
> 2003-04-02
> dudamoso tasapoma Accomplishment would explode and open-sea knife-bl
> 1994-05-18
> samotomo dasapama Highly specialized in which they come to the creat
> 1998-11-27
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:35079] proper threading in web2py

2009-11-11 Thread Jason (spot) Brower

I want to run a small command over and over to check for data from a
serial port.  It will be using web2py as the frontend to this
application.
Not only am I new to threading techniques, but I want to get your
advise on how to properly create this thread in the controller or
elsewhere if needed.
Basically I send to a pySerial object just as I would to a file like
object.  I would have a reading tool that would whatch for new data
and a writing pool that would read the data.  When I get a certain
string in the seriel line, I hope to switch a flag on and tell that
something went wrong. My guess would be I have to somehow set
session.somethings_wrong to True or something.
Best Regards,
Jason Brower

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34922] Re: Join web2py wave

2009-11-09 Thread Jason Brower

I too would love an invatation. :D
BR,
Jason
On Sun, 2009-11-08 at 13:29 -0800, Richard wrote:
> yeah! - can invite again.
> 
> Have invited:
> denes1...@yahoo.ca
> roger.gicq...@gmail.com
> mbelle...@gmail.com
> whalb...@gmail.com
> debe...@yahoo.com
> digitalcry...@gmail.com
> maxu...@gmail.com
> 
> 
> 
> On Nov 9, 2:35 am, Marat Maksumov  wrote:
> > I am very interested in receiving an invitation to Google Wave...
> >
> > On Nov 7, 10:44 am, Nicolás de la Torre  wrote:
> >
> >
> >
> > > i have sent invites to:
> >
> > > vinc...@vincentdavis.com
> > > thade...@thadeusb.com
> > > szims...@gmail.com
> > > boris.manojlo...@gmail.com
> > > richard_gor...@verizon.net
> > > chris.st...@gmail.com
> > > m.grit...@gmail.com
> > > lapcc...@gmail.com
> > > obutov...@googlemail.com
> >
> > > Pls tell me if someone is missing.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34261] Re: Ability to transfere one database to another.

2009-10-30 Thread Jason Brower

Heh, oh yeah. :)  Thanks,
Jason Brower
On Fri, 2009-10-30 at 23:04 -0500, Thadeus Burgess wrote:
> db.export_to_csv_file(open('/path/to/file.csv', 'wb'))
> 
> db.import_from_csv_file(open('/path/to/file.csv', 'rb'))
> 
> -Thadeus
> 
> 
> 
> 
> On Fri, Oct 30, 2009 at 10:50 PM, Jason Brower 
> wrote:
> 
> I have the unfortunate fact that I have been using sqlite3 for
> some
> time, but my data is getting a little unstable.  How do I best
> transfere
> that data from one database to another without direct access
> to the
> admin screens as it is hosted remotely?
> For right now, I guess my best approach would be to copy the
> sqlite3
> files to my computer and run the admin from here, but that
> just gets me
> the data, I still have to insert it some how.
> BR
> Jason
> 
> 
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34260] Re: web2py update script

2009-10-30 Thread Jason Brower

If I had svn that would work. (I haven't checked.)
Regards,
Jason
On Fri, 2009-10-30 at 22:44 -0500, Thadeus Burgess wrote:
> I usually just
> 
> svn update && rm -R applications/examples applications/welcome
> 
> -Thadeus
> 
> 
> 
> 
> On Fri, Oct 30, 2009 at 10:33 PM, mr.freeze 
> wrote:
> 
> This is useful.  Perhaps worth making a slice?
> 
> http://www.web2pyslices.com/main/default/user/login?_next=/main/slices/make_slice
> 
> 
> 
> On Oct 30, 6:36 pm, Jonathan Lundell 
> wrote:
> > In case anyone is interested. I use it under OS X, but it
> ought to  
> > work under any unixalike. Put it in (say) update.sh in the
> same  
> > directory as web2py/, and run it to:
> >
> > 1. create a snapshot of your current web2py/, renamed to its
> web2py  
> > version
> > 2. download the new source version
> > 3. unzip it over your existing web2py/
> > 4. run the web2py application-update command
> >
> > Seems to work OK, ymmv, your own risk, always back up, don't
> come  
> > crying to me, etc.
> >
> > #!/bin/bash
> > #
> > TARGET=web2py   # web2py or a soft link to web2py
> > read a VERSION c < $TARGET/VERSION
> > SAVE=$TARGET-$VERSION
> > URL=http://www.web2py.com/examples/static/web2py_src.zip
> >
> > ZIP=`basename $URL`
> >
> > #  Save a copy of the current version,
> > #  but don't overwrite a previous save.
> > #
> > if [ -d $SAVE ]; then
> >  echo "Rename or remove $SAVE first" >&2
> >  cat $SAVE/VERSION >&2
> >  exit 1
> > fi
> > if [ -d $TARGET ]; then
> >  echo "Old version:"
> >  cat $TARGET/VERSION
> >  cp -R $TARGET $SAVE
> > fi
> > #
> > #  Fetch the new version
> > #
> > curl -O $URL
> > #
> > #  Unzip into web2py
> > #
> > unzip -o $ZIP
> > echo "New version:"
> > cat $TARGET/VERSION
> > #
> > #  Update the web2py standard applications
> > #
> > python $TARGET/web2py.py --upgrade=yes
> 
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34258] Ability to transfere one database to another.

2009-10-30 Thread Jason Brower

I have the unfortunate fact that I have been using sqlite3 for some
time, but my data is getting a little unstable.  How do I best transfere
that data from one database to another without direct access to the
admin screens as it is hosted remotely?
For right now, I guess my best approach would be to copy the sqlite3
files to my computer and run the admin from here, but that just gets me
the data, I still have to insert it some how.
BR
Jason


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34257] Re: web2py update script

2009-10-30 Thread Jason Brower

Yeah, I wish it had it's only little self updater.  And the best would
be to go back a step as well.
Regards,
Jason Brower

On Fri, 2009-10-30 at 16:36 -0700, Jonathan Lundell wrote:
> In case anyone is interested. I use it under OS X, but it ought to  
> work under any unixalike. Put it in (say) update.sh in the same  
> directory as web2py/, and run it to:
> 
> 1. create a snapshot of your current web2py/, renamed to its web2py  
> version
> 2. download the new source version
> 3. unzip it over your existing web2py/
> 4. run the web2py application-update command
> 
> Seems to work OK, ymmv, your own risk, always back up, don't come  
> crying to me, etc.
> 
> 
> #!/bin/bash
> #
> TARGET=web2py # web2py or a soft link to web2py
> read a VERSION c < $TARGET/VERSION
> SAVE=$TARGET-$VERSION
> URL=http://www.web2py.com/examples/static/web2py_src.zip
> 
> ZIP=`basename $URL`
> 
> #  Save a copy of the current version,
> #  but don't overwrite a previous save.
> #
> if [ -d $SAVE ]; then
>  echo "Rename or remove $SAVE first" >&2
>  cat $SAVE/VERSION >&2
>  exit 1
> fi
> if [ -d $TARGET ]; then
>  echo "Old version:"
>  cat $TARGET/VERSION
>  cp -R $TARGET $SAVE
> fi
> #
> #  Fetch the new version
> #
> curl -O $URL
> #
> #  Unzip into web2py
> #
> unzip -o $ZIP
> echo "New version:"
> cat $TARGET/VERSION
> #
> #  Update the web2py standard applications
> #
> python $TARGET/web2py.py --upgrade=yes
> 
> 
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33992] Re: new web2py book in the works?

2009-10-28 Thread Jason Brower

If you buy the book once, you get the "upgrades" for free. :P
Jason Brower
On Wed, 2009-10-28 at 15:05 -0700, Nick wrote:
> Thanks Massimo, with the frequency of new releases, it seems odd to
> buy the same book every year. as most second edition books don't come
> out one year after the original.
> 
> Not trying to complain here, but just trying to raise the point that
> the book may be taking the place of up-to-date documentation. With
> web2py being developed and seemingly changing fairly fast, compared to
> other frameworks, it's a bit of a banana to not have a real definitive
> (and open) documentation source. Take for example the CodeIgniter
> documentation - that is (more or less) the definitive guide to the
> framework. When a year of releases has gone by, the developers have
> updated the online documentation to match - not their personal book
> that they sell. While at the same time pointing out that (open)
> documentation of web2py is something that needs to be done.
> 
> Maybe I'm out of line here, but it struck me as something worth
> bringing up.
> Love the framework! :)
> -Nick
> 
> 
> 
> On Oct 28, 8:43 pm, mdipierro  wrote:
> > There is a second edition on lulu:
> >
> > http://www.lulu.com/content/4968879
> >
> > There will be a 3rd ed but not too soon.
> >
> > massimo
> >
> > On Oct 28, 2:10 pm, Nick  wrote:
> >
> > > Unfortunately, since I live in the Czech Republic, it's cheaper for me
> > > to buy the eBook & print/bind it - rather than pay shipping.
> >
> > > Is there a 3rd edition planned anytime soon?
> >
> > > On Oct 28, 7:46 pm, mdipierro  wrote:
> >
> > > > The printed second edition is already available (and cheaper):
> >
> > > >http://he-cda.wiley.com/WileyCDA/Section/id-321954.html
> >
> > > > but somehow Amazon did not pick that up. I have been complaining with
> > > > the publisher for one month.
> >
> > > > Massimo
> >
> > > > On Oct 28, 1:06 pm, Nick  wrote:
> >
> > > > > Hello All,
> >
> > > > >  I'm a fan of web2py, bought the ebook this past spring, even went
> > > > > down to the printers and paid to have it printed out and binded (hate
> > > > > reading books off my computer screen). Didn't have a chance to get too
> > > > > much development with web2py over the summer unfortunately. However,
> > > > > now that I'm getting back into it, I see there is a new version of the
> > > > > book, and at initial inspection (the preview window on the
> > > > > documentation page) it seems to be severely different than my copy,
> > > > > especially regarding the database.
> >
> > > > >  So, my question is, am I going to be wasting my money by buying/
> > > > > printing this book only to see a new version in another 6 months?
> >
> > > > > Thanks,
> > > > > -nick
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33990] Re: 1.69.1 is OUT

2009-10-28 Thread Jason Brower

Wow, I mean, woah, gees cool...
J
On Wed, 2009-10-28 at 14:41 -0700, mr.freeze wrote:
> With each keystroke web2py grows stronger...
> 
> On Oct 28, 4:08 pm, mdipierro  wrote:
> > Please check it form mistakes.
> >
> > There many many new features in trunk. too many that I do not have the
> > time to describe them all.
> > Here is a partial list:
> >
> > 1)
> > Lots of new DAL API described briefly here:
> >
> >  http://www.web2py.com/AlterEgo/default/show/248
> >
> > 2)
> > Support for legacy databases and non id primary key. This works with
> > MSSQL and, I think, Ingres. Anyway, Denes will explain more in a
> > subsequent email.
> >
> > 3)
> > response.keywords, response.description,response.author are
> > deprecated. They will continue work with your existing apps and
> > layout. Instead you should now use
> >
> >  response.meta.keywords, reponse.meta.description,
> > response.meta.author, 
> >
> > They are automatically embedded in the header when you {{include
> > 'web2py_ajax.html'}}.
> >
> > 4) If a controller needs a special css or js file it can now do:
> >
> > response.files.append(URL
> > (request.application,'static','yourfile.css'))
> > response.files.append(URL
> > (request.application,'static','yourfile.js'))
> >
> > and they will be included on demand by {{include 'web2py_ajax.html'}}
> >
> > 5) experimental plugin mechanism with admin functionality to pack,
> > unpack and delete plugins.
> > More on this later. "experimental" because I have not had time to
> > discuss detains with some users and there was not complete agreement.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33684] Re: powered by web2py?

2009-10-25 Thread Jason Brower

I like it!
Congrats!

On Sun, 2009-10-25 at 20:57 -0700, Darcy Clark wrote:
> http://www.qualitysystems.com
> 
> is powered by web2py.
> 
> thanks!
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33303] Re: running from source on Vista requires pywin32

2009-10-21 Thread Jason Brower

+1 to that feature. :P

On Wed, 2009-10-21 at 08:00 -0700, mdipierro wrote:
> I think they call it a feature
> 
> On Oct 21, 9:50 am, Thadeus Burgess  wrote:
> > Works fine on xp, this is a vista/windows 7 issue.
> >
> > I had the same problem on my windows 7 virtual machine, installing pywin32
> > fixed it, until windows update ran, then I had to reinstall pywin32 to fix,
> > very annoying bug with windows.
> >
> > -Thadeus
> >
> > On Wed, Oct 21, 2009 at 8:03 AM, carlo  wrote:
> >
> > > never had that problem on tens of win installations: which web2py
> > > version? I am going to test newer versions on fresh xp installations.
> >
> > > carlo
> >
> > > On 21 Ott, 11:15, stefaan  wrote:
> > > > Hello all,
> >
> > > > I guess my contribution was lost in the noise,
> > > > but I have the same problem on windows xp.
> >
> > > > Installing pywin32 also solved the problem for me.
> >
> > > > pywin32 probably should be documented as explicit
> > > > dependency for running web2py from source on windows platforms.
> >
> > > > Best regards,
> > > > Stefaan.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33285] Doc link disapears with save...

2009-10-20 Thread Jason Brower

I noticed that the [Doc] link vanishes after pressing the save button.
Minor, but my contribution. :)
Regards,
Jason


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33281] semaPrinter application is not working...

2009-10-20 Thread Jason Brower

I just noticed that my semaprinter app is not working anymore.  Any
ideas why?  I think it has to do with cron.
Traceback (most recent call last):
  File "/home/encompass/Desktop/prototype/gluon/restricted.py", line 184, in 
restricted
exec ccode in environment
  File 
"/home/encompass/Desktop/prototype/applications/admin/controllers/default.py", 
line 963, in 
  File "/home/encompass/Desktop/prototype/gluon/globals.py", line 102, in 

self._caller = lambda f: f()
  File 
"/home/encompass/Desktop/prototype/applications/admin/controllers/default.py", 
line 566, in design
if not os.path.exists(crontab): open(crontab,'w').write('#crontab')
IOError: [Errno 2] No such file or directory: 
'/home/encompass/Desktop/prototype/applications/semaprinter/cron/crontab
---
Best Regards,
Jason Brower


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:32469] Shorten strings...

2009-10-08 Thread Jason (spot) Brower

I have some long strings.  How do I shorten them with the "..." feature?
So when I talk on and on it will... :P
Regards,
Jason Brower

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:32468] Re: html pages without function associated

2009-10-08 Thread Jason (spot) Brower

I don't think so.  But I doubt that 2 lines a page is that big of a
deal.  It comes in especially handy when you need to call the page.


On Thu, Oct 8, 2009 at 3:17 PM, sebastian  wrote:
>
> Hi All,
>
> I have a lot of pages that do not need any controller activity.
> Therefore I have a lot of
>
> def my_function():
>    return dict()
>
> and then a my_function.html with my html.
>
> Is there any way to create html pages without creating any associated
> function ?
>
> thanks ?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:32447] Re: lots of stuff in trunk.

2009-10-07 Thread Jason (spot) Brower

Exciting.  Thanks.

On Thu, Oct 8, 2009 at 6:10 AM, mdipierro  wrote:
>
> There is lots of new stuff in trunk, in particular in sql.py.
>
> Chris Clark added Ingres support and Denes added support for legacy
> databases.
>
> While we test the new stuff please check that nothing breaks your
> code.
>
> Massimo
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31588] Re: Making a feild unique....

2009-09-23 Thread Jason Brower

Wow, your a scholar and a gentleman.  Thanks.  And I get it now what
your doing.  You can't validate until we have data and that is a the
check for that data.  Very fancy!
Regards,
Jason


On Wed, 2009-09-23 at 12:22 -0700, mr.freeze wrote:
> To clarify, the IS_NOT_IN_DB validator is only applied when
> request.vars.page and request.vars.placement are present so it needs a
> default validator when they are not.  It should look like this:
> 
> db.define_table('page_articles',
> Field('page', requires=IS_IN_DB(db,db.page.id,'%(name)s')),
> Field('article', requires=IS_IN_DB(db,db.article.id,'%(title)s
> - %(author)s')),
> Field('placement', 'integer', requires = IS_IN_SET(range
> (1,21
> 
> 
> 
> On Sep 23, 2:14 pm, "mr.freeze"  wrote:
> > It looks like you took the IS_IN_SET off of page_articles.placement:
> >
> > db.define_table('page_articles',
> > Field('page', requires=IS_IN_DB(db,db.page.id,'%(name)s')),
> > Field('article', requires=IS_IN_DB(db,db.article.id,'%(title)s
> > - %(author)s')),
> > Field('placement', 'integer'))
> >
> > Try adding it back and let me know.
> >
> > On Sep 23, 2:05 pm, Jason Brower  wrote:
> >
> > > I didn't think I did, at least not anything I thought would influence
> > > it.  Here is what you would need.
> > > Best Regards,
> > > Jason Brower
> >
> > > On Wed, 2009-09-23 at 11:29 -0700, mr.freeze wrote:
> > > > It works on the model and controller code you posted.  Is it different
> > > > than what you're using?
> >
> > > > On Sep 23, 1:19 pm, Jason Brower  wrote:
> > > > > I get the following error with this code...
> > > > > "SyntaxError: widget cannot determine options of
> > > > > page_articles.placement" - Line 64 of Default.py
> > > > > ---LINE 64 IS LABELED---
> > > > > def page_creator():
> > > > > response.title = "Page Creator"
> > > > > if len(request.args):
> > > > > pages = db(db.page_articles.id==request.args[0]).select()
> > > > > if len(request.args) and len(pages):
> > > > > page_form = SQLFORM(db.page_articles, pages[0], 
> > > > > deletable=True)
> > > > > else:
> > > > > page_form = SQLFORM(db.page_articles)#<--- This is line 64
> > > > > if page_form.accepts(request.vars, session):
> > > > > response.flash = 'Action Commited Succesfully'
> > > > > elif page_form.errors:
> > > > > response.flash = 'Hmmm, something went wrong.'
> > > > > all_pages = db((db.page.id==db.page_articles.page) &
> > > > > (db.article.id==db.page_articles.article))
> > > > > return dict(page_form=page_form, all_pages=all_pages)
> > > > > 
> > > > > And what you gave me...> if request.vars.page and 
> > > > > request.vars.placement:
> > > > > > existing = 
> > > > > > db((db.page_articles.page==request.vars.page)&(db.page_articles.placement==request.vars.placement))
> > > > > > db.page_articles.placement.requires = [IS_IN_SET(range(1,21)), 
> > > > > > IS_NOT_IN_DB(existing, 'page_articles.placement')]
> >
> > > > > Thanks for the help,
> > > > > Jason
> >
> > > > > On Wed, 2009-09-23 at 08:37 -0700, mr.freeze wrote:
> > > > > > Here you go.  You will need to force it to render with
> > > > > > SQLFORM.widgets.options.widget because IS_IN_SET won't render as a
> > > > > > dropdown when used with other validators. In your model:
> >
> > > > > > db.page_articles.placement.widget = SQLFORM.widgets.options.widget
> >
> > > > > > if request.vars.page and request.vars.placement:
> > > > > > existing = db((db.page_articles.page==request.vars.page)&
> >
> > > > > > (db.page_articles.placement==request.vars.placement))
> > > > > > db.page_articles.placement.requires = [IS_IN_SET(range
> > > > > > (1,21)),IS_NOT_IN_DB(existing, 'page_articles.placement')]
> >
> > > > > > On Sep 22, 9:55 pm, Jason Brower  wrot

[web2py:31548] Re: Making a feild unique....

2009-09-23 Thread Jason Brower
I didn't think I did, at least not anything I thought would influence
it.  Here is what you would need.
Best Regards,
Jason Brower

On Wed, 2009-09-23 at 11:29 -0700, mr.freeze wrote:
> It works on the model and controller code you posted.  Is it different
> than what you're using?
> 
> On Sep 23, 1:19 pm, Jason Brower  wrote:
> > I get the following error with this code...
> > "SyntaxError: widget cannot determine options of
> > page_articles.placement" - Line 64 of Default.py
> > ---LINE 64 IS LABELED---
> > def page_creator():
> > response.title = "Page Creator"
> > if len(request.args):
> > pages = db(db.page_articles.id==request.args[0]).select()
> > if len(request.args) and len(pages):
> > page_form = SQLFORM(db.page_articles, pages[0], deletable=True)
> > else:
> > page_form = SQLFORM(db.page_articles)#<--- This is line 64
> > if page_form.accepts(request.vars, session):
> > response.flash = 'Action Commited Succesfully'
> > elif page_form.errors:
> > response.flash = 'Hmmm, something went wrong.'
> > all_pages = db((db.page.id==db.page_articles.page) &
> > (db.article.id==db.page_articles.article))
> > return dict(page_form=page_form, all_pages=all_pages)
> > 
> > And what you gave me...> if request.vars.page and request.vars.placement:
> > > existing = 
> > > db((db.page_articles.page==request.vars.page)&(db.page_articles.placement==request.vars.placement))
> > > db.page_articles.placement.requires = [IS_IN_SET(range(1,21)), 
> > > IS_NOT_IN_DB(existing, 'page_articles.placement')]
> >
> > Thanks for the help,
> > Jason
> >
> > On Wed, 2009-09-23 at 08:37 -0700, mr.freeze wrote:
> > > Here you go.  You will need to force it to render with
> > > SQLFORM.widgets.options.widget because IS_IN_SET won't render as a
> > > dropdown when used with other validators. In your model:
> >
> > > db.page_articles.placement.widget = SQLFORM.widgets.options.widget
> >
> > > if request.vars.page and request.vars.placement:
> > > existing = db((db.page_articles.page==request.vars.page)&
> >
> > > (db.page_articles.placement==request.vars.placement))
> > > db.page_articles.placement.requires = [IS_IN_SET(range
> > > (1,21)),IS_NOT_IN_DB(existing, 'page_articles.placement')]
> >
> > > On Sep 22, 9:55 pm, Jason Brower  wrote:
> > > > Woah... way beyond me here.
> > > > My tables are like this...
> > > > ---
> > > > db.define_table('page',
> > > > Field('name', 'string', length=25),
> > > > Field('description', 'text'),
> > > > Field('created', 'datetime', default=now, readable=True,
> > > > writable=False))
> >
> > > > db.define_table('article',
> > > > Field('title', 'string', length=25),
> > > > Field('text', 'text'),
> > > > Field('media', 'upload', autodelete= True),
> > > > Field('created', 'datetime', default=now, readable=True,
> > > > writable=False),
> > > > Field('types', requires=IS_IN_SET(['One', 'Two', 'Three'])),
> > > > Field('columns', requires=IS_IN_SET(['One', 'Two', 'Three'])),
> > > > Field('author',
> > > > requires=IS_IN_DB(db,db.author.id,'%(full_name)s')))
> >
> > > > db.define_table('page_articles',
> > > > Field('page', requires=IS_IN_DB(db,db.page.id,'%(name)s')),
> > > > Field('article',
> > > > requires=IS_IN_DB(db,db.article.id,'%(title)s')),
> > > > Field('placement', requires=IS_IN_SET(range(1,21)))
> > > > ---
> > > > By how do I declare the request.var.page and request.var.placement in
> > > > the model.  Should it be the the controller?
> > > > If so here is that page just in case
> > > > ---
> > > > def page_creator():
> > > > if len(request.args):
> > > > pages = db(db.page_articles.id==request.args[0]).select()
> > > > if len(request.args) and len(pages):
>

[web2py:31544] Re: Making a feild unique....

2009-09-23 Thread Jason Brower

I get the following error with this code...
"SyntaxError: widget cannot determine options of
page_articles.placement" - Line 64 of Default.py
---LINE 64 IS LABELED---
def page_creator():
response.title = "Page Creator"
if len(request.args):
pages = db(db.page_articles.id==request.args[0]).select()
if len(request.args) and len(pages):
page_form = SQLFORM(db.page_articles, pages[0], deletable=True)
else:
page_form = SQLFORM(db.page_articles)#<--- This is line 64
if page_form.accepts(request.vars, session):
response.flash = 'Action Commited Succesfully'
elif page_form.errors:
response.flash = 'Hmmm, something went wrong.'
all_pages = db((db.page.id==db.page_articles.page) &
(db.article.id==db.page_articles.article))
return dict(page_form=page_form, all_pages=all_pages)

And what you gave me...
> if request.vars.page and request.vars.placement:
> existing = 
> db((db.page_articles.page==request.vars.page)&(db.page_articles.placement==request.vars.placement))
> db.page_articles.placement.requires = [IS_IN_SET(range(1,21)), 
> IS_NOT_IN_DB(existing, 'page_articles.placement')]
Thanks for the help,
Jason

On Wed, 2009-09-23 at 08:37 -0700, mr.freeze wrote:
> Here you go.  You will need to force it to render with
> SQLFORM.widgets.options.widget because IS_IN_SET won't render as a
> dropdown when used with other validators. In your model:
> 
> db.page_articles.placement.widget = SQLFORM.widgets.options.widget
> 
> if request.vars.page and request.vars.placement:
> existing = db((db.page_articles.page==request.vars.page)&
>  
> (db.page_articles.placement==request.vars.placement))
> db.page_articles.placement.requires = [IS_IN_SET(range
> (1,21)),IS_NOT_IN_DB(existing, 'page_articles.placement')]
> 
> 
> 
> On Sep 22, 9:55 pm, Jason Brower  wrote:
> > Woah... way beyond me here.
> > My tables are like this...
> > ---
> > db.define_table('page',
> > Field('name', 'string', length=25),
> > Field('description', 'text'),
> > Field('created', 'datetime', default=now, readable=True,
> > writable=False))
> >
> > db.define_table('article',
> > Field('title', 'string', length=25),
> > Field('text', 'text'),
> > Field('media', 'upload', autodelete= True),
> > Field('created', 'datetime', default=now, readable=True,
> > writable=False),
> > Field('types', requires=IS_IN_SET(['One', 'Two', 'Three'])),
> > Field('columns', requires=IS_IN_SET(['One', 'Two', 'Three'])),
> > Field('author',
> > requires=IS_IN_DB(db,db.author.id,'%(full_name)s')))
> >
> > db.define_table('page_articles',
> > Field('page', requires=IS_IN_DB(db,db.page.id,'%(name)s')),
> > Field('article',
> > requires=IS_IN_DB(db,db.article.id,'%(title)s')),
> > Field('placement', requires=IS_IN_SET(range(1,21)))
> > ---
> > By how do I declare the request.var.page and request.var.placement in
> > the model.  Should it be the the controller?
> > If so here is that page just in case
> > ---
> > def page_creator():
> > if len(request.args):
> >     pages = db(db.page_articles.id==request.args[0]).select()
> > if len(request.args) and len(pages):
> > page_form = SQLFORM(db.page_articles, pages[0], deletable=True)
> > else:
> > page_form = SQLFORM(db.page_articles)
> > if page_form.accepts(request.vars, session):
> > response.flash = 'Action Commited Succesfully'
> > elif page_form.errors:
> > response.flash = 'Hmmm, something went wrong.'
> > all_pages = db((db.page.id==db.page_articles.page) &
> > (db.article.id==db.page_articles.article))
> > return dict(page_form=page_form, all_pages=all_pages)
> > ---
> > Thanks in advance guys,
> > Jason
> >
> > On Tue, 2009-09-22 at 12:55 -0700, mr.freeze wrote:
> > > If you can describe your constraint with as a DAL set, you can pass it
> > > to IS_NOT_IN_DB. Maybe something like this?
> >
> > > existing = db((db.page.number==request.vars.page)&
> > > (db.placement.code==request.vars.placement))
> > > db.article.number.requires = IS_NOT_IN_DB

[web2py:31542] Re: Uploads not showing in edit form...

2009-09-23 Thread Jason Brower

Thanks, that did it.


On Wed, 2009-09-23 at 06:00 -0700, mdipierro wrote:
> form = SQLFORM(...,upload=URL(r=request,f='download'))


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31503] Re: Making a feild unique....

2009-09-22 Thread Jason Brower

Woah... way beyond me here.
My tables are like this...
---
db.define_table('page',
Field('name', 'string', length=25),
Field('description', 'text'),
Field('created', 'datetime', default=now, readable=True,
writable=False))

db.define_table('article',
Field('title', 'string', length=25),
Field('text', 'text'),
Field('media', 'upload', autodelete= True),
Field('created', 'datetime', default=now, readable=True,
writable=False),
Field('types', requires=IS_IN_SET(['One', 'Two', 'Three'])),
Field('columns', requires=IS_IN_SET(['One', 'Two', 'Three'])),
Field('author',
requires=IS_IN_DB(db,db.author.id,'%(full_name)s')))

db.define_table('page_articles',
Field('page', requires=IS_IN_DB(db,db.page.id,'%(name)s')),
Field('article',
requires=IS_IN_DB(db,db.article.id,'%(title)s')),
Field('placement', requires=IS_IN_SET(range(1,21)))
---
By how do I declare the request.var.page and request.var.placement in
the model.  Should it be the the controller?
If so here is that page just in case
---
def page_creator():
if len(request.args):
pages = db(db.page_articles.id==request.args[0]).select()
if len(request.args) and len(pages):
page_form = SQLFORM(db.page_articles, pages[0], deletable=True)
else:
page_form = SQLFORM(db.page_articles)
if page_form.accepts(request.vars, session):
    response.flash = 'Action Commited Succesfully'
elif page_form.errors:
response.flash = 'Hmmm, something went wrong.'
all_pages = db((db.page.id==db.page_articles.page) &
(db.article.id==db.page_articles.article))
return dict(page_form=page_form, all_pages=all_pages)
---
Thanks in advance guys,
Jason

On Tue, 2009-09-22 at 12:55 -0700, mr.freeze wrote:
> If you can describe your constraint with as a DAL set, you can pass it
> to IS_NOT_IN_DB. Maybe something like this?
> 
> existing = db((db.page.number==request.vars.page)&
> (db.placement.code==request.vars.placement))
> db.article.number.requires = IS_NOT_IN_DB(existing,'article.number')
> 
> On Sep 22, 12:59 pm, Jason Brower  wrote:
> > I have three major fields in a table:
> > Page, Article and Placement
> > I want to make sure that the placement is unique to that article
> > so...
> > Page1, Article1, 1
> > Page2, Article2, 1
> > Page1, Article3, 2
> > But it will not alow placement of...
> > Page1, Article4, 1
> > or...
> > Page1, Article1, 3
> >
> > I hope that makes sence.
> > Regards,
> > Jason Brower
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31479] Making a feild unique....

2009-09-22 Thread Jason Brower

I have three major fields in a table:
Page, Article and Placement
I want to make sure that the placement is unique to that article
so...
Page1, Article1, 1
Page2, Article2, 1
Page1, Article3, 2
But it will not alow placement of...
Page1, Article4, 1
or...
Page1, Article1, 3

I hope that makes sence.
Regards,
Jason Brower




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31477] Uploads not showing in edit form...

2009-09-22 Thread Jason Brower

According to page 193 of the manual I should be able to edit a previous
set of data in the database.  It all works except that it doesn't show
the information about the image or other uplaod.  Simply blank.  Is
there any way to fix this?
Regards,
Jason



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31317] Re: for row in rows

2009-09-19 Thread Jason Brower

It should work. What did it output instead?
Regards,
Jason


On Sat, 2009-09-19 at 01:35 -0700, annet wrote:
> Unfortunately it did not work. Every 'not so detailed item' gets its
> own table instead of a table row.
> 
> The latest function reads like:
> 
> def latest():
> response.functionname='Laatste nieuws'
> response.image=URL(r=request,c='static',f='init/media/
> utilities_1.jpg')
> latest=db((db.nieuws.bedrijf==117)&
> (db.nieuws.publicatie_datum<=request.now)&\
> (db.nieuws.publicatie_datum>=minus_three_months(request.now)))
> .select(db.nieuws.ALL,orderby=~db.nieuws.publicatie_datum)
> return dict(latest=latest)
> 
> 
> Isn't it possible to divide latest into two dictionaries, one with the
> first 6 items and the other with the next 18 items.
> 
> def latest():
> response.functionname='Laatste nieuws'
> response.image=URL(r=request,c='static',f='init/media/
> utilities_1.jpg')
> latest6=db((db.nieuws.bedrijf==117)&
> (db.nieuws.publicatie_datum<=request.now)&\
> (db.nieuws.publicatie_datum>=minus_three_months(request.now)))
> .select(db.nieuws.ALL,orderby=~db.nieuws.publicatie_datum,limitby=
> (0,5))
> latest18=db((db.nieuws.bedrijf==117)&
> (db.nieuws.publicatie_datum<=request.now)&\
> (db.nieuws.publicatie_datum>=minus_three_months(request.now)))
> .select(db.nieuws.ALL,orderby=~db.nieuws.publicatie_datum,limitby=
> (6,23))
> return dict(latest6=latest6,latest18=latest18)
> 
> 
> Kind regards,
> 
> Annet.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31316] Re: for row in rows

2009-09-19 Thread Jason Brower

Your right, I just can't help it!
:P


On Sat, 2009-09-19 at 01:32 -0700, Iceberg wrote:
> The first 3 lines of your code snippet can be changed into:
> 
>   {{for count, item in enumerate(news):}}
> 
> That is more pythonic.  Using counter variable is the bad taste from C
> era.
> 
> On Sep19, 3:32pm, Jason Brower  wrote:
> > Hmm...
> > Is this what you where thinking?
> >
> > On Sat, 2009-09-19 at 00:27 -0700, annet wrote:
> > > I have a table which contains news items. In the view I would like to
> > > display the first 6 items in full and limit the display of the next 18
> > > items to their title. So something like:
> >
> > {{count = 0}}
> > > {{for item in news:}}
> >
> > {{count += 1}}
> > {{if count <= 6:}}<datailed stuff> 
> > >   {{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}}
> > > 
> > >   {{=item.titel}}
> > >   {{if item.ondertitel:}}{{=item.ondertitel}}{{pass}}
> > >   {{=XML(item.korte_inhoud)}} 
> > >   {{=A('Lees meer',_onmouseover="this.style.cursor='pointer;",\
> > >  _onclick="javascript:newsdetails('%s')"%URL
> > > (r=request,f='newsdetails',args=[item.id]))}}
> > > 
> >
> > {{else:}}<- not so detailed stuff
> > 
> >
> >
> >
> > >   {{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}}
> > > 
> > >   {{=item.titel}}
> > >   {{if item.ondertitel:}}{{=item.ondertitel}}{{pass}}
> > >   {{=XML(item.korte_inhoud)}} 
> > >   {{=A('Lees meer',_onmouseover="this.style.cursor='pointer;",\
> > >  _onclick="javascript:newsdetails('%s')"%URL
> > > (r=request,f='newsdetails',args=[item.id]))}}
> > {{pass}}
> > >  
> > > {{pass}}
> >
> > > 
> > >   
> > > {{for item in news:}}
> > >   
> > > 
> > >   {{=item.titel}}
> > > 
> > >   
> > > {{pass}}
> > >   
> > > 
> >
> > > I hope one of you could provide me with the correct for loop to make
> > > this work.
> >
> > > Kind regards,
> >
> > > Annet.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31303] Re: for row in rows

2009-09-19 Thread Jason Brower

Hmm...
Is this what you where thinking?


On Sat, 2009-09-19 at 00:27 -0700, annet wrote:
> I have a table which contains news items. In the view I would like to
> display the first 6 items in full and limit the display of the next 18
> items to their title. So something like:
> 
{{count = 0}}
> {{for item in news:}}
{{count += 1}}
{{if count <= 6:}} 
>   {{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}}
> 
>   {{=item.titel}}
>   {{if item.ondertitel:}}{{=item.ondertitel}}{{pass}}
>   {{=XML(item.korte_inhoud)}} 
>   {{=A('Lees meer',_onmouseover="this.style.cursor='pointer;",\
>  _onclick="javascript:newsdetails('%s')"%URL
> (r=request,f='newsdetails',args=[item.id]))}}
> 
{{else:}}<- not so detailed stuff

>   {{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}}
> 
>   {{=item.titel}}
>   {{if item.ondertitel:}}{{=item.ondertitel}}{{pass}}
>   {{=XML(item.korte_inhoud)}} 
>   {{=A('Lees meer',_onmouseover="this.style.cursor='pointer;",\
>  _onclick="javascript:newsdetails('%s')"%URL
> (r=request,f='newsdetails',args=[item.id]))}}
{{pass}}
>  
> {{pass}}
> 
> 
>   
> {{for item in news:}}
>   
> 
>   {{=item.titel}}
> 
>   
> {{pass}}
>   
> 
> 
> 
> I hope one of you could provide me with the correct for loop to make
> this work.
> 
> 
> Kind regards,
> 
> Annet.
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31301] Interesting issue: need to call a method from a value in a table.

2009-09-19 Thread Jason Brower

I think I have reached the limit of my python knowledge and need help.
I have a table that holds "solutions" and the "issues" they solve.
To find out what solutions is viable in difference cases I need to do a
complicated set of checks.  I have placed these checks in a set of
methods.
Is there a way to reference these methods in the database?
I was thinking something like this...
We get the name from the table.
method = "foobar"
then I have a method called foobar

def foobar():
return True

How would I do that?
Currently I have to make a translation system... if method = "foobar":
foobar()
But I am sure there is a better way.
Regards,
Jason



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31249] Many 2 Many but want to see a feild other than id....

2009-09-17 Thread Jason Brower

I have my relations working properly and am able to work with them, but
I can't seem to easily make a form with .name instead of .id.  What is
the best way to do that?
So when I have an input form for by 3 table that rlates the two others I
get the ID.  I know I want them, but how do I get it so it SHOWS the
table.name rather than the table.id?
Regards,
Jason Brower



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31219] Re: Can't get the form to validate...

2009-09-17 Thread Jason Brower

It's ok, I think I got it.
Sorry about that.
Jason

On Thu, 2009-09-17 at 12:02 -0500, Yarko Tymciurak wrote:
> "...problem with many-to-many in form..."  by itself doesn't tell what
> problem you think you are having...  a more detailed description of
> what you want & how you're trying to accomplish it may help...
> 
> On 9/17/09, Thadeus Burgess  wrote:
> > Yes I am having a problem with the many-to-many relationship in a form as
> > well.
> >
> > I would love to know how to solve this.!
> >
> > -Thadeus
> >
> >
> >
> >
> > On Thu, Sep 17, 2009 at 7:17 AM, encompass  wrote:
> >
> >> CT kind of works.  It give the drop downlist.  But there
> >> is no content in it.  How do I populate it with the solution.name but
> >> it uses the ID in the database?
> >>
> >
> > >
> >
> 
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30795] Are images automatically deleted?

2009-09-11 Thread Jason Brower

When a table is using an image/file in ones of it's rows.  If you delete
the row, shouldn't the image delete as well, or do I need to delete it.
Regards,
Jason Brower



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30673] Re: Ajax

2009-09-10 Thread Jason Brower

If you looking for that it is in the manual.  And the examples.
I think you can create a page like generic.xml like in a new application
if you deleted one, just make it.
Then you just ask for the page with .xml at the end.
A new application has the framework for what I think your wanting to do.
And if I am not mistaken you have the manual, it talks about that in
great detail too.
Regards,
Jason Brower


On Thu, 2009-09-10 at 12:31 -0700, eddwinston wrote:
> Hi guys,
> 
> The login now works, the session is saved but the value returned from
> the server is still a full page html markup. How can I get either xml
> or json as a return value?
> 
> Thanks
> Winston
> 
> On Sep 10, 10:42 am, eddwinston  wrote:
> > Thanks a lot guys. I will try it when I get hands on my app again.
> >
> > Regards,
> > Winston
> >
> > On Sep 10, 9:28 am, "mr.freeze"  wrote:
> >
> > > Try this. u is the url, i is the form index (set to 0 for a single
> > > form on the page), and t is the target for the response.
> >
> > > function ajaxSubmit(u,i,t){
> > > frm = jQuery("form:eq(" + i + ")");
> > > query = 'undefined=' + i;
> > > if (frm.length==1){query = frm.serialize();}
> > > jQuery.ajax({type: "POST", url: u, data: query, success: function
> > > (msg) { if(t==':eval') eval(msg); else jQuery("#"+t).html(msg); } });
> >
> > > }
> >
> > > On Sep 10, 1:05 am, eddwinston  wrote:
> >
> > > > Hi,
> >
> > > > I am away from my app right now but I guess it would be something like
> > > > this:
> >
> > > >   data: '{ "name_of_ username_field": "username_field_value",
> > > > "name_of_password_field": "password_field_value",
> > > > "_formkey": "form_key_value",
> > > > "_formname": "formname_value" }'
> >
> > > > On Sep 10, 8:45 am, mdipierro  wrote:
> >
> > > > > But this line
> >
> > > > >data: {},
> >
> > > > > is not sending the username and password to the login page. It should
> > > > > also send the formkey and formname.
> >
> > > > > On Sep 10, 12:11 am, eddwinston  wrote:
> >
> > > > > > Hi,
> >
> > > > > > This is what I did:
> >
> > > > > > jQuery.ajax({
> > > > > >type: "POST",
> > > > > >url: "{{=URL(r=request,c='default', f='user', args='login'}}",
> > > > > >data: {},
> > > > > >success: function(response) {
> > > > > >   alert(response); // This line produced a complete page markup 
> > > > > > in
> > > > > > the alert dialog
> > > > > >},
> > > > > >error: failure_callback
> > > > > >  });
> >
> > > > > > On Sep 10, 6:31 am, mdipierro  wrote:
> >
> > > > > > > show us the code
> >
> > > > > > > On Sep 9, 10:21 pm, 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
> > > > > > > > get a full page html markup and the user will not be logged in. 
> > > > > > > > Is
> > > > > > > > there a way I can do it?
> >
> > > > > > > > Regards,
> > > > > > > > Winston
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



<    3   4   5   6   7   8   9   10   11   >