[web2py] Re: Can not send verification email

2010-06-17 Thread Larry
I was also getting this error on my first go at sending mail using
gae.

I looked at the code in gluon/tools.py for sending gae mail :

  elif self.settings.server == 'gae':
from google.appengine.api import mail
attachments = attachments and [(a.my_filename,a.my_payload) for a
in attachments]
result = mail.send_mail(sender=self.settings.sender, to=to,
subject=subject, body=text, html=html,
attachments=attachments)

and retried after removing the attachments=attachments from the
send_mail and it worked if I send both text and html versions of the
message.

I assume gae does not like the attachments value being None.

Larry


On Jun 11, 9:25 pm, mdipierro  wrote:
> if you use server='gae' you should use login=None
> Not sure if this is the problem anyway. Do you get any error?
>
> On 11 Giu, 10:12, pecos1046  wrote:
>
>
>
> > I use the email verification option for new user registration. It
> > works fine in test mode on the google-appengine sdk. However when I
> > upload the application to Google and change the smtp server to "gae"
> > it is unable to send the verification email. The GoogleGAElog show
> > the following warning message:
>
> >Mail.send failure:May not set empty value for 'attachments'
>
> > Here are my settings:
>
> >mail=Mail( )
> >mail.settings.server='gae'    # your SMTP server
> >mail.settings.sender='@gmail.com'
> >mail.settings.tls = True
> >mail.settings.login='@gmail.com:password'
> > auth.settings.mailer=mail
>
> > I appreciate any help and suggestions.
>
> > Peter


[web2py] Re: Can not send verification email

2010-06-19 Thread Larry
Peter,

This code looks good to me. I will adopt the same for now.

Larry

On Jun 19, 12:37 am, pecos1046  wrote:
> Hi Larry:
>
> Looking at your suggestion, I made a code change in tools.py and mail
> with gae works well. Here my patch - so far so good, I wonder when it
> will backfire.
>
>           elif self.settings.server == 'gae':
>                 from google.appengine.api import mail
>                 attachments = attachments and
> [(a.my_filename,a.my_payload) for a in attachments]
>
>                 if attachments and html:
>                     result =
> mail.send_mail(sender=self.settings.sender, to=to,
>                                         subject=subject, body=text,
> html=html,
>                                         attachments=attachments)
>
>                 elif html:
>                     result =
> mail.send_mail(sender=self.settings.sender, to=to,
>                                         subject=subject, body=text,
> html=html)
>
>                 elif attachments:
>                     result =
> mail.send_mail(sender=self.settings.sender, to=to,
>                                         subject=subject, body=text,
> attachments=attachments)
>
>                 else:
>                     result =
> mail.send_mail(sender=self.settings.sender, to=to,
>                                         subject=subject, body=text)
>
> Thanks again
>
> Peter
>
> On Jun 17, 5:16 am, Larry  wrote:
>
>
>
> > I was also getting thiserroron my first go at sending mail using
> > gae.
>
> > I looked at the code in gluon/tools.py for sending gae mail :
>
> >   elif self.settings.server == 'gae':
> >     from google.appengine.api import mail
> >     attachments = attachments and [(a.my_filename,a.my_payload) for a
> > in attachments]
> >     result = mail.send_mail(sender=self.settings.sender, to=to,
> >                             subject=subject, body=text, html=html,
> >                             attachments=attachments)
>
> > and retried after removing the attachments=attachments from the
> > send_mail and it worked if I send both text and html versions of the
> > message.
>
> > I assume gae does not like the attachments value being None.
>
> > Larry
>
> > On Jun 11, 9:25 pm, mdipierro  wrote:
>
> > > if you use server='gae' you should use login=None
> > > Not sure if this is the problem anyway. Do you get anyerror?
>
> > > On 11 Giu, 10:12, pecos1046  wrote:
>
> > > > I use theemailverification option for new user registration. It
> > > > works fine in test mode on the google-appengine sdk. However when I
> > > > upload the application to Google and change the smtp server to "gae"
> > > > it is unable to send the verificationemail. The GoogleGAElog show
> > > > the following warning message:
>
> > > >Mail.send failure:May not set empty value for 'attachments'
>
> > > > Here are my settings:
>
> > > >mail=Mail( )
> > > >mail.settings.server='gae'    # your SMTP server
> > > >mail.settings.sender='@gmail.com'
> > > >mail.settings.tls = True
> > > >mail.settings.login='@gmail.com:password'
> > > > auth.settings.mailer=mail
>
> > > > I appreciate any help and suggestions.
>
> > > > Peter


[web2py] cannot run web2py on windows 7 machine with python 2.7 installed

2011-08-30 Thread larry
Dear All, i am new to web2py and this forum, so please pardon me if
this subject has already been addressed. Here's the problem:

i have python 2.7 installed on windows 7.
i have downloaded web2py for windows from this site:
http://web2py.com/examples/default/download.
According to the site: "The source code version (of web2py) works on
all supported platforms, including Linux, but it requires Python 2.4,
2.5, 2.6, or 2.7. It runs on Windows and most Unix systems..."
After downloading the file, ii am then instructed to "...unzip it and
click on web2py.exe (windows)..."
After clicking on web2py.exe, i get the following message on the
command line:
"web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.98.2 (2011-08-04 00:47:09)
Database drivers available: SQLite3. pymysql
Starting hardcron..."

Another window pops up with the following information:
Server IP: 127.0.0.1
Server Port: 8000
Choose Password:

When i enter a password and either press enter or click the "start
server" button, i get the following command line error message:
ERROR: Rocket.Errors. Port8000: Socket 127.0.0.1:8000 in use by other
process and it won't share.
Please visit: http://127.0.0.1:8000
starting browser...
WARNING: Rocket.Errors.Port8000: Listener started when not ready.

Can anyone help a newbie? Otherwise it seems my adventure with web2py
ended before it even started!


[web2py] existing tables in plugin_wiki

2012-08-01 Thread Larry Wapnitsky
I'm attempting to access database tables created in my db.py file using 
different aspects of plugin_wiki.  Whenever I enter the table name, I get 
the following as my results on my "page":

Traceback (most recent call last):
  File 
"/home/lwapnitsky/web2py/applications/EARS_web2py/models/plugin_wiki.py", line 
631, in render_widget
args = dict((item[0].strip(), self.parse_value(item[1].strip())) for item 
in items)
  File 
"/home/lwapnitsky/web2py/applications/EARS_web2py/models/plugin_wiki.py", line 
631, in 
args = dict((item[0].strip(), self.parse_value(item[1].strip())) for item 
in items)
IndexError: list index out of range


Here is the code on the wiki page that was generated by the builder:
``
name: read
table: message
record_id: id
``:widget

Thanks

-- 





[web2py] LEFT JOIN query issues

2012-08-02 Thread Larry Wapnitsky
I'm trying to take the following MySQL query

SELECT recipient.emailAddress
FROM recipient
LEFT JOIN mr_link ON recipient.id = mr_link.recipID



and turn it into a DAL query, but I keep running into 'keyword' issues

My code is as such:

rows = db().select(db.recipient.emailAddress, db.mr_link.ALL, left=db.
mr_link.on(db.mr_link.recipID=db.recipient.id))

but I keep receiving

 keyword can't be an expression (default.py, 
line 25)

Assistance in solving this would be very helpful

Thanks


-- 





[web2py] empty jqgrid

2012-08-06 Thread Larry Wapnitsky
Pardon me if I asked this before, but I can't seem to find my prior Q&A:

I'm attempting to use jqgrid via the plugin_wiki widget, yet all my tables 
keep coming up as empty.

This is what I'm putting my my html file:

{{=plugin_wiki.widget('jqgrid',table='recipient')}}



And this is the table definition:

db.define_table('recipient',
Field('id', 'id'),
Field('emailAddress', 'text', label='Recipient'),
migrate=False)



Thanks in advance

-- 





[web2py] variables to determine table columns from database

2012-08-07 Thread Larry Wapnitsky
from a web page, i'm able to successfully query my database using the 
following:

rows = db(db[request.args(0)].id == request.args(1)).select(


What I'm having trouble with is passing another argument that specifies 
another column other than id.  I've tried the following with no success:

rows = db(db[request.args(0)].[request.args(2)] == request.args(1)).select
(


rows = db(db[request.args(0)].request.args(2) == request.args(1)).select
(

-- 





[web2py] Re: variables to determine table columns from database

2012-08-07 Thread Larry Wapnitsky
damned periods! :)  Thanks, Anthony

On Tuesday, August 7, 2012 2:49:53 PM UTC-4, Anthony wrote:
>
> rows = db(db[request.args(0)][request.args(2)] == request.args(1)).select
> (
>
> Anthony
>
> On Tuesday, August 7, 2012 2:15:09 PM UTC-4, Larry Wapnitsky wrote:
>>
>> from a web page, i'm able to successfully query my database using the 
>> following:
>>
>> rows = db(db[request.args(0)].id == request.args(1)).select(
>>
>>
>> What I'm having trouble with is passing another argument that specifies 
>> another column other than id.  I've tried the following with no success:
>>
>> rows = db(db[request.args(0)].[request.args(2)] == request.args(1)).
>> select(
>>
>>
>> rows = db(db[request.args(0)].request.args(2) == request.args(1)).select
>> (
>>
>>

-- 





[web2py] Back-and-forth between DAL & SQLAlchemy

2012-08-15 Thread Larry Wapnitsky
I have a project in which I've just written the database functions using 
SQLAlchemy.  It was much simpler than my original, hand-written SQL 
queries, especially once I got the hang of creating "relationships" with 
SA's ORM.

Now, I would like to create a front-end for this using web2py, but, from 
experience, I know the DAL and SA's ORM are very different.  

What's the group's view on the best way to integrate my two projects?

-- 





[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Larry Wapnitsky
I'm currently storing the files as BLOBs in MySQL along with a field for 
the filename.  That has been working for me.

On Friday, August 17, 2012 8:35:38 AM UTC-4, Cliff Kachinske wrote:
>
> How can I email uploaded files with the original file name?
>
> I realize it is possible to make a copy of the file with the original name 
> and attach that, but that seems like a waste of resources.
>
> Is there a better way?
>
> thanks,
> Cliff Kachinske
>

-- 





Re: [web2py] Re: Back-and-forth between DAL & SQLAlchemy

2012-08-17 Thread Larry Wapnitsky
OK.  I"m getting close, but I"m stuck on the following SQLAlchemy code 
conversion:

recipients = relationship( 'Recipient',
  secondary = mr_link,
  backref = 'message',
  lazy = 'dynamic' )


attachments = relationship( 'Attachment',
   secondary = ma_link,
   backref = 'message',
   lazy = 'dynamic' )


I don't see how to adapt this in the manual.

TIA,
Larry

On Friday, August 17, 2012 8:24:41 AM UTC-4, Larry Wapnitsky wrote:
>
>  Thanks, Massimo.  I'll give this a read and see if I can adapt it 
> properly.
>
> As usual, your hard work is greatly appreciated.
>
> On 8/15/2012 6:34 PM, Massimo Di Pierro wrote:
>  
> I meant this:
>
>  http://web2py.com/AlterEgo/default/show/189 
>
>
> On Wednesday, 15 August 2012 14:22:36 UTC-5, Larry Wapnitsky wrote: 
>>
>> I have a project in which I've just written the database functions using 
>> SQLAlchemy.  It was much simpler than my original, hand-written SQL 
>> queries, especially once I got the hang of creating "relationships" with 
>> SA's ORM. 
>>
>>  Now, I would like to create a front-end for this using web2py, but, 
>> from experience, I know the DAL and SA's ORM are very different.  
>>
>>  What's the group's view on the best way to integrate my two projects?
>>
>  -- 
>  
>  
>  
>
>
>  

-- 





[web2py] Admin access on hostmonster account

2012-08-30 Thread Larry Wapnitsky
I'm receiving the following message when logging in to the admin interface 
of web2py on my hostmonster account:

Login requires a secure (HTTPS) connection or running on localhost.

I've followed the instructions here:  
http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi

It appears that this:

if request.env.http_x_forwarded_for \
or request.env.wsgi_url_scheme in ['https', 'HTTPS'] \
or request.env.https == 'on':
session.secure()
elif not remote_addr in hosts:
raise HTTP(200, T('Admin is disabled because insecure channel'))



has been changed to this:

if request.env.http_x_forwarded_for or request.is_https:
session.secure()
elif not request.is_local and not DEMO_MODE:
raise HTTP(200, T('Admin is disabled because insecure channel'))


but commenting it out still does not help.

-- 





[web2py] Not a question, but thanks

2012-04-17 Thread Larry Wapnitsky
Just wanted to say thanks to everyone who answered my questions over the 
past 2-3 months or so in regards to developing my IP management 
application.  FYI - it's working great, and I couldn't have done it without 
all of you (particularly Massimo for creating this great framework).

-Larry


[web2py] quick SQL question

2012-05-01 Thread Larry Wapnitsky
In a test (non-web2py) program, I'm using a MySQL query that invokes SELECT 
SUBSTRING_INDEX.  What is the easiest way to convert this to the proper 
usage within web2py's DAL specifications?

Thanks,
Larry


[web2py] Re: quick SQL question

2012-05-01 Thread Larry Wapnitsky
Let me clarify that the substring in particular I'm using is the first 3 
octets of an IP address..

On Tuesday, May 1, 2012 3:19:27 PM UTC-4, Larry Wapnitsky wrote:
>
> In a test (non-web2py) program, I'm using a MySQL query that 
> invokes SELECT SUBSTRING_INDEX.  What is the easiest way to convert this to 
> the proper usage within web2py's DAL specifications?
>
> Thanks,
> Larry
>


[web2py] Re: quick SQL question

2012-05-02 Thread Larry Wapnitsky
Here's the actual query:

http://pastie.textmate.org/3848916

SELECT SUBSTRING_INDEX( ipaddress, '.', 3 ) AS first_three_octet, count( * ) AS 
ipCount, updated
FROM ips
GROUP BY SUBSTRING_INDEX( ipaddress, '.', 3 )
HAVING ipCount = 254 
ORDER BY ipCount DESC 


On Tuesday, May 1, 2012 3:19:27 PM UTC-4, Larry Wapnitsky wrote:
>
> In a test (non-web2py) program, I'm using a MySQL query that 
> invokes SELECT SUBSTRING_INDEX.  What is the easiest way to convert this to 
> the proper usage within web2py's DAL specifications?
>
> Thanks,
> Larry
>


[web2py] Re: matplotlib + web2py question

2012-05-02 Thread Larry Wapnitsky
Can this be done without storing the image if it's only needed the one time?

On Wednesday, April 4, 2012 4:45:50 PM UTC-4, dancer` wrote:
>
> Thank you very much. 
>
> One more thing - if I understand correctly this allows me to keep my data 
> buffer clean and not worry about overwriting plots. Is it possible to use a 
> date/time unique naming format to automatically name the image files and 
> store them, say, in the static folder? Or somewhere else, if there's an 
> issue?
>
> Thanks again.
>
> On Wednesday, April 4, 2012 4:39:59 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Makes perfect sense.
>>
>> When you use matplotlib you can do:
>>
>> You can store the image in temp file:
>>
>> import tempfile
>> f  = tempfile.NamedTemporaryFile() 
>> canvas = FigureCanvas(figure)
>> canvas.print_png(f)
>> filename = f.name
>> f.close()
>>
>> then move it to the db in a field called for example file of type upload
>>
>> db.table.insert(file = db.table.file.store(filename=filename)
>>
>> then read the file, delete, and return the image
>>
>> data = open(filename,'rb').read()
>> os.unlink(filename)
>> return data
>> 
>>
>> On Wednesday, 4 April 2012 13:50:12 UTC-5, dancer` wrote:
>>>
>>> Hello,
>>>
>>> I'm on the newer end of programming, and web2py has been my first (and 
>>> very happy) foray into web application development. I am developing an 
>>> application to remotely control two spectrum analyzers (HP 3562A) in our 
>>> lab to do swept sine and power spectra plots. The connection is made using 
>>> sockets, and the data is dumped, modified, and plotted using numpy, scipy 
>>> and matplotlib. The examples I have found that do this do not mention how 
>>> to store the resulting plots on disk but rather plot in real time when 
>>> required. What I would like is to have a results table with all the run 
>>> parameters (for both sweeps and PSD) and have a thumbnail image (I know how 
>>> to generate a thumbnail if I have a parent file) that links to the original 
>>> plotted image. Is this possible, or am I approaching this the wrong way?
>>>
>>> Thank you.
>>>
>>

[web2py] Re: SOLVED Re: Inline image generation with matplotlib

2012-05-02 Thread Larry Wapnitsky
I'm having difficulty with this.  Here is my code:

def barPlot(data):
from matplotlib.backends.backend_agg import FigureCanvasAgg as 
FigureCanvas
from matplotlib.figure import Figure
import cStringIO

stream = cStringIO.StringIO()

cx = data.keys()
cy = data.values()

print cy

fig = Figure()
canvas = FigureCanvas(fig)

ax = fig.add_subplot(1,1,1)

ax.plot(cx, cy)
ax.set_title('hi mom')
ax.grid(True)
ax.set_xlabel('time')
ax.set_ylabel('volts')

canvas.print_png(stream)

return stream.getvalue()


cx is a list of dates, cy is a list of numbers

the function is being called using:

barChart = barPlot(barData)

return dict(fr=fullrange, bc=IMG(_src=URL('barChart'+'.png')))

and my view page code is as follows:


{{extend 'layout.html'}}


{{=bc}}


I'm constantly winding up with no image, but it's pointing to barchart.png, 
which does not seem to exist.

On Monday, January 16, 2012 2:33:19 PM UTC-5, Massimo Di Pierro wrote:

def image(): 
> return myimage() 
>
> myimage returns the binary data of the image. so calling image would 
> be the same as calling myimage. The former never calls the view. 
>
> Massimo 
>
> On Jan 16, 5:44 am, andrej burja  wrote: 
> > this works 
> > controller: 
> > def image(): 
> > return dict(a=IMG(_src=URL('myimage'+'.png'))) 
> > view: 
> > {{extend 'layout.html'}} 
> > This is the graph/image.html template 
> > {{=a}} 
> > 
> > but this doesn't 
> > controller: 
> > def image(): 
> > return myimage() 
> > view: 
> > {{extend 'layout.html'}} 
> > This is the graph/slika1.html template 
> > {{=IMG(_src=URL('myimage'+'.png'))}}



[web2py] Re: SOLVED Re: Inline image generation with matplotlib

2012-05-02 Thread Larry Wapnitsky
More updated code:

def barPlot(data):
from matplotlib.backends.backend_agg import FigureCanvasAgg as 
FigureCanvas
from matplotlib.figure import Figure
import cStringIO

print data

stream = cStringIO.StringIO()

cx = data.keys()
cy = data.values()

fig = Figure()

ax = fig.add_subplot(1,1,1)

ax.plot(cx, cy)
ax.grid(True)
ax.xaxis_date()
fig.autofmt_xdate()

canvas = FigureCanvas(fig)

canvas.print_png(stream)

return stream.getvalue()


Called by:

return dict(fr=fullrange, bc=IMG(_src=URL('barPlot(barData)')))

View page:


{{extend 'layout.html'}}
{{=bc}}

{{=fr}}

This is what appears in the source view of the page:




Re: [web2py] Re: quick SQL question

2012-05-02 Thread Larry Wapnitsky
Here's what I used:

f3o = '(\d{1,3}\.\d{1,3}\.\d{1,3})'
fullrange = {}

rg1 = re.compile(f3o,re.IGNORECASE|re.DOTALL)
for row in db(db.ips).select():#db.ips.ipaddress, db.ips.reportedby, 
db.ips.dateadded):
m = rg1.findall(row.ipaddress)
if not m[0] in fullrange:
if (db(db.ips.ipaddress.startswith(m[0])).count() == 254) and 
(row.reportedby == "RBLmilter"):
fullrange[m[0]] = row.dateadded


On Wednesday, May 2, 2012 2:14:26 PM UTC-4, Richard wrote:
>
> You could try also this :
>
> a = [ row.ipaddress for row in db().select(db.ips.ipaddress) if 
> row.ipaddress.split('.')[3] == '35' ]
>
> db(db.ips.ipaddress.belongs(tuple(a))).select(db.ips.ipaddress).first().ipaddress
>
> And for the HAVING clause I solve it earlier this week like this :
>
> list_value = []
> count = db.table1.field1.count()
> for row in db().select(db.table1.field1, count, groupby=db.table1.field1):
> if row[count]>1:
> #print row.table1.field1, row[count]
> list_value.append(row.table1.field1)
>
> So, if you combine both you should have something that do what you want!
>
> Richard
>
> On Wed, May 2, 2012 at 1:49 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Maybe raw SQL??
>>
>> Richard
>>
>>
>> On Wed, May 2, 2012 at 10:54 AM, Larry Wapnitsky wrote:
>>
>>> Here's the actual query:
>>>
>>> http://pastie.textmate.org/3848916
>>>
>>> SELECT SUBSTRING_INDEX( ipaddress, '.', 3 ) AS first_three_octet, count( * 
>>> ) AS ipCount, updated
>>>
>>>
>>>
>>> FROM ips
>>> GROUP BY SUBSTRING_INDEX( ipaddress, '.', 3 )
>>> HAVING ipCount = 254 
>>> ORDER BY ipCount DESC 
>>>
>>>
>>> On Tuesday, May 1, 2012 3:19:27 PM UTC-4, Larry Wapnitsky wrote:
>>>
>>>> In a test (non-web2py) program, I'm using a MySQL query that 
>>>> invokes SELECT SUBSTRING_INDEX.  What is the easiest way to convert this 
>>>> to 
>>>> the proper usage within web2py's DAL specifications?
>>>>
>>>> Thanks,
>>>> Larry
>>>>
>>>
>>
>

[web2py] plugin wiki issues

2012-05-04 Thread Larry Wapnitsky
Two issues with installing the wiki plugin:


   1. in my current app, I get the following error immediately after 
   installing the plugin and trying to access any portion of the app
   
   * (1146, u"Table 
   'rbl.plugin_wiki_page' doesn't exist"*
   
   2. when loading the plugin in a brand-new app, I don't see any 
   additional menu called "pages".

Please assist me in diagnosis.

Thank you


[web2py] Re: plugin wiki issues

2012-05-04 Thread Larry Wapnitsky
It looks as though the database table generation does not automatically 
take place unless you use the wizard.

How can I initiate this and get the plugin active?   The "book" doesn't 
really give great details on that.

Thanks

On Friday, May 4, 2012 2:38:51 PM UTC-4, villas wrote:
>
>
>>1. * (1146, 
>>u"Table 'rbl.plugin_wiki_page' doesn't exist"* 
>>
>>
>> Sounds like a migration error.  Do you have the tables in your DB?  If 
> not,  make sure you delete plugin_wiki table defs from the databases folder 
> so that they can be created
>  
>
>> 2.  when loading the plugin in a brand-new app, I don't see any 
>> additional menu called "pages".
>>
>
> I think you have to be logged in with either user.id == 1 or role == 
> 'editor'.  
>
> Hope that helps, David
>


[web2py] Re: Admin interface slow when static dir has a lot of files

2012-05-06 Thread Larry Weinberg
Is this being addressed?  I am finding the same problem.  Other than that, 
and a couple of other suggestions for having more links to speed up the 
admin interface workflow I am loving web2py!

[web2py] Admin Interface suggestions

2012-05-06 Thread Larry Weinberg
Once again I am LOVING web2py.  It's transformational technology.

I do have some admin interface suggestions:

1 - It would be very nice if all views in the admin interface included a 
single horizontal line near the top that had links back to the last 4 or 5 
edited files to make it easier to bounce back and forth.

2 - The collapsed state of the groupings should be remembered.  I rarely 
(never) need to see the language files, for example, and they are above the 
javascript and css files.

3 - The most often edited groups should be at the top (even though the db 
group is conceptually first.  Maybe the DB group should be collapsed if it 
needs to be first for new users.
I typically edit the views and style sheets most often, followed by the 
controllers.

4 - When editing a view it would be great if there was a popup to the list 
of style sheets and javascript files being included by the view.

5 -  Something to think about:  the admin interface could display in two 
columns optionally.  That would make many of the files visible without 
scrolling

6 - The default text editing area for a file could be larger.  Maybe there 
should be an alternate view of it that removes the large hotkey display.

More to come



[web2py] Re: plugin wiki issues

2012-05-08 Thread Larry Wapnitsky
David-

No dice.  Still getting the same errors.  It does not want to create the 
tables in my MySQL database.  I've made sure the settings are as you 
stated.  These are things I've already done, but just got into the office 
today and retried them.

On Friday, May 4, 2012 5:49:46 PM UTC-4, villas wrote:
>
> Hi Larry
>
> Generating tables is a general thing,  not just for the plugin_wiki.  As 
> you obviously do not have any data in your plugin_wiki yet,  I suggest:
>
>1. Get yourself a DB management tool for your DB. 
>2. Using the tool,  have a look in the DB.  If you are using Sqlite, 
> you should find it here: yourapp/databases/storage.sqlite,  are there any 
>plugin_wiki tables in there?  If so,  drop them.  
>3. Look in the yourapp/databases folder.  Do you see .table files with 
>plugin_wiki in the filename?  If so, delete them.
>4. Make sure that there are NO settings for migrate=False in your 
>db.py.  For example,  
>   db = DAL('sqlite://storage.sqlite', migrate=False)  
>   db = DAL(...,migrate_enabled=False)
>5. Access any page in your app.  This should now generate the tables.
>
> I appreciate that step one is a bit of a hassle,  but it is so useful to 
> be able to look inside your DB that I think it is well worth the effort. 
> You should be able to find something easily on google,  especially if you 
> are using Sqlite.
>
> Regards,  David
>
>
> On Friday, 4 May 2012 20:12:25 UTC+1, Larry Wapnitsky wrote:
>>
>> It looks as though the database table generation does not automatically 
>> take place unless you use the wizard.
>>
>> How can I initiate this and get the plugin active?   The "book" doesn't 
>> really give great details on that.
>>
>> Thanks
>>
>> On Friday, May 4, 2012 2:38:51 PM UTC-4, villas wrote:
>>>
>>>
>>>>1. * (1146, 
>>>>u"Table 'rbl.plugin_wiki_page' doesn't exist"* 
>>>>
>>>>
>>>> Sounds like a migration error.  Do you have the tables in your DB?  If 
>>> not,  make sure you delete plugin_wiki table defs from the databases folder 
>>> so that they can be created
>>>  
>>>
>>>> 2.  when loading the plugin in a brand-new app, I don't see any 
>>>> additional menu called "pages".
>>>>
>>>
>>> I think you have to be logged in with either user.id == 1 or role == 
>>> 'editor'.  
>>>
>>> Hope that helps, David
>>>
>>

[web2py] datatable plugin customization

2012-05-08 Thread Larry Wapnitsky
I'm not a CSS guy (still learning), but need to be able to change the 
default column widths in the datatable plugin.  Guidance?

Thanks,
Larry


[web2py] Re: plugin wiki issues

2012-05-08 Thread Larry Wapnitsky
In order:

Yes
Yes
No existing tables
Files don't exist
migration settings removed

Only error message from running web2py that way:  WARNING:web2py:import 
IPython error; use default python shell


On Tuesday, May 8, 2012 10:50:38 AM UTC-4, villas wrote:
>
> Hmm keep trying...
>
> Check you have appropriate read/write permissions from your host.  
> Connect with your DB management tool and create a test table to make sure 
> your DB server etc is running.
> Take one single table definition, let's call it 'yourexample'.
> Make sure there is no yourexample.table file in the yourapp/databases 
> folder.
> Delete (or comment out) any migrate or fake_migrate settings on your 
> define_table function (migrate has a default of True).
> Make sure there are no countering  migration settings on the DAL 
> connection.
> Make sure there are no fake_migration settings anywhere.
> Run python web2py.py -N -M -S yourapp  to start web2py
> Are there any error messages?
>
>
> On Tuesday, 8 May 2012 14:51:45 UTC+1, Larry Wapnitsky wrote:
>>
>> David-
>>
>> No dice.  Still getting the same errors.  It does not want to create the 
>> tables in my MySQL database.  I've made sure the settings are as you 
>> stated.  These are things I've already done, but just got into the office 
>> today and retried them.
>>
>> On Friday, May 4, 2012 5:49:46 PM UTC-4, villas wrote:
>>>
>>> Hi Larry
>>>
>>> Generating tables is a general thing,  not just for the plugin_wiki.  As 
>>> you obviously do not have any data in your plugin_wiki yet,  I suggest:
>>>
>>>1. Get yourself a DB management tool for your DB. 
>>>2. Using the tool,  have a look in the DB.  If you are using Sqlite, 
>>> you should find it here: yourapp/databases/storage.sqlite,  are there 
>>> any 
>>>plugin_wiki tables in there?  If so,  drop them.  
>>>3. Look in the yourapp/databases folder.  Do you see .table files 
>>>with plugin_wiki in the filename?  If so, delete them.
>>>4. Make sure that there are NO settings for migrate=False in your 
>>>db.py.  For example,  
>>>   db = DAL('sqlite://storage.sqlite', migrate=False)  
>>>   db = DAL(...,migrate_enabled=False)
>>>5. Access any page in your app.  This should now generate the tables.
>>>
>>> I appreciate that step one is a bit of a hassle,  but it is so useful to 
>>> be able to look inside your DB that I think it is well worth the effort. 
>>> You should be able to find something easily on google,  especially if you 
>>> are using Sqlite.
>>>
>>> Regards,  David
>>>
>>>
>>> On Friday, 4 May 2012 20:12:25 UTC+1, Larry Wapnitsky wrote:
>>>>
>>>> It looks as though the database table generation does not automatically 
>>>> take place unless you use the wizard.
>>>>
>>>> How can I initiate this and get the plugin active?   The "book" doesn't 
>>>> really give great details on that.
>>>>
>>>> Thanks
>>>>
>>>> On Friday, May 4, 2012 2:38:51 PM UTC-4, villas wrote:
>>>>>
>>>>>
>>>>>>1. * (1146, 
>>>>>>u"Table 'rbl.plugin_wiki_page' doesn't exist"* 
>>>>>>
>>>>>>
>>>>>> Sounds like a migration error.  Do you have the tables in your DB? 
>>>>>  If not,  make sure you delete plugin_wiki table defs from the databases 
>>>>> folder so that they can be created
>>>>>  
>>>>>
>>>>>> 2.  when loading the plugin in a brand-new app, I don't see any 
>>>>>> additional menu called "pages".
>>>>>>
>>>>>
>>>>> I think you have to be logged in with either user.id == 1 or role == 
>>>>> 'editor'.  
>>>>>
>>>>> Hope that helps, David
>>>>>
>>>>

Re: [web2py] datatable plugin customization

2012-05-08 Thread Larry Wapnitsky
plugin_datatable from web2py.com/plugins

On Tuesday, May 8, 2012 11:58:28 AM UTC-4, Richard wrote:
>
> Which plugin... Also if you use chrome rigth click and inspect element can 
> make it pretty easy to find a style and change the properties.
>
> Richard
>
>
> I'm not a CSS guy (still learning), but need to be able to change the 
>> default column widths in the datatable plugin.  Guidance?
>>
>> Thanks,
>> Larry
>>
>
>

Re: [web2py] datatable plugin customization

2012-05-08 Thread Larry Wapnitsky
Also, I found the "truncate" switch, which is helping me, but my table is 
appearing on the right.  Is there a list of the available "switches" for 
datatable?

On Tuesday, May 8, 2012 11:58:28 AM UTC-4, Richard wrote:
>
> Which plugin... Also if you use chrome rigth click and inspect element can 
> make it pretty easy to find a style and change the properties.
>
> Richard
>
> On Tue, May 8, 2012 at 11:46 AM, Larry Wapnitsky  wrote:
>
>> I'm not a CSS guy (still learning), but need to be able to change the 
>> default column widths in the datatable plugin.  Guidance?
>>
>> Thanks,
>> Larry
>>
>
>

[web2py] Re: plugin wiki issues

2012-05-08 Thread Larry Wapnitsky
A new, test app worked with no problems.

Here is my DAL DB connection string:  db = 
DAL('mysql://user:passw...@dbserer.company.com/dbname')

I was getting "can't create table" errors until I added "grant" rights to 
the remote "user" account.  Now, the page just spins...

On Tuesday, May 8, 2012 4:06:05 PM UTC-4, villas wrote:
>
> I guess it still didn't work then.  At this point [scratching head]:
>
> Consider upgrading your web2py.
> Create a brand new app to test the most basic DB function is there.
> Delete contents of the databases folder.
> Change the DAL connection string in db.py
> Put a simple table def in the db.py
> Run your app,  check whether there are  *.table files in the databases 
> folder,  and real tables in the DB.
> If not,  I suggest posting your DB connection string (needless to say 
> change the passwd),  and define_table function here.
>
> Sorry if I'm missing something obvious,  maybe someone else also has some 
> better advice to get this working.  
>
> Regards,  D
>


[web2py] Re: plugin wiki issues

2012-05-08 Thread Larry Wapnitsky
restarted web2py.  no dice.  died immediately when accessing any page

 (1005, u"Can't create 
table 'rbl.plugin_wiki_page' (errno: 150)")
On Tuesday, May 8, 2012 4:16:50 PM UTC-4, Larry Wapnitsky wrote:
>
> A new, test app worked with no problems.
>
> Here is my DAL DB connection string:  db = DAL('mysql://
> user:passw...@dbserer.company.com/dbname')
>
> I was getting "can't create table" errors until I added "grant" rights to 
> the remote "user" account.  Now, the page just spins...
>
> On Tuesday, May 8, 2012 4:06:05 PM UTC-4, villas wrote:
>>
>> I guess it still didn't work then.  At this point [scratching head]:
>>
>> Consider upgrading your web2py.
>> Create a brand new app to test the most basic DB function is there.
>> Delete contents of the databases folder.
>> Change the DAL connection string in db.py
>> Put a simple table def in the db.py
>> Run your app,  check whether there are  *.table files in the databases 
>> folder,  and real tables in the DB.
>> If not,  I suggest posting your DB connection string (needless to say 
>> change the passwd),  and define_table function here.
>>
>> Sorry if I'm missing something obvious,  maybe someone else also has some 
>> better advice to get this working.  
>>
>> Regards,  D
>>
>

Re: [web2py] Re: plugin wiki issues

2012-05-08 Thread Larry Wapnitsky
if I recreate the database from scratch, then re-import my data, it works 
fine.

On Tuesday, May 8, 2012 4:33:54 PM UTC-4, Larry Wapnitsky wrote:
>
>  even tried it as rootno dice.
>
>
> On 5/8/2012 4:25 PM, villas wrote:
>  
> Hi Larry,  it sounds like your DB is not configured properly for your 
> username.  I don't use MySql but maybe this prob sounds familiar to those 
> that do.  Anyone? 
> Sorry I can't think of anything more   
> D
>
> On Tuesday, 8 May 2012 21:16:50 UTC+1, Larry Wapnitsky wrote: 
>>
>> A new, test app worked with no problems. 
>>
>>  Here is my DAL DB connection string:  db = DAL('mysql://
>> user:passw...@dbserer.company.com/dbname')
>>
>>  I was getting "can't create table" errors until I added "grant" rights 
>> to the remote "user" account.  Now, the page just spins...
>>
>> On Tuesday, May 8, 2012 4:06:05 PM UTC-4, villas wrote: 
>>>
>>> I guess it still didn't work then.  At this point [scratching head]: 
>>>
>>>  Consider upgrading your web2py.
>>> Create a brand new app to test the most basic DB function is there.
>>>  Delete contents of the databases folder.
>>> Change the DAL connection string in db.py
>>> Put a simple table def in the db.py
>>> Run your app,  check whether there are  *.table files in the databases 
>>> folder,  and real tables in the DB.
>>> If not,  I suggest posting your DB connection string (needless to say 
>>> change the passwd),  and define_table function here.
>>>
>>>  Sorry if I'm missing something obvious,  maybe someone else also has 
>>> some better advice to get this working.  
>>>
>>>  Regards,  D
>>>
>>   
>
>  

Re: [web2py] datatable plugin customization

2012-05-09 Thread Larry Wapnitsky


OK.  Here's the screenshot: shifted 
datatables<http://www.zimagez.com/zimage/screenshot-05092012-084338am.php>


On Tuesday, May 8, 2012 5:16:48 PM UTC-4, Richard wrote:
>
> Good, feel free to ask for DTs... I also have to leave :)
>
> Richard
>
> On Tue, May 8, 2012 at 4:43 PM, Larry G. Wapnitsky  wrote:
>
>>  i'm about to leave my office.  I'll send you a screenshot of what I"m 
>> getting tomorrow.
>>
>>
>>
>> On 5/8/2012 4:42 PM, Richard Vézina wrote:
>>  
>> What kind of table you need, I can help you initialise DataTables, the 
>> other one I don't use them. I know how to setup jqgrid with plugin_wiki, 
>> but I didn't touch it since a long time and to me it was so difficult to 
>> configure so I abandonned it. With DataTables, I definitely help set it up. 
>>
>>  Richard
>>
>> On Tue, May 8, 2012 at 4:36 PM, Larry G. Wapnitsky wrote:
>>
>>>  I tried those, but documentation seems to be missing as well.  
>>>  
>>>
>>> On 5/8/2012 4:35 PM, Richard Vézina wrote:
>>>  
>>> ho, I think those plugin could be quite outdated... 
>>>
>>>  If you really need a table plugin, look to Datatables or PowerTable 
>>> (or PowerGrid : http://labs.blouweb.com/PowerGrid/) form Bruno.
>>>
>>>  There is also a plugin_wiki jqgrid coming pre-wrapped within web2py.
>>>
>>>  Richard
>>>
>>> On Tue, May 8, 2012 at 3:36 PM, Larry Wapnitsky wrote:
>>>
>>>> Also, I found the "truncate" switch, which is helping me, but my table 
>>>> is appearing on the right.  Is there a list of the available "switches" 
>>>> for 
>>>> datatable? 
>>>>
>>>>
>>>> On Tuesday, May 8, 2012 11:58:28 AM UTC-4, Richard wrote:
>>>>
>>>>> Which plugin... Also if you use chrome rigth click and inspect element 
>>>>> can make it pretty easy to find a style and change the properties. 
>>>>>
>>>>>  Richard
>>>>>
>>>>> On Tue, May 8, 2012 at 11:46 AM, Larry Wapnitsky  wrote: 
>>>>>
>>>>>  I'm not a CSS guy (still learning), but need to be able to change 
>>>>>> the default column widths in the datatable plugin.  Guidance?
>>>>>>  
>>>>>>  Thanks,
>>>>>> Larry
>>>>>>
>>>>>  
>>>>>   
>>>  
>>>
>>>
>>  
>>
>>  
>
On Tuesday, May 8, 2012 5:16:48 PM UTC-4, Richard wrote:
>
> Good, feel free to ask for DTs... I also have to leave :)
>
> Richard
>
> On Tue, May 8, 2012 at 4:43 PM, Larry G. Wapnitsky wrote:
>
>>  i'm about to leave my office.  I'll send you a screenshot of what I"m 
>> getting tomorrow.
>>
>>
>>
>> On 5/8/2012 4:42 PM, Richard Vézina wrote:
>>  
>> What kind of table you need, I can help you initialise DataTables, the 
>> other one I don't use them. I know how to setup jqgrid with plugin_wiki, 
>> but I didn't touch it since a long time and to me it was so difficult to 
>> configure so I abandonned it. With DataTables, I definitely help set it up. 
>>
>>  Richard
>>
>> On Tue, May 8, 2012 at 4:36 PM, Larry G. Wapnitsky wrote:
>>
>>>  I tried those, but documentation seems to be missing as well.  
>>>  
>>>
>>> On 5/8/2012 4:35 PM, Richard Vézina wrote:
>>>  
>>> ho, I think those plugin could be quite outdated... 
>>>
>>>  If you really need a table plugin, look to Datatables or PowerTable 
>>> (or PowerGrid : http://labs.blouweb.com/PowerGrid/) form Bruno.
>>>
>>>  There is also a plugin_wiki jqgrid coming pre-wrapped within web2py.
>>>
>>>  Richard
>>>
>>> On Tue, May 8, 2012 at 3:36 PM, Larry Wapnitsky wrote:
>>>
>>>> Also, I found the "truncate" switch, which is helping me, but my table 
>>>> is appearing on the right.  Is there a list of the available "switches" 
>>>> for 
>>>> datatable? 
>>>>
>>>>
>>>> On Tuesday, May 8, 2012 11:58:28 AM UTC-4, Richard wrote:
>>>>
>>>>> Which plugin... Also if you use chrome rigth click and inspect element 
>>>>> can make it pretty easy to find a style and change the properties. 
>>>>>
>>>>>  Richard
>>>>>
>>>>> On Tue, May 8, 2012 at 11:46 AM, Larry Wapnitsky  wrote: 
>>>>>
>>>>>  I'm not a CSS guy (still learning), but need to be able to change 
>>>>>> the default column widths in the datatable plugin.  Guidance?
>>>>>>  
>>>>>>  Thanks,
>>>>>> Larry
>>>>>>
>>>>>  
>>>>>   
>>>  
>>>
>>>
>>  
>>
>>  
>

[web2py] Re: web2py resources

2012-05-09 Thread Larry Wapnitsky
What about for some of the jquery/JSON specific ideas?  What 
recommendations do you have for those of us who are clueless in those 
factions? :)

On Thursday, May 3, 2012 9:46:35 PM UTC-4, Anthony wrote:
>
> On Thursday, May 3, 2012 8:20:28 PM UTC-4, newnomad wrote:
>>
>> For those without any prior python knowledge, is it useful or essential 
>> to first exercise it, using the learnpythonthehardway 
>> book for 
>> example? Or would it confuse, and is the advise to dive directly into 
>> web2py?
>
>
> I think you can dive directly into web2py (especially if you go through 
> the Python chapter in the book), but it's certainly a good idea to gain 
> some expertise in Python more generally as well.
>
> Anthony
>


[web2py] jqgrid assistance

2012-05-10 Thread Larry Wapnitsky
I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
can't seem to get it to display data.  Here is my code:

*{{=plugin_wiki.widget('jqgrid', db.ips)}}*

I see a table with MOST of my fields showing (not all, strangely), but no 
data.  I know for a fact that the database is populated.

Ideas?

Thanks


[web2py] Re: Problems trying to use jqgrid from plugin_wiki

2012-05-10 Thread Larry Wapnitsky
Massimo-

I'm still getting this in the latest trunk of web2py.  Any ideas?

Thanks,
Larry

On Monday, January 10, 2011 4:13:12 PM UTC-5, Massimo Di Pierro wrote:
>
> It took me a while to debug this. 
> The problem is that the ajax service that fills the table requires 
> login. 
> You probably have not created an account or have not logged in. 
> The page that displays the jqgrid does not require login so it shows, 
> but the service responds with a login page instead of sending the 
> data. 
>
> There should be a clearly displayed error in this case and I will 
> modify plugin_wiki to take care of this case more gracefully. 
>
> On Jan 10, 2:00 pm, Lisandro  wrote: 
> > I downloaded web2py (1.91.6) and executed the development server. 
> > I edited the "welcome" app: 
> > 
> > First, I installed the plugin "plugin_wiki" in the "welcome" app. 
> > 
> > Second, I edited the db.py, adding the following line (every other 
> > thing stays as default): 
> > 
> --- 
>  
> > db.define_table('ciudadanos', Field('nro_documento')) 
> > 
> --- 
>  
> > I added some sample records. 
> > 
> > Third, I edited the "default/index.html" view, adding the following 
> > line: 
> > 
> --- 
>  
> > {{=plugin_wiki.widget('jqgrid', 'ciudadanos')}} 
> > 
> --- 
>  
> > 
> > When I acceshttp://.../welcome/default/index, I can see the jqgrid, 
> > but it contains nothing. 
> > I tried with: 
> >  * {{=plugin_wiki.widget('jqgrid',  table='ciudadanos')}} 
> >  * {{=plugin_wiki.widget('jqgrid', table=db.ciudadanos)}} 
> > But nothing happens. 
> > 
> > ¿What am I doing wrong? Thanks in advance.



[web2py] Re: jqgrid assistance

2012-05-10 Thread Larry Wapnitsky
This is what's showing up in the source code:

http://pastie.textmate.org/3891282

On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>
> If you use chrome check the developer tools. There should be some ajax 
> request to get data. Does it fail? Why?
> To check you can also delete your tickets in errors/* and see if any new 
> one shows up.
>
> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>
>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>> can't seem to get it to display data.  Here is my code:
>>
>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>
>> I see a table with MOST of my fields showing (not all, strangely), but no 
>> data.  I know for a fact that the database is populated.
>>
>> Ideas?
>>
>> Thanks
>>
>
On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>
> If you use chrome check the developer tools. There should be some ajax 
> request to get data. Does it fail? Why?
> To check you can also delete your tickets in errors/* and see if any new 
> one shows up.
>
> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>
>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>> can't seem to get it to display data.  Here is my code:
>>
>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>
>> I see a table with MOST of my fields showing (not all, strangely), but no 
>> data.  I know for a fact that the database is populated.
>>
>> Ideas?
>>
>> Thanks
>>
>

[web2py] Re: jqgrid assistance

2012-05-10 Thread Larry Wapnitsky
Also just found this via the dev tools::

Request URL:
http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc



[web2py] Re: jqgrid assistance

2012-05-10 Thread Larry Wapnitsky
Even this fails on a wiki page:

``
name: jqgrid
table: db.ips
col_width: 80
width: 700
height: 300
``:widget


Traceback (most recent call last):
  File "/home/lwapnitsky/web2py/applications/rbl_web2py/models/plugin_wiki.py", 
line 635, in render_widget
html = getattr(PluginWikiWidgets,name)(**args)
  File "/home/lwapnitsky/web2py/applications/rbl_web2py/models/plugin_wiki.py", 
line 245, in jqgrid
fields = [x.strip() for x in db[table].fields if 
db[table][x.strip()].readable]
  File "/home/lwapnitsky/web2py/gluon/dal.py", line 6773, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'db.ips'



[web2py] Re: jqgrid assistance

2012-05-10 Thread Larry Wapnitsky
the whole "plugin_wiki" thing is really starting to get my goat.  Now I'm 
getting errors trying to delete my test wiki page: 

 (1452, u'Cannot add or 
update a child row: a foreign key constraint fails 
(`rbl`.`plugin_wiki_page_archive`, CONSTRAINT 
`plugin_wiki_page_archive_ibfk_1` FOREIGN KEY (`current_record`) REFERENCES 
`plugin_wiki_page` (`id`) ON DELETE CASCADE)')
On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>
> If you use chrome check the developer tools. There should be some ajax 
> request to get data. Does it fail? Why?
> To check you can also delete your tickets in errors/* and see if any new 
> one shows up.
>
> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>
>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>> can't seem to get it to display data.  Here is my code:
>>
>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>
>> I see a table with MOST of my fields showing (not all, strangely), but no 
>> data.  I know for a fact that the database is populated.
>>
>> Ideas?
>>
>> Thanks
>>
>

[web2py] Re: jqgrid assistance

2012-05-11 Thread Larry Wapnitsky
got it working by using the wizard to create a new version of my app.

On Thursday, May 10, 2012 4:16:00 PM UTC-4, Larry Wapnitsky wrote:
>
> the whole "plugin_wiki" thing is really starting to get my goat.  Now I'm 
> getting errors trying to delete my test wiki page: 
>
>  (1452, u'Cannot add or 
> update a child row: a foreign key constraint fails 
> (`rbl`.`plugin_wiki_page_archive`, CONSTRAINT 
> `plugin_wiki_page_archive_ibfk_1` FOREIGN KEY (`current_record`) REFERENCES 
> `plugin_wiki_page` (`id`) ON DELETE CASCADE)')
> On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>>
>> If you use chrome check the developer tools. There should be some ajax 
>> request to get data. Does it fail? Why?
>> To check you can also delete your tickets in errors/* and see if any new 
>> one shows up.
>>
>> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>>
>>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>>> can't seem to get it to display data.  Here is my code:
>>>
>>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>>
>>> I see a table with MOST of my fields showing (not all, strangely), but 
>>> no data.  I know for a fact that the database is populated.
>>>
>>> Ideas?
>>>
>>> Thanks
>>>
>>

[web2py] Re: jqgrid assistance

2012-05-11 Thread Larry Wapnitsky
nix that.  the updated version in plugin_wiki is still giving me grief. 
 the standard version you can install from the wizard (jqgrid) works except 
for individual column sizing.

On Friday, May 11, 2012 3:42:04 PM UTC-4, Larry Wapnitsky wrote:
>
> got it working by using the wizard to create a new version of my app.
>
> On Thursday, May 10, 2012 4:16:00 PM UTC-4, Larry Wapnitsky wrote:
>>
>> the whole "plugin_wiki" thing is really starting to get my goat.  Now I'm 
>> getting errors trying to delete my test wiki page: 
>>
>>  (1452, u'Cannot add or 
>> update a child row: a foreign key constraint fails 
>> (`rbl`.`plugin_wiki_page_archive`, CONSTRAINT 
>> `plugin_wiki_page_archive_ibfk_1` FOREIGN KEY (`current_record`) REFERENCES 
>> `plugin_wiki_page` (`id`) ON DELETE CASCADE)')
>> On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> If you use chrome check the developer tools. There should be some ajax 
>>> request to get data. Does it fail? Why?
>>> To check you can also delete your tickets in errors/* and see if any new 
>>> one shows up.
>>>
>>> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>>>
>>>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>>>> can't seem to get it to display data.  Here is my code:
>>>>
>>>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>>>
>>>> I see a table with MOST of my fields showing (not all, strangely), but 
>>>> no data.  I know for a fact that the database is populated.
>>>>
>>>> Ideas?
>>>>
>>>> Thanks
>>>>
>>>

[web2py] Re: jqgrid assistance

2012-05-11 Thread Larry Wapnitsky
Screenshot of the issue 
here<http://www.zimagez.com/zimage/screenshot-05112012-041826pm.php>
:

<http://www.zimagez.com/full/85e6a64dc62ed33f329a618ec91320d41abfadb28052b4b86924c0fb25bf0a9d45207eef74a4ebe8b70e615d5809904e0acef0c8ca77eb20.php>


On Friday, May 11, 2012 4:08:01 PM UTC-4, Larry Wapnitsky wrote:
>
> nix that.  the updated version in plugin_wiki is still giving me grief. 
>  the standard version you can install from the wizard (jqgrid) works except 
> for individual column sizing.
>
> On Friday, May 11, 2012 3:42:04 PM UTC-4, Larry Wapnitsky wrote:
>>
>> got it working by using the wizard to create a new version of my app.
>>
>> On Thursday, May 10, 2012 4:16:00 PM UTC-4, Larry Wapnitsky wrote:
>>>
>>> the whole "plugin_wiki" thing is really starting to get my goat.  Now 
>>> I'm getting errors trying to delete my test wiki page: 
>>>
>>>  (1452, u'Cannot add 
>>> or update a child row: a foreign key constraint fails 
>>> (`rbl`.`plugin_wiki_page_archive`, CONSTRAINT 
>>> `plugin_wiki_page_archive_ibfk_1` FOREIGN KEY (`current_record`) REFERENCES 
>>> `plugin_wiki_page` (`id`) ON DELETE CASCADE)')
>>> On Thursday, May 10, 2012 3:44:49 PM UTC-4, Massimo Di Pierro wrote:
>>>>
>>>> If you use chrome check the developer tools. There should be some ajax 
>>>> request to get data. Does it fail? Why?
>>>> To check you can also delete your tickets in errors/* and see if any 
>>>> new one shows up.
>>>>
>>>> On Thursday, 10 May 2012 08:31:15 UTC-5, Larry Wapnitsky wrote:
>>>>>
>>>>> I'm trying out jqgrid (yes, I finally got plugin_wiki working ;)), but 
>>>>> can't seem to get it to display data.  Here is my code:
>>>>>
>>>>> *{{=plugin_wiki.widget('jqgrid', db.ips)}}*
>>>>>
>>>>> I see a table with MOST of my fields showing (not all, strangely), but 
>>>>> no data.  I know for a fact that the database is populated.
>>>>>
>>>>> Ideas?
>>>>>
>>>>> Thanks
>>>>>
>>>>

Re: [web2py] Re: jqgrid assistance

2012-05-11 Thread Larry Wapnitsky
I'll try that, but even adjusting, this (in the controller) does not work:

wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w",
fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])

nor does:

wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", fieldvalue="w",
fields=["id", "ipaddress", "attacknotes"])

On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> What do you get if you call this yourself?
>
> Anyway, I do not see the signature. Are you logged in?
>
> jqgrid in plugin_wiki requires login if I remember it right.
>
>
>
> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>
>> Also just found this via the dev tools::
>>
>> Request URL:
>> http://127.0.0.1:8000/rbl_**web2py/plugin_wiki/jqgrid?**
>> columns=ipaddress%**2Cattacknotes%2Cb_or_w%**2CupdCount&fieldname=&**
>> fieldvalue=None&tablename=ips&**_search=false&nd=**
>> 1336679760463&rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>
>>


Re: [web2py] Re: jqgrid assistance

2012-05-11 Thread Larry Wapnitsky
better, but still no data showing up.

On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> The second argument is the name of the table, not the table.
>
> wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w",
> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>
> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote:
>>
>> I'll try that, but even adjusting, this (in the controller) does not work:
>>
>> wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w",
>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>
>> nor does:
>>
>> wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w",
>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>
>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> What do you get if you call this yourself?
>>>
>>> Anyway, I do not see the signature. Are you logged in?
>>>
>>> jqgrid in plugin_wiki requires login if I remember it right.
>>>
>>>
>>>
>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>>>
>>>> Also just found this via the dev tools::
>>>>
>>>> Request URL:
>>>> http://127.0.0.1:8000/rbl_**web2**py/plugin_wiki/jqgrid?**columns=**
>>>> ipaddress%**2Cattacknotes%2Cb_**or_w%**2CupdCount&fieldname=&**fie**
>>>> ldvalue=None&tablename=ips&**_**search=false&nd=**1336679760463&**
>>>> rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>>>
>>>>
>>


[web2py] Why does jquery autocomplete not work in subview form after submission?

2012-05-13 Thread Larry Weinberg
I'm not sure if this is web2py question or javascript related issue.

In an HTML view I am trying to call a subview with a form in it that has a 
jquery
autocomplete attached to a text field in the form.  
I attach the autocomplete like this in the form view's document ready 
function:

$(document).ready(function(){ 
$('#autome').autocomplete({
source: function(request, response) {
$.ajax({  url: "/myapp/mycontroller/myautocomplete.json",
data: request,
dataType: "json",
type: "POST",
success: function(data){ response(data.source)}  
})}});
});

It works fine the first time the form is loaded as a subview via LOAD. 
Once the form is processed through self-submission the autocomplete no 
longer works even though 
the ready function is being called again.

I'm loading the view like this:


{{=LOAD('default/ajaxsearch',ajax=True)}}



If I run the form by itself (not in a LOAD) the autocomplete works before 
and after form submission as expected.

Here is the function for the inner form:

def innerform():
items=[]

form=FORM(DIV(TABLE(TR(INPUT(_name='q',_id="autome",requires=IS_NOT_EMPTY(),_keepvalues=False),
   INPUT(_type='submit',_value='Search')
  ))),_method='GET')
if form.accepts(request.vars,session=None):
items = doMyStuff() 
return dict(form=form,items=items)

Can anyone tell me why?

Thanks




Re: [web2py] Re: jqgrid assistance

2012-05-14 Thread Larry Wapnitsky
Even if I remove "fieldname", et.al. after the table name, no data.

On Friday, May 11, 2012 8:13:59 PM UTC-4, Larry Wapnitsky wrote:
>
> better, but still no data showing up.
>
> On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> The second argument is the name of the table, not the table.
>>
>> wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w", 
>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>
>> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote:
>>>
>>> I'll try that, but even adjusting, this (in the controller) does not 
>>> work:
>>>
>>> wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w", 
>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>
>>> nor does:
>>>
>>> wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", 
>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>
>>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> What do you get if you call this yourself?
>>>>
>>>> Anyway, I do not see the signature. Are you logged in?
>>>>
>>>> jqgrid in plugin_wiki requires login if I remember it right.
>>>>
>>>>
>>>>
>>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>>>>
>>>>> Also just found this via the dev tools::
>>>>>
>>>>> Request URL:
>>>>> http://127.0.0.1:8000/rbl_**web2**py/plugin_wiki/jqgrid?**columns=**
>>>>> ipaddress%**2Cattacknotes%2Cb_**or_w%**2CupdCount&fieldname=&**fie**
>>>>> ldvalue=None&tablename=ips&**_**search=false&nd=**1336679760463&**
>>>>> rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>>>>
>>>>>
>>>
>

Re: [web2py] Re: jqgrid assistance

2012-05-14 Thread Larry Wapnitsky
404 not found

On Monday, May 14, 2012 2:02:37 PM UTC-4, Massimo Di Pierro wrote:
>
> can you use chrome to see what is the ajax request? Can you try call the 
> url of the ajax request manually? What do you get? A ticket?
>
> On Monday, 14 May 2012 08:55:53 UTC-5, Larry Wapnitsky wrote:
>>
>> Even if I remove "fieldname", et.al. after the table name, no data.
>>
>> On Friday, May 11, 2012 8:13:59 PM UTC-4, Larry Wapnitsky wrote:
>>>
>>> better, but still no data showing up.
>>>
>>> On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> The second argument is the name of the table, not the table.
>>>>
>>>> wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w", 
>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>
>>>> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote:
>>>>>
>>>>> I'll try that, but even adjusting, this (in the controller) does not 
>>>>> work:
>>>>>
>>>>> wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w", 
>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>
>>>>> nor does:
>>>>>
>>>>> wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", 
>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>
>>>>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>
>>>>>> What do you get if you call this yourself?
>>>>>>
>>>>>> Anyway, I do not see the signature. Are you logged in?
>>>>>>
>>>>>> jqgrid in plugin_wiki requires login if I remember it right.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>>>>>>
>>>>>>> Also just found this via the dev tools::
>>>>>>>
>>>>>>> Request URL:
>>>>>>> http://127.0.0.1:8000/rbl_**web2**py/plugin_wiki/jqgrid?**columns=**
>>>>>>> ipaddress%**2Cattacknotes%2Cb_**or_w%**2CupdCount&fieldname=&**fie**
>>>>>>> ldvalue=None&tablename=ips&**_**search=false&nd=**1336679760463&**
>>>>>>> rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>>>>>>
>>>>>>>
>>>>>
>>>

Re: [web2py] Re: jqgrid assistance

2012-05-14 Thread Larry Wapnitsky
can I send you a copy of the project directory for a quick analysis?

On Monday, May 14, 2012 2:02:37 PM UTC-4, Massimo Di Pierro wrote:
>
> can you use chrome to see what is the ajax request? Can you try call the 
> url of the ajax request manually? What do you get? A ticket?
>
> On Monday, 14 May 2012 08:55:53 UTC-5, Larry Wapnitsky wrote:
>>
>> Even if I remove "fieldname", et.al. after the table name, no data.
>>
>> On Friday, May 11, 2012 8:13:59 PM UTC-4, Larry Wapnitsky wrote:
>>>
>>> better, but still no data showing up.
>>>
>>> On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> The second argument is the name of the table, not the table.
>>>>
>>>> wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w", 
>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>
>>>> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote:
>>>>>
>>>>> I'll try that, but even adjusting, this (in the controller) does not 
>>>>> work:
>>>>>
>>>>> wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w", 
>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>
>>>>> nor does:
>>>>>
>>>>> wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", 
>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>
>>>>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>
>>>>>> What do you get if you call this yourself?
>>>>>>
>>>>>> Anyway, I do not see the signature. Are you logged in?
>>>>>>
>>>>>> jqgrid in plugin_wiki requires login if I remember it right.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>>>>>>
>>>>>>> Also just found this via the dev tools::
>>>>>>>
>>>>>>> Request URL:
>>>>>>> http://127.0.0.1:8000/rbl_**web2**py/plugin_wiki/jqgrid?**columns=**
>>>>>>> ipaddress%**2Cattacknotes%2Cb_**or_w%**2CupdCount&fieldname=&**fie**
>>>>>>> ldvalue=None&tablename=ips&**_**search=false&nd=**1336679760463&**
>>>>>>> rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>>>>>>
>>>>>>>
>>>>>
>>>

Re: [web2py] Re: jqgrid assistance

2012-05-14 Thread Larry Wapnitsky
Here's what it's generating:

Whitelisted Addresses<!--
jQuery(document).ready(function(){jQuery("#jqgrid_ips").jqGrid({ url:
'/rbl_web2py/plugin_wiki/jqgrid?columns=id%2Cipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips'
, datatype: "json", colNames: ["Id", "IP Address", "Attack Notes", "B Or W", 
"Updcount"],colModel:[{"index": "id", "sortable": true, "name": "id", 
"width": 80}, {"index": "ipaddress", "sortable": true, "name": "ipaddress", 
"width": 80}, {"index": "attacknotes", "sortable": true, "name": 
"attacknotes", "width": 80}, {"index": "b_or_w", "sortable": true, "name": 
"b_or_w", "width": 80}, {"index": "updCount", "sortable": true, "name": 
"updCount", "width": 80}], rowNum:10, rowList:[20,50,100], pager: 
'#jqgrid_ips_pager', viewrecords: true,height:300});jQuery("#jqgrid_ips").
jqGrid('navGrid','#jqgrid_ips_pager',{search:true,add:false,edit:false,del:
false});jQuery("#jqgrid_ips").setGridWidth(700,false);jQuery(
'select.ui-pg-selbox,input.ui-pg-input').css('width','50px');});
//-->

Strangely, I just noticed that it's generating code that's commented 
out...



On Monday, May 14, 2012 3:20:22 PM UTC-4, Massimo Di Pierro wrote:
>
> What's the url? this should be calling an action in plugin wiki. must be 
> there.
>
> On Monday, 14 May 2012 13:11:03 UTC-5, Larry Wapnitsky wrote:
>>
>> 404 not found
>>
>> On Monday, May 14, 2012 2:02:37 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> can you use chrome to see what is the ajax request? Can you try call the 
>>> url of the ajax request manually? What do you get? A ticket?
>>>
>>> On Monday, 14 May 2012 08:55:53 UTC-5, Larry Wapnitsky wrote:
>>>>
>>>> Even if I remove "fieldname", et.al. after the table name, no data.
>>>>
>>>> On Friday, May 11, 2012 8:13:59 PM UTC-4, Larry Wapnitsky wrote:
>>>>>
>>>>> better, but still no data showing up.
>>>>>
>>>>> On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>
>>>>>> The second argument is the name of the table, not the table.
>>>>>>
>>>>>> wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w", 
>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>>
>>>>>> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote:
>>>>>>>
>>>>>>> I'll try that, but even adjusting, this (in the controller) does not 
>>>>>>> work:
>>>>>>>
>>>>>>> wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w", 
>>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>>>
>>>>>>> nor does:
>>>>>>>
>>>>>>> wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", 
>>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>>>
>>>>>>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>>>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>>>
>>>>>>>> What do you get if you call this yourself?
>>>>>>>>
>>>>>>>> Anyway, I do not see the signature. Are you logged in?
>>>>>>>>
>>>>>>>> jqgrid in plugin_wiki requires login if I remember it right.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote:
>>>>>>>>>
>>>>>>>>> Also just found this via the dev tools::
>>>>>>>>>
>>>>>>>>> Request URL:
>>>>>>>>> http://127.0.0.1:8000/rbl_**web2**py/plugin_wiki/jqgrid?**columns=
>>>>>>>>> **ipaddress%**2Cattacknotes%2Cb_**or_w%**2CupdCount&fieldname=&**
>>>>>>>>> fie**ldvalue=None&tablename=ips&**_**search=false&nd=**
>>>>>>>>> 1336679760463&**rows=10&page=1&**sidx=&sord=asc<http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>

[web2py] Re: Why does jquery autocomplete not work in subview form after submission?

2012-05-14 Thread Larry Weinberg
I found a solution to this. I had to add a jQuery .on() handler for focus. 
Is this the best way to handle this?
I guess this isn't a web2py problem, it's the nature of 
ajax/javascript/jquery I assume.  Any way for web2py to magically fix this 
kind of thing?

$(document).ready(function()
{ 
$(document).on("focus",'#autome',function(e) {
if ( !$(this).data("autocomplete") ) { // If the autocomplete 
wasn't called yet:
   $('#autome').autocomplete({
 source: function(request, response) {
$.ajax({  url: 
"/autocomplete/default/myautocomplete.json",
  data: request,
  dataType: "json",
  type: "POST",
  success: 
function(data){ response(data.source)}  
  })}});
}
});
  
$('#autome').autocomplete({
 source: function(request, response) {
$.ajax({  url: 
"/autocomplete/default/myautocomplete.json",
  data: request,
  dataType: "json",
  type: "POST",
  success: function(data){ 
response(data.source)}  
  })}});

});

On Monday, May 14, 2012 3:19:05 PM UTC-7, Larry Weinberg wrote:
>
> OK, here is a minimal sample app that demonstrates the problem.  I'm 
> pretty new to web2py so maybe I'm not using the system as I should be. 
>  Thank you for taking a look!



[web2py] Re: how to set text limitation in a div

2012-05-14 Thread Larry Weinberg
You want style of overflow:hidden I believe.



[web2py] Re: db two selects

2012-05-15 Thread Larry Wapnitsky
If you resort to using Python code, let me know.  I just did this for one 
of the lists in my database that has hit counts, dates, etc.

On Sunday, May 13, 2012 3:27:56 PM UTC-4, pbreit wrote:
>
> I'm not sure that query will do what you want. I think you need to sort by 
> views separately.



[web2py] Editor broken in trunk?

2012-05-20 Thread Larry Weinberg
My previous web2py installation works fine

I grabbed the trunk and out of the box the editor is unable to save.  I can 
edit text, but there is no way to save the text now.  Also, the menu bar is 
not visible for it.

Is this a known problem or do I have some python installation problem?




[web2py] Re: Editor broken in trunk?

2012-05-20 Thread Larry Weinberg
I cannot save with the button.
I tried Safari and Chrome.  Both had the problem.

On Sunday, May 20, 2012 8:46:42 AM UTC-7, Larry Weinberg wrote:
>
> My previous web2py installation works fine
>
> I grabbed the trunk and out of the box the editor is unable to save.  I 
> can edit text, but there is no way to save the text now.  Also, the menu 
> bar is not visible for it.
>
> Is this a known problem or do I have some python installation problem?
>
>
>

Re: [web2py] Re: jqgrid assistance

2012-05-21 Thread Larry Wapnitsky
Any ideas, Massimo?  This would really be great, as my database is growing.

Thanks.

On Tuesday, May 15, 2012 9:55:57 AM UTC-4, Larry Wapnitsky wrote:
>
>  right...realized that after I sent it (long day)
>
> any ideas?
>
> On 5/15/2012 9:53 AM, Massimo Di Pierro wrote:
>  
> It is not really a comment: 
> http://lachy.id.au/log/2005/05/script-comments
>
> On Monday, 14 May 2012 14:25:07 UTC-5, Larry Wapnitsky wrote: 
>>
>> Here's what it's generating: 
>>
>>   Whitelisted Addresses> "jqgrid_ips_pager"><!--
>> jQuery(document).ready(function(){jQuery("#jqgrid_ips").jqGrid({ url:
>> '/rbl_web2py/plugin_wiki/jqgrid?columns=id%2Cipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips'
>> , datatype: "json", colNames: ["Id", "IP Address", "Attack Notes", "B Or 
>> W", "Updcount"],colModel:[{"index": "id", "sortable": true, "name": "id", 
>> "width": 80}, {"index": "ipaddress", "sortable": true, "name": 
>> "ipaddress", "width": 80}, {"index": "attacknotes", "sortable": true, 
>> "name": "attacknotes", "width": 80}, {"index": "b_or_w", "sortable": true
>> , "name": "b_or_w", "width": 80}, {"index": "updCount", "sortable": true, 
>> "name": "updCount", "width": 80}], rowNum:10, rowList:[20,50,100], pager: 
>> '#jqgrid_ips_pager', viewrecords: true,height:300});jQuery("#jqgrid_ips"
>> ).jqGrid('navGrid','#jqgrid_ips_pager',{search:true,add:false,edit:false,
>> del:false});jQuery("#jqgrid_ips").setGridWidth(700,false);jQuery(
>> 'select.ui-pg-selbox,input.ui-pg-input').css('width','50px');});
>> //-->
>>
>> Strangely, I just noticed that it's generating code that's commented 
>> out...
>>
>>
>>   
>> On Monday, May 14, 2012 3:20:22 PM UTC-4, Massimo Di Pierro wrote: 
>>>
>>> What's the url? this should be calling an action in plugin wiki. must be 
>>> there.
>>>
>>> On Monday, 14 May 2012 13:11:03 UTC-5, Larry Wapnitsky wrote: 
>>>>
>>>> 404 not found
>>>>
>>>> On Monday, May 14, 2012 2:02:37 PM UTC-4, Massimo Di Pierro wrote: 
>>>>>
>>>>> can you use chrome to see what is the ajax request? Can you try call 
>>>>> the url of the ajax request manually? What do you get? A ticket?
>>>>>
>>>>> On Monday, 14 May 2012 08:55:53 UTC-5, Larry Wapnitsky wrote: 
>>>>>>
>>>>>> Even if I remove "fieldname", et.al. after the table name, no data.
>>>>>>
>>>>>> On Friday, May 11, 2012 8:13:59 PM UTC-4, Larry Wapnitsky wrote: 
>>>>>>>
>>>>>>> better, but still no data showing up.
>>>>>>>
>>>>>>> On Fri, May 11, 2012 at 7:23 PM, Massimo Di Pierro <
>>>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>>>
>>>>>>>> The second argument is the name of the table, not the table.
>>>>>>>>
>>>>>>>>  wl2 = plugin_wiki.widget('jqgrid', 'ips', fieldname="b_or_w", 
>>>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"]) 
>>>>>>>>
>>>>>>>> On Friday, 11 May 2012 17:07:02 UTC-5, Larry Wapnitsky wrote: 
>>>>>>>>>
>>>>>>>>> I'll try that, but even adjusting, this (in the controller) does 
>>>>>>>>> not work: 
>>>>>>>>>
>>>>>>>>>  wl2 = plugin_wiki.widget('jqgrid', db.ips, fieldname="b_or_w", 
>>>>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>>>>>
>>>>>>>>>  nor does:
>>>>>>>>>
>>>>>>>>>  wl2 = plugin_wiki.widget('jqgrid', ips, fieldname="b_or_w", 
>>>>>>>>> fieldvalue="w", fields=["id", "ipaddress", "attacknotes"])
>>>>>>>>>
>>>>>>>>> On Fri, May 11, 2012 at 6:01 PM, Massimo Di Pierro <
>>>>>>>>> massimo.dipie...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> What do you get if you call this yourself? 
>>>>>>>>>>
>>>>>>>>>>  Anyway, I do not see the signature. Are you logged in?
>>>>>>>>>>
>>>>>>>>>>  jqgrid in plugin_wiki requires login if I remember it right.
>>>>>>>>>>
>>>>>>>>>>  
>>>>>>>>>>
>>>>>>>>>> On Thursday, 10 May 2012 15:02:27 UTC-5, Larry Wapnitsky wrote: 
>>>>>>>>>>>
>>>>>>>>>>> Also just found this via the dev tools:: 
>>>>>>>>>>>
>>>>>>>>>>>  Request URL:
>>>>>>>>>>>  
>>>>>>>>>>> http://127.0.0.1:8000/rbl_web2py/plugin_wiki/jqgrid?columns=ipaddress%2Cattacknotes%2Cb_or_w%2CupdCount&fieldname=&fieldvalue=None&tablename=ips&_search=false&nd=1336679760463&rows=10&page=1&sidx=&sord=asc
>>>>>>>>>>>
>>>>>>>>>>> 
>>>>>>>>>
>>>>>>>  
>
>  

[web2py] Re: Support for MS Access?

2012-05-22 Thread Larry Wapnitsky
Has anyone tested this further? I have an Access database that I'd like to 
parse for a web2py project.  It's a live database that's too big to export 
to MySQL right now.

Thanks,
Larry

On Thursday, March 17, 2011 9:07:03 AM UTC-4, DenesL wrote:
>
>
> It depends on how you want to connect. 
> The current mssql driver supports DSN connections: 
> mssql://the_dsn 
>
> If you plan to use a different connection method please provide 
> examples to be able to code in the appropriate changes in the source. 
>
> References that might be useful: 
> http://code.google.com/p/pyodbc/wiki/ConnectionStrings 
> http://www.connectionstrings.com/access 
> http://www.connectionstrings.com/access-2007 
>
>
> On Mar 17, 5:04 am, Philnext  wrote: 
> > I don't understand : how, with a "DAL('mssql: ...')", will pyodbc send 
> > the good connection string to tSQLDriverConnect for MS Access 
> > databases ? 
> > May you give an example of DAL connection string for connect to a 
> > 'mybase.mdb' Access database ? 
> > 
> > On 17 mar, 00:34, DenesL  wrote: 
> > 
> > > There is no DAL('msaccess: ...'), not yet anyway. 
> > 
> > > You have to test using DAL('mssql: ...') or 
> > > DAL('mssql2: ...'). 
> > 
> > > On Mar 16, 7:15 pm, Philnext  wrote: 
> > 
> > > > May you tell me the good connexion string for MS Access ? 
> > > > ( may be  like "db = DAL('msaccess://mybase.mdb')" ?) 
> > 
> > > > (Sorry if this message is 'doubled') 
> > 
> > > > On 12 mar, 18:08, Massimo Di Pierro  
> > > > wrote: 
> > 
> > > > > Nobody has tried byt the mssql adapter (pyodbc) should work 
> withaccess. The SQL is the same. 
> > > > > Try and tel us know what problems you run into. 
> > 
> > > > > On Mar 12, 9:43 am, Philnext  wrote: 
> > 
> > > > > > HelIo 
> > > > > > I saw in a last year post a question "do we have support forMS 
> > > > > >Access?" as I need it for my current projet I would know if there 
> is 
> > > > > > any previous dev. for it. 
> > > > > > Thanks. 
> > 
> >



[web2py] alternates to pyjamas/pyjs?

2012-05-30 Thread Larry Wapnitsky
Are there any good alternatives to using pyjamas/pyjs or learning 
JavaScript from scratch?  I've tried installing pyjamas/pyjs on a few of my 
Debian systems (thank G-d for virtual machines), but can't seem to get it 
to run in development.  I've tried from source and followed a ton of 
information on getting it to run on Ubuntu, but no luck.

Thanks,
Larry


[web2py] Three typos/updates in web2py online book (JSON/Pyjamas section)

2012-06-06 Thread Larry Wapnitsky
In section http://web2py.com/books/default/chapter/29/10#JSONRPC-and-Pyjamas

   1. Pyjamas is now known as PyJS, even though the libraries are still 
   called pyjamas
   2. import pyjamas.ui.KeyboardListener should read import 
pyjamas.ui.KeyboardListener 
   as KeyboardListener to work properly
   3. src="{{=URL('static','output/*pygwt.js*')}}"> should be 
*bootstrap.js*instead of 
   *pygwt.js*
   


Re: [web2py] Is anyone using GWT?

2012-06-07 Thread Larry Wapnitsky
I'm slowly learning the PyJS/Pyjamas libraries, so I'll say "yes" for me

On Thursday, June 7, 2012 11:31:30 AM UTC-4, Richard wrote:
>
> I can't speak for the orthers, but web2py is tigthly bone to jQuery and it 
> is very easy to include jQuery UI, so I guest many users just use those lib 
> in a similar way they could use GWT.
>
> Richard
>
> On Thu, Jun 7, 2012 at 11:18 AM, Carl  wrote:
>
>> Before I ask specifics, is there anyone using GWT on the client and 
>> Web2py on the server?
>
>
>

[web2py] Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
I am working on a centos 5.5 server using apache and mod_wsgi.
I have a subdomain set up which has web2py 1.99 installed at the root of 
the domain.
This works great.

I have been trying to set up a subfolder to host the trunk version of 
web2py independently so I can try it.
I added to the apache WSGI configuration to add the /trunk/ version of 
web2py which is in 
a subfolder of the web-apps folder:
   WSGIScriptAlias /trunk /opt/web-apps/w2p_trunk/web2py/wsgihandler.py

This wouldn't work with just changes to the apache configuration.
I had to edit the routes.py file like this and restart apache/web2py before 
this would work:

routes_in=(('/trunk/(?P.*)','/\g'),)
routes_out=(('/(?P.*)','/trunk/\g'),)

So now I am able to load both sites independently:
mydomain/admin
and 
mydomain/trunk/admin 
are two different installs of web2py.

(I don't like that I had to change the routes file to make this work but I 
can deal with that if that's how it works)

Now I've tried to export a simple test app from my main server and load it 
into the trunk web2py admin interface.
It eventually fails somewhere as it's confused between the two web2py 
installations.
If I just create a new simple app in the new subfolder version ( trunk ) it 
works fine.
But installing a packaged app doesn't work -- even a newly created simple 
app.

It looks like something in installing an application is broken if there is 
a route like this set up.
Is this possible or am I doing something wrong?

Thanks for any info

Larry

-- 





[web2py] Re: Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
some more info:
If I try to pack up a newly created app on the subfolder version, it fails 
with a ticket.
Internal errorTicket issued: 
unknown
If I click on the ticket link, it's linked to unknown in the main web2py 
install instead of the subfolder
 

-- 





[web2py] Re: Trunk trouble with routed subfolder

2012-06-24 Thread Larry Weinberg
Um, I may have solved my own problem.

In the https (443) section of the apache conf file I had a mistake:
I had
AliasMatch ^/trunk([^/]+)/static/(.*) 
/opt/web-apps/w2p_trunk/web2py/applications/$1/static/$2

instead of 

AliasMatch ^/trunk/([^/]+)/static/(.*) 
/opt/web-apps/w2p_trunk/web2py/applications/$1/static/$2

I'm not sure if that's what fixed it but it seems to be working now.

-- 





[web2py] Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
I am again running into occasional problems trying to run the trunk code 
from a subfolder instead of from a root folder under apache and mod_wsgi.

Maybe my problem is compounded because I also have another web2py installed 
at the root, but it seems that some of the internal web2py
functions are not working properly and are sometimes not obeying the route 
specifications.

I have a subdomain set up which has web2py 1.99 installed at the root of 
the domain.
   WSGIScriptAlias /  /opt/web-apps/web2py/wsgihandler.py
   WSGIScriptAlias /trunk /opt/web-apps/w2p_trunk/web2py/wsgihandler.py

I now have my routes.py file like this:

routes_in=(('/trunk/(?P.*)','/\g'),)
routes_out=(('/(?P.*)','/trunk/\g'),)

In general, most things seem to work.  The problems I am having:
1) Sometimes -- not always -- the links to tickets will link to the top 
level web2py install instead of the site under "trunk"
2) I cannot use or edit (without error) any python modules added to an 
application's modules folder. 
"Failed to reload module:  because no module named xxx.modules.test"

If I load the site using the internal rocket server there are no problems.



-- 





[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
More info:

I restart apache.  
Log in to admin in the subfolder version.  
Everything works properly.

Log in to admin in the top level version.   
Visit the admin of the lower level version. 
Sometimes errors occur.  Sometimes not.
Sometimes it makes me log in again sometimes not.
It appears that there is some kind of confusion between the sessions.


-- 





[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-25 Thread Larry Weinberg
This error is always repeatable:

The "Internal error" page always links incorrectly to the ticket.

It links back to the top site.
admin/default/ticket/up/10.102.67.127.2012-06-25.17-37-36.38cfaa82-a858-4e7b-9a69-9afc0fb3e7e7

If I visit the errors link normally I can see the error.

-- 





[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-27 Thread Larry Weinberg
Here is a summary of what I have found.
1 -- My inconsistent problems look like they were due to trying to run two 
different versions of web2py inside one WSGIProcessGroup or mod_wsgi.  This 
was probably a very bad idea on my part.  Needs to be done in separate 
virtual hosts with separate WSGIProcessGroups.  Fixing that fixed a number 
of my weird issues.

2 - It does look like web2py's  rewrite.py has a hardcoded href to /admin 
for the ticket html itself.  So this does look like a small problem in 
web2py trunk when trying to run it using urls underneath a subfolder.  Most 
else seems to works fine so far.



On Monday, June 25, 2012 5:40:08 PM UTC-7, Larry Weinberg wrote:
>
> This error is always repeatable:
>
> The "Internal error" page always links incorrectly to the ticket.
>
> It links back to the top site.
>
> admin/default/ticket/up/10.102.67.127.2012-06-25.17-37-36.38cfaa82-a858-4e7b-9a69-9afc0fb3e7e7
>
> If I visit the errors link normally I can see the error.
>
>

-- 





[web2py] Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
I'm a newbie to apache configuration, so I just spent hours trying to 
determine why none of the REST-api-with-authentication web2py examples 
were working for me. All worked fine without authentication.

It turns out the apache server with mod_wsgi strips the authorization out 
by default.
A one line sentence about this in the web2py manual would have left me with 
more hair!

Thanks for listening.


[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
In order to have the web2py examples work out of the box on Apache with 
mod_wsgi, an extra directive is needed in the Apache configuration for the 
VirtualHost

WSGIPassAuthorization On

This allows basic authentication to proceed through. 

It looks like there are some good reasons why mod_wsgi in apache strips 
authorization by default:
The link to the info is: 
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPassAuthorization





[web2py] Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
I have a function that returns JSON data.
It works great when called directly over https (using curl or pycurl).

If however I have a redirect somewhere that sends me to my web2py function 
it  returns html instead which requests a redirect from the caller.
I would like it to continue to deliver the JSON.  Is that possible or not 
allowed ?

It delivers something like this:



My Title


https://mysite/myapp/mycontroller/statecheck?state=84b148ce-8960-4393-a5a2-f6e92d6ff169";>




[web2py] Re: Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
Sorry.  Once again this had nothing to do with web2py.  I'll try and be 
more thorough next time I post.
It was the method of redirect that my redirect server was using that was 
causing the problem. urllib2 and pycurl both failed to handle meta redirect 
which is supposedly not preferred method these days.   When I switched it 
to use a simple location redirect  everything works great.


[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-28 Thread Larry Weinberg
Great!  Thanks Massimo.  I'm sure that will save some others some time!

[web2py] Creating Model extractor for Oracle and need some help/advice

2012-02-20 Thread Larry Schwerzler
 

I thought I had posted this about an hour ago but don't see it as a topic 
so I'll repost. Forgive if this is a duplicate. 


 I'm trying to build an Oracle version of the extract_mysql_models.py and 
extract_pgsql_models.py, these files look at a currently existing database 
and write out a web2py model definition for that database. I've got a 
legacy database with almost 800 tables some with almost 200 columns and 
there are changes with each new release of the software which is roughtly 
twice a year, so you could see my motivation for not creating the models by 
hand.


 I'm using the postgres version of the extract models script as my template 
and trying to swap out the pieces that are postgres specific with pieces 
that work with Oracle. I'm stuck on two parts, which I would greatly 
appreciate some help/advice on. 


 
   1. 
   
   The function “references” (extract_pgsql_models.py line 194 or so) is 
   confusing for me. I understand that it gets FK relationships but I'm not 
   sure which side of the relationship it gets and what it is ultimately 
   returning to the calling function. The main SQL looks like this: 
   
   rows1 = query(conn, """SELECT table_name, column_name, constraint_name, 
   update_rule, delete_rule, ordinal_position
   FROM information_schema.key_column_usage
   NATURAL JOIN information_schema.referential_constraints
   NATURAL JOIN information_schema.table_constraints
   WHERE information_schema.key_column_usage.table_name=%s
   AND information_schema.key_column_usage.column_name=%s
   AND information_schema.table_constraints.constraint_type='FOREIGN KEY' 
   ;""", table, field)
   
   What is this SQL returning? Why does the function fail if this returns 
   more then one reference? Does that mean I can't have a table that has two 
   FK references?
   2. 
   
   Secondly it is unclear to me how or if the script handles dependencies. 
   For example if I have a Unit table and in that table is a reference to a 
   location (one location many units) when the script is processing the unit 
   table will it check for (and create if needed) the location table so that 
   all dependent tables are created before a FK reference is made from a table?
   

 I'm open to other suggestions/tools. I was able to get sqlautocode to 
generate sqlalchemy models but in looking at the source it didn't seem 
straightforward to modify so that it output web2py models. 


 Any help is appreciated :)


[web2py] Parsing a list of items - how-to?

2012-02-22 Thread Larry Wapnitsky
Disclaimer:  I'm new to Web2py (2 days and loving it) and re-learning HTML 
after many years away from it.

I have a large text field on a form whose input will be a list of items 
entered by the user, separated by some sort of delimiter (most likely a 
newline).  Each valid line item will be entered into the database as its 
own entity.

How do I go about parsing this text box?  Everything I've seen so far talks 
about fields that come from/go to a database, but  this one doesn't do so 
directly.

Let me know if I need to clarify.

Thanks,
Larry


[web2py] Re: Recipe: How to set up web2py + ldap with Windows Active Directory

2012-02-22 Thread Larry Wapnitsky
Which page am I adding the second portion of code to? (web2py newbie here)

[web2py] Re: Parsing a list of items - how-to?

2012-02-23 Thread Larry Wapnitsky
Thanks to both of you.  I'll try these when I get to my office this 
morning.  Assume I'll be back with either good results or more questions :)



[web2py] Re: 1.99.4 Active Directory LDAP Issue

2012-02-23 Thread Larry Wapnitsky
Getting the same error and just updated from the git repository.

10.102.50.37.2012-02-23.07-46-58.25a3ba02-828a-41d8-ae1d-daf22ab847df
 'NoneType' object has no attribute 
'user_groups'


snippets from my db.py: (added to the original skeleton)

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

# all we need is login
auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username','profile']

# you don't have to remember me
auth.settings.remember_me_form = False

# ldap authentication and not save password on web2py
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
   server='server.domain.com',
   base_dn='dc=domain,dc=com')]



[web2py] multiple 'requires'

2012-02-23 Thread Larry Wapnitsky
I'm trying to use the following in my applications, but only one works at a 
time:

db.ips.ipaddress.requires = IS_NOT_IN_DB(db, 'ips.ipaddress')
db.ips.ipaddress.requires = IS_IPV4()

How can I get them both to process?

Thank you,
Larry


[web2py] inserting username into database

2012-02-23 Thread Larry Wapnitsky
(newbie disclaimer :))

I'm logging in to my application via AD/LDAP.  I can get the variable of 
the username with no issue.  What i need to do next is take this variable 
and insert it into a field in a CRUD form and have it show in my database.

Thanks,
Larry




[web2py] Validating data in a CRUD form before entering into the databse

2012-03-01 Thread Larry Wapnitsky
(please let me know if I need to clarify)

I have a form that I'm creating where a user can enter one line of data, 
multiple lines of data (each line being a different entry), and/or ranges 
of numbers.  I need the application to do the following before entering the 
data in the database:


   - Validate that all lines have valid data on them (most likely via RegEx)
   - If a range is entered, create a database record for each value in that 
   range

I'm still fairly new to web2py and am a bit confused on how to call such 
validation code.

Thanks,
Larry


Re: [web2py] Re: Validating data in a CRUD form before entering into the databse

2012-03-02 Thread Larry Wapnitsky
looks helpful.  adapting now. thanks.

On Fri, Mar 2, 2012 at 06:32, Wikus van de Merwe  wrote:

> I think the easiest is to add your validation code in the controller and
> then process
> the data after successful validation. I don't know how your data looks
> like but here
> is a simple example of a controller code with custom validation and db
> insert:
>
> def validate_add(form):
>   pattern = re.compile("[0-9a-z]+")
>   for line in form.vars.data:
> if not pattern.match(line):
>   form.errors.data = "only alphanumeric characters are accepted"
>
> def add():
>   form = SQLFORM.factory(
> Field("data", "text", label="names", comment="list of names (1 per
> line)"),
>   submit_button="Add to library")
>
>   if form.process(session=None, onvalidation=validate_add).accepted:
> for name in form.vars.data.split():
>   id = db.my_table.insert(name=name)
> redirect(URL("status"))
>
>   return {"form":form}
>


[web2py] forms.errors.data multiline?

2012-03-02 Thread Larry Wapnitsky
Is it possible to display a multiline error via forms.errors.data?  I'm 
parsing a list and want to show all invalid entries in the error message 
that flashes.

Thanks.


[web2py] more tutorials?

2012-03-05 Thread Larry Wapnitsky
So, I seem to be getting stuck a lot as I'm learning web2py, but I'm not 
finding the online documentation to be very thorough in answering my 
questions.  Additionally, as much as have enjoyed the assistance I've 
gotten from the newsgroup so far, the time delay on responses keeps me from 
working sometimes.

Are there any more detailed tutorials online related to web2py that go into 
more depth?  I do have the Cookbook on order for when it is released, but 
having information available at all times online would be beneficial. This 
is how I learned Python in the first place.

Thanks


Re: [web2py] more tutorials?

2012-03-05 Thread Larry Wapnitsky
And this link (http://www.web2py.com/books/default/reference/29/alterego)
no longer works, as does the one on redirecting, which is where i"m
seriously getting stuck.

On Mon, Mar 5, 2012 at 16:18, Larry Wapnitsky  wrote:

> So, I seem to be getting stuck a lot as I'm learning web2py, but I'm not
> finding the online documentation to be very thorough in answering my
> questions.  Additionally, as much as have enjoyed the assistance I've
> gotten from the newsgroup so far, the time delay on responses keeps me from
> working sometimes.
>
> Are there any more detailed tutorials online related to web2py that go
> into more depth?  I do have the Cookbook on order for when it is released,
> but having information available at all times online would be beneficial.
> This is how I learned Python in the first place.
>
> Thanks
>


[web2py] web2py and twisted

2012-03-07 Thread Larry Wapnitsky
doing some testing with twisted and web2py (proof of concept in between 
development swings), but can't get anyserver.py to run.  I'm getting the 
following:

root@python1:/var/www/web2py# python anyserver.py -s twisted -i 
10.102.42.10 -p 8000 -l
starting twisted on 10.102.42.10:8000...
Traceback (most recent call last):
  File "anyserver.py", line 299, in 
main()
  File "anyserver.py", line 295, in main

run(options.server,options.ip,options.port,logging=options.logging,profiler=options.profiler)
  File "anyserver.py", line 157, in run
getattr(Servers,servername)(application,(ip,int(port)))
  File "anyserver.py", line 110, in twisted
from twisted.web import server, wsgi
  File "/var/www/web2py/gluon/custom_import.py", line 293, in __call__
fromlist, level)
  File "/var/www/web2py/gluon/custom_import.py", line 78, in __call__
level)
  File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 30, 
in 
from twisted.web import iweb, http
  File "/var/www/web2py/gluon/custom_import.py", line 293, in __call__
fromlist, level)
  File "/var/www/web2py/gluon/custom_import.py", line 78, in __call__
level)
  File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 30, in 

from twisted.internet import interfaces, reactor, protocol, address
  File "/var/www/web2py/gluon/custom_import.py", line 293, in __call__
fromlist, level)
  File "/var/www/web2py/gluon/custom_import.py", line 78, in __call__
level)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/reactor.py", line 
37, in 
from twisted.internet import default
  File "/var/www/web2py/gluon/custom_import.py", line 271, in __call__
globals.get("__file__", ""))
  File "/usr/lib/python2.7/posixpath.py", line 66, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
root@python1:/var/www/web2py#


Ideas?


[web2py] Re: web2py recipe book

2012-03-13 Thread Larry Wapnitsky
Amazon just cancelled my order.  They apparently don't have any in stock on 
the day it was supposed to ship.  Guess i"m going directly to packt

On Monday, March 12, 2012 3:18:43 AM UTC-4, Massimo Di Pierro wrote:
>
> The web2py recipes book is finally out:
>
>
> http://www.packtpub.com/web2py-application-development-recipes-to-master-python-web-framework-cookbook/book
>
> Congratulations to all those who contributed.
>
> Massimo
>


[web2py] Re: routes for subdomains

2012-03-16 Thread Larry Wapnitsky
Massimo-

I'm still a little unclear on this.  I have a setup where web2py is a 
subfolder of  my public_html folder.  I have two domains, A and B.  I'd 
like for the following

sub1.ADomain.com to go to public_html/web2py/appA1/default/index
sub2.ADomain.com public_html/web2py/appA2/default/index
sub3.BDomain.org   public_html/web2py/appB3/default/index

I tried playing with the advice listed above and only wound up with 404s.

TIA

On Thursday, January 12, 2012 1:23:46 PM UTC-5, Carlos wrote:
>
> Thanks Jonathan and Massimo for your input !



[web2py] DAL validation issue

2012-03-20 Thread Larry Wapnitsky
I'm having an issue (in my first real web2py application) whereby I'm 
unable to validate DB data via the DAL without creating a duplicate entry.


I have the following code in my db.py:

db.define_table('ips',
Field('id', 'id'),
Field('ipaddress','string', length=15, unique=True),
Field('dateadded', 'datetime', writable=False, readable=False, 
default=request.now),
Field('reportedby', 'string', db.auth_user,  writable=False, 
readable=False, default=auth.user.username if auth.user else ''),
Field('updated', 'datetime', writable=False, readable=False, 
default=request.now),
Field('attacknotes', 'text'),
Field('b_or_w', 'string', length=1, 
widget=SQLFORM.widgets.radio.widget, requires=IS_IN_SET(['b','w']), 
default='b'),
migrate=False)

db.ips.ipaddress.requires = [IS_NOT_IN_DB(db, 'ips.ipaddress')]
db.ips.ipaddress.requires.append(IS_IPV4())


This is in my default.py:

def form_from_factory():
sample=''

form = SQLFORM.factory(Field('data', 'text', requires=IS_NOT_EMPTY()))

if form.process(session=None, onvalidation=validate_form).accepted:

session.data = form.vars.data.split()

x = '192.168.0.1'

db.ips.reportedby.default="formtest"
db.ips.dateadded.default=request.now
db.ips.updated.default=request.now

db.ips.ipaddress.requires = [IS_NOT_IN_DB(db, x)]

session.flash = x#'accepted'
redirect(URL('test'))
return dict(form=form)

I'm entering a list of IP addresses that get verified and, if valid, need 
to be input into the database.  With the test code you see above, I can 
create any number of entries that all have '192.168.0.1' even though I've 
specified the ipaddress in my DAL to be unique.

HELP!


[web2py] Two forms, one page

2012-03-20 Thread Larry Wapnitsky
I know it's possible to have multiple forms on one page, but is it possible 
to have one submit button that submits data based on both forms?

I have a SQLFORM field that takes multiple entries.

This is followed by a CRUD form based on the DAL (MySQL).

I'd like to parse the data in the SQLFORM (multiple, individual entries) 
and add them one by one as unique values to the DAL with the information in 
the CRUD portion (data common to all entries).

Is this possible?

Thanks.


[web2py] Customizing a widget

2012-03-27 Thread Larry Wapnitsky
Forgive my N00b-ness - not a web developer (but I've said that before)

I have the following code in an app I'm writing:

Field('b_or_w', 'string', length=1, widget=SQLFORM.widgets.radio.widget, 
requires=IS_IN_SET(['b','w']), default='b')

How do I customize this so that, instead of *b* and *w* appearing on my 
form, I can get *black* and *white*, but the former is what is entered into 
my database?

(clear as mud, right?)

Thanks,
Larry


[web2py] auth.requires(True,requires_login=False) does not work

2013-08-23 Thread Larry Weinberg
It seems that the requires_login option for @auth.requires() does not work. 
 Should it?
Is there another way to make this work for restful calls?  I want to 
implement a token based REST authentication

I get an invalid arguments message.  
If I use Basic Authentication alone it works fine 


Here is my controller:

auth.settings.allow_basic_login = True

# THIS ONE DOES NOT WORKS
@auth.requires(somethingIKnowIsTrue==True, requires_login=False)
@request.restful()
def thisOneDoesNOTWork():
def GET():   
return dict(yo="you got it")
return locals()

# THIS ONE WORKS
@auth.requires_login()
@request.restful()
def thisOneWorks():
def GET():   
return dict(yo="you got it")
return locals()

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: auth.requires(True,requires_login=False) does not work

2013-08-24 Thread Larry Weinberg
I figured it out.

I needed to add arguments to GET().  That's where the problem was coming 
from because I was sending in a value on the curl command.
I think it's working now.

Sorry for the noise.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] CAS provider and registration

2013-08-26 Thread Larry Weinberg
I've followed instructions elsewhere and set up a CAS provider application 
and a client application that uses the CAS service.
It looks like the registration options go away from the client app in this 
flow.

Once on the CAS provider login screen, I can navigate to registration 
choice, but when it's done it does not direct back to the client app.

If this a limitation inherent in the web2py flow? 

Is this being worked on?


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CAS provider and registration

2013-08-27 Thread Larry Weinberg
I'm using 2.5.1

Once I set up the client to use the CAS provider, the registration options 
go away on the client.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CAS provider and registration

2013-08-27 Thread Larry Weinberg
Thanks Massimo.  I will try that


On Tuesday, August 27, 2013 1:12:47 PM UTC-7, Massimo Di Pierro wrote:
>
> I believe this is fixed in trunk. You have to update web2py and the 
> views/default/users.html in your provider app.
>
> On Tuesday, 27 August 2013 09:33:45 UTC-5, Larry Weinberg wrote:
>>
>> I'm using 2.5.1
>>
>> Once I set up the client to use the CAS provider, the registration 
>> options go away on the client.
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CAS provider and registration

2013-08-28 Thread Larry Weinberg

It look like trunk gives the same results.

   - I create two new apps up casserve and casclient
   - In casclient I create auth with this:
  - auth = Auth(db,cas_provider = 
  'http://127.0.0.1:8000/casserve/default/user/cas')
   - I launch casclient/default/index and the login menu only shows login. 
No registration.
   - If I go to login it takes me to casserve.  There I can go to 
   registration in the menu but it does not take me back to casclient once I 
   log in. It takes me to casserve/default/index

What I would wish/expect would happen is one of:

   - Cas client would show both login and  register choices that would 
   redirect to casserve for login or registration and would return to 
   casclient when done
   
or

   - Cas client would show a single "login or register" choice which would 
   take me to casserve.  Once logged in or registered I would return to 
   casclient




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CAS provider and registration

2013-08-29 Thread Larry Weinberg
I can get the register to redirect as I wanted by adding this to the CAS 
server application's default controller index function:

   if session.service_arg:
redirect(session.service_arg)

The only thing missing then is the register button.  It should be 
relatively trivial to add that in.

I would think it would be nice to have this all work by default or add to 
the book's section on CAS.





-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Restful API with HTTPS and authentication

2013-09-16 Thread Larry Weinberg
I'm doing exactly that and not running into troubles.
Could it be something about your SSL certificate?  If it's not a well 
trusted certificate sometimes you need to install it on the client side.
Does it match the domain name you are calling?

I test my server with the following python code and I can use basic 
authentication with restful calls:

import requests
from   requests.auth import HTTPBasicAuth
import json

user  = 'myn...@my.com'
passwd = 'mypassword'
url= 'http://mysrver/app/controller/resfullcall.json'
r   = requests.get(url, auth=HTTPBasicAuth(user, passwd))
# print r.text

# Decode the JSON response and get the access token
decodedDict = json.loads(r.text)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: web2py_osx on Sierra (OSX 10.12)

2017-01-02 Thread Larry Weinberg
I see this happening too.  After allowing the app to run,  web2py stops 
working and the console errors look like this.  Is sqlite the problem?

error 11:49:43.484984 -0800 mtmd Can't trash .MobileBackups while MTM 
Snapshot Handler is running!
error 11:49:43.599957 -0800 com.apple.quicklook.ThumbnailsAgent getattrlist 
returned -1 Invalid argument
error 11:49:43.625833 -0800 geodMachServiceBridge 22.1 Asked to free space 
for a volume we don't control.
error 11:49:43.627489 -0800 com.apple.quicklook.ThumbnailsAgent SQLite[1]: 

error 11:49:43.627896 -0800 com.apple.quicklook.ThumbnailsAgent Sqlite 
request  failed on  with error []
error 11:49:44.285813 -0800 web2py Detected missing constraints for 
.  It cannot be placed because there are not enough constraints to 
fully define the size and origin. Add the missing constraints, or set 
translatesAutoresizingMaskIntoConstraints=YES and constraints will be 
generated for you. If this view is laid out manually on macOS 10.12 and 
later, you may choose to not call [super layout] from your override. Set a 
breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only 
be logged once.


On Saturday, December 31, 2016 at 6:54:08 AM UTC-8, Jared McFarland wrote:
>
> https://github.com/web2py/web2py/issues/1551
>
> On Saturday, November 26, 2016 at 5:18:46 AM UTC+1, Massimo Di Pierro 
> wrote:
>>
>> Thanks for reporting this. Do you mind opening a ticket?
>>
>> On Monday, 21 November 2016 09:42:54 UTC-6, Jared McFarland wrote:
>>>
>>> I've also run into this. I'm on macOS 10.12.1
>>>
>>> I downloaded the web2py app from 
>>> http://www.web2py.com/examples/static/web2py_osx.zip
>>>
>>> When I try to run it, I get the same web2py error dialog: 
>>> http://take.ms/IIXG5
>>>
>>> Here are the details from the console: http://take.ms/tTTgG
>>>
>>> "Detected missing constraints for .  It cannot be placed 
>>> because there are not enough constraints to fully define the size and 
>>> origin. Add the missing constraints, or set 
>>> translatesAutoresizingMaskIntoConstraints=YES and constraints will be 
>>> generated for you. If this view is laid out manually on macOS 10.12 and 
>>> later, you may choose to not call [super layout] from your override. Set a 
>>> breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only 
>>> be logged once."
>>>
>>>
>>>
>>> On Sunday, October 30, 2016 at 1:09:58 PM UTC+1, Scott Hunter wrote:

 I downloaded a fresh copy of the source version, ran it using the 
 default python in OS X, and all ran fine.

 I installed Anaconda python 2.7, ran the source version using it, and 
 all ran fine.

 However, I was able to run the OS X version by executing the 
 Content/MacOS/web2py executable inside of web2py.app via the command line.

 Then I tried executing that same OS X version by double-clicking the 
 app; it presented me with a different dialog: that it was from an unknown 
 developer, and would not open it.  But I could open it from the Security 
 panel of System Preferences, and it worked fine.

 I next tried to download the same .zip file from a different server (as 
 my ultimate goal is to distribute my appliance via such an executable). 
  That exhibited the problematic behavior that I have reported previously.

 Lastly, I re-downloaded the zipped-app from the web2py site; opening 
 that (via double-clicking) is now experiencing the behavior previously 
 reported.  But I *can* open it via the command line as described above. 
  And after doing so, it will open via double-click.

 So the "source" of the problem seems to have been trying to download 
 from a different server.  WHY that would cause a problem, I haven't a 
 clue. 
  But I could get around it by adding a script to open the execrable 
 directly.

 - Scott


 On Saturday, October 29, 2016 at 10:42:08 PM UTC-4, Massimo Di Pierro 
 wrote:
>
> I would recommend you download Anaconda python 2.7 and run python from 
> source
> http://web2py.com/examples/static/web2py_src.zip
>
> If it also fails, it may give more info.
>
> On Tuesday, 25 October 2016 11:55:32 UTC-5, Scott Hunter wrote:
>>
>> Sure, but there's not much to see.
>>
>> When I launch the app (after Safari, presumably, has unzipped it), I 
>> get:
>>
>>
>> 
>>
>> I click Open, and (after a little wait) am presented with:
>>
>>
>> 
>>
>> If there is something relevant in the Console, it isn't obvious to me.
>>
>> - Scott
>>
>>

[web2py] Re: Admin access on hostmonster account

2013-11-27 Thread Larry Wapnitsky
Over a year gone, I'm trying again, and still no luck.  At this point, I 
don't even get this error message anymore.  I just get a 500 error when 
trying to access the page.  I've also added in tips/tricks from:

https://groups.google.com/forum/#!searchin/web2py/hostmonster/web2py/h8uLiDCerx0/l5isz2ERWmcJ
and
https://groups.google.com/forum/#!searchin/web2py/hostgator/web2py/HvKqgkatK1E/0mFjGUYPjLYJ

with no luck.

My .htaccess looks like this:

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteBase /
RewriteRule ^web2py\.fcgi/ - [L]
RewriteRule ^(.*)$ web2py.fcgi/$1 [L]

My routes_in and routes_out are as follows:


routes_in = (('/web2py/(?P.*)','/\g'),
# do not reroute admin unless you want to disable it
(BASE + '/admin', '/admin/default/index'),
(BASE + '/admin/$anything', '/admin/$anything'),
# do not reroute appadmin unless you want to disable it
(BASE + '/$app/appadmin', '/$app/appadmin/index'),
(BASE + '/$app/appadmin/$anything', '/$app/appadmin/$anything'),
# do not reroute static files
(BASE + '/$app/static/$anything', '/$app/static/$anything'),
# reroute favicon and robots, use exable for lack of better choice
('/favicon.ico', '/examples/static/favicon.ico'),
('/robots.txt', '/examples/static/robots.txt'),
# do other stuff
((r'.*http://otherdomain\.com.* (?P.*)', r'/app/ctr\g')),
# remove the BASE prefix
(BASE + '/$anything', '/$anything'),
)

# routes_out, like routes_in translates URL paths created with the web2py 
URL()
# function in the same manner that route_in translates inbound URL paths.
#

routes_out = (('/(?P.*)','/web2py/\g'),
# do not reroute admin unless you want to disable it
('/admin/$anything', BASE + '/admin/$anything'),
# do not reroute appadmin unless you want to disable it
('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
# do not reroute static files
('/$app/static/$anything', BASE + '/$app/static/$anything'),
# do other stuff
    (r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
(r'/app(?P.*)', r'\g'),
# restore the BASE prefix
('/$anything', BASE + '/$anything'),
)

my access.py for the admin is at the latest default for the git pull.

Advice, please?


On Thursday, August 30, 2012 8:04:50 AM UTC-4, Larry Wapnitsky wrote:
>
> I'm receiving the following message when logging in to the admin interface 
> of web2py on my hostmonster account:
>
> Login requires a secure (HTTPS) connection or running on localhost.
>
> I've followed the instructions here:  
> http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi
>
> It appears that this:
>
> if request.env.http_x_forwarded_for \
> or request.env.wsgi_url_scheme in ['https', 'HTTPS'] \
> or request.env.https == 'on':
> session.secure()
> elif not remote_addr in hosts:
> raise HTTP(200, T('Admin is disabled because insecure channel'))
>
>
>
> has been changed to this:
>
> if request.env.http_x_forwarded_for or request.is_https:
> session.secure()
> elif not request.is_local and not DEMO_MODE:
> raise HTTP(200, T('Admin is disabled because insecure channel'))
>
>
> but commenting it out still does not help.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


  1   2   >