[web2py] Re: Skype Group and/or IRC

2011-06-08 Thread mattgorecki
What about on the web2py Facebook group?  I believe you can live chat
with all the online members of the group.

Matt

On Jun 8, 9:12 am, LarryEitel larrywei...@gmail.com wrote:
 Although I am not a regular user of IRC, I do have mIRC and
 occasionally pop into #web2py. However, when I do and invite dialog
 there is no response even though there are 20+ users on the same
 channel.

 I wonder if anyone would be interested in using a Skype Group for
 web2py. Or it could be some other arbitrary name. When I am in the
 thick I frequently wonder if there is a way to collaborate with others
 on the 'same page'.

 I have created and used a Skype Group in past and it works well.

 Comments?


[web2py] Re: How to start web2py server permanently

2011-06-07 Thread mattgorecki
If you are running Ubuntu (or using the Upstart init daemon) you can
create an Upstart conf file in /etc/init/ like so:

# tldisplayclient - start web2py web server
description start web2py web server
start on startup
exec sudo -u system user /usr/bin/python /opt/display/web2py.py -i
ip address -a password

Matt

On Jun 7, 12:18 am, Manuele Pesenti manuele.pese...@gmail.com wrote:
 On 07/06/2011 08:00, pradeesh narayan wrote:

  Thank you Rahul...
  Its worked fine.
  Thanks once again for your help.

 you got another chance 
 herehttp://www.web2py.com/book/default/chapter/11#Start-as-Linux-Daemon

         Manuele


[web2py] Re: How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread mattgorecki
In your db_action() controller, rather than doing a return() at the
end, you could just redirect like so:

redirect(request.env.http_referer)


On May 29, 2:46 pm, Luis Goncalves lgoncal...@gmail.com wrote:
 Hello All!

 There is a database action that I want to do in several views.

 Right now, I have it implemented as a link in each view as

      a href=db_action?id={{=item_id}}Toggle Status/a

 How do I get my db_action()  controller to return back to the page
 with the link that called it?

 Is there a way to cause the browser to do the equivalent of the back
 button?

 Something like:

      response.view = find_the_controller(request.env.http_referer)
      return dict()

 won't work because I'm not returning the proper dictionary for the
 referring controller.

 Maybe something like:

      dict_from_referring_controller =
 run_referring_controller( request.env.http_referer )
      # ? do I have to define the response view?
      return dict_from_referring_controller

 Perhaps the nicest/cleanest implementation would be with AJAX/JQuery,
 but I haven't learned that yet.

 Is there a way to do it with a href links?  Or is that super-bad
 form?

 Thanks!
 Luis.


[web2py] Re: {{=response.toolbar()}}

2011-05-29 Thread mattgorecki
Extremely useful.  Thanks.

On May 29, 6:16 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 This is in trunk. Give it a try:

 {{=response.toolbar()}}

 display request,response, session and db stats.


[web2py] Re: Create an email queing feature...

2011-05-27 Thread mattgorecki
What about using something like Sendgrid (http://sendgrid.com)? Or
Postmark (http://postmarkapp.com/)?

Let somebody else worry about throttling and blacklists and all of the
headaches of smtp servers.

Matt

On May 26, 10:50 pm, Jason Brower encomp...@gmail.com wrote:
 Yes, I practically have that now.  The issue is how do I create the cron
 task and script to execute it?
 One way I am taking this further is, as long as the conference is
 alive I can compair this list with who has signed into the conference
 to get an idea of how many people have reacted to the email and are now
 attending the conference. Like an RSVP list so to say. :)
 There is a lot of information actually, that I think I can gather from this.
 BR,
 Jason Brower
 On 05/27/2011 04:11 AM, ron_m wrote:







  A possible idea, each email insert into a table. When the cron job
  wakes up have it read X number of emails with the smallest ID value
  from the table and process them. Delete the row as each one is completed.


[web2py] Re: Help in documentation

2011-05-26 Thread mattgorecki
I was just wondering about this morning.  I'd love to help where I
can.

Matt

On May 26, 10:21 am, Vinicius Assef vinicius...@gmail.com wrote:
 I'd like to help keeping docs up to date.

 How can I do that?

 --
 Vinicius Assef.


[web2py] Re: ATTENTION trunk users!!!!

2011-05-25 Thread mattgorecki
I'm using MySQL and I just updated.  All of the *.table files updated
and the my app seems to be running okay so far.

Matt

On May 25, 7:32 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Did anybody try with mysql?

 Massimo

 On May 25, 7:09 pm, ron_m ron.mco...@gmail.com wrote:







  I added query = None after line 668 which is the line containing

  for key in keys:

  just before the line

  if not key in sql_fields_old:

  and got rid of all the query = None statements in the if elif branches plus
  got rid of the else branch.

  I am happy to report this allowed the application to run completely without
  error.

  I don't use all the features of web2py but then I am sure very few of us do.

  Ron


[web2py] Re: experimental in trunk...

2011-05-25 Thread mattgorecki
In order to do

from gluon import DAL

from an external program, I would need to add gluon to my Python path,
correct?  What directory does gluon live in?

Matt

On May 25, 7:43 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 now you can do, from ANY python program

 from gluon import DAL
 db=DAL('sqlite://storage.sqlite',folder='applications/app/
 databases',auto_import=True)
 print db.tables

 auto_import = True will rebuild all tables WITHOUT executing the
 modules. Tables will have the right names, field names and field types
 but will not have the right attributes (default, widget, readable,
 writable, etc...) because they make no sense without an HTTP request.
 This is only thought to allow a script to perform inserts and selects.

 CAVEAT: this requires you run the app at least once using the new
 trunk code since requires the new metadata format. By running the app
 the *.table files are automatically converted to the new format.

 Give it a try. Let me know if you have ideas for improvements.

 Massimo

 P.S. More stuff coming soon. ;-)


[web2py] Re: experimental in trunk...

2011-05-25 Thread mattgorecki
I've got a working DAL connection that I can SELECT from.  I'm running
into a problem with an update like so:

db(db.feed.id == f.id).update(last_update=now)

The row isn't updating and I'm not getting any errors.  db._lastsql
shows this: UPDATE feed SET last_update='2011-05-25 20:40:56' WHERE
(feed.id = 1);  Which updates just fine in the MySQL console.

Any suggestions?

Matt

On May 25, 8:21 pm, mart msenecal...@gmail.com wrote:
 if you want to be light weight, you could also make a copy of dal.py
 and put it anywhere it could be referenced, maybe same folder if you
 want.

 then you can simply have this import

 from dal import DAL
 from dal import Field

 or in a folder structure that can be seen as a package by your script

 then you would simply do

 from folder1.folder2.dal import DAL
 from folder1.folder2.dal import Field

 Mart :)

 On May 25, 10:09 pm, Bruno Rocha rochacbr...@gmail.com wrote:







  Cool feature! Thanks. I am now planning to use it for a task queue based in
  ActiveMQ.

  web2py tagline is really 'improvements on every two weeks, or less'
  --
  Bruno Rocha
  [ About me:http://zerp.ly/rochacbruno]

  On Wed, May 25, 2011 at 10:43 PM, Massimo Di Pierro 

  massimo.dipie...@gmail.com wrote:
   now you can do, from ANY python program

   from gluon import DAL
   db=DAL('sqlite://storage.sqlite',folder='applications/app/
   databases',auto_import=True)
   print db.tables

   auto_import = True will rebuild all tables WITHOUT executing the
   modules. Tables will have the right names, field names and field types
   but will not have the right attributes (default, widget, readable,
   writable, etc...) because they make no sense without an HTTP request.
   This is only thought to allow a script to perform inserts and selects.

   CAVEAT: this requires you run the app at least once using the new
   trunk code since requires the new metadata format. By running the app
   the *.table files are automatically converted to the new format.

   Give it a try. Let me know if you have ideas for improvements.

   Massimo

   P.S. More stuff coming soon. ;-)


[web2py] Re: experimental in trunk...

2011-05-25 Thread mattgorecki
Thank you, sir.  That works a bit better.

Matt

On May 25, 8:49 pm, Bruno Rocha rochacbr...@gmail.com wrote:
  Any suggestions?

  Matt

 Are you commiting?

 db.commit() is necessary when out of web2py env


[web2py] Re: experimental in trunk... common_fields and precints

2011-05-25 Thread mattgorecki
So in this example request_precinct would equal harvard.anyschool.org?

Matt

On May 25, 9:47 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 There are two more features in trunk that I could use some testing
 with (common fields and precints)

 Imagine you have created an app school designed to manage one
 school. It has one database and many tables. You wrote it with one
 school in mind. Now you want to turn it into a service so that
 multiple schools can register and use it. You want to identify the
 school for example by the urlhttp://harvard.anyschool.organd each
 school should ONLY see its own users, groups, records, etc. etc.

 Before today to do this you would have to rewrite all your tables and
 queries.

 Today you can do it without changing your code at all. You just have
 to add this line after db=DAL(...)

 db._common_fields=[Field('request_precinct',default=request.env.http_host,writable=False,readable=False)]

 Yes. That is it!

 How does it work?

 1) db._common_fields is a list of fields that you want to add to all
 tables.
 2) The field called 'request_precinct' is special. Every query
 involving a table having this field is automatically filtered byfield
 value == field default. In our example the default is
 request.env.http_host, i.e. the hostname in the http request which
 identifies the school.
 3) The field is hidden (writable=False,readable=False) but has a
 default therefore it is automatically set for all inserts.

 There is nothing special about schools here. You can use it with any
 other app.

 Give it a try and let me know.

 I could use some help in writing some documentation about the new
 features added today. ;-)

 Massimo


[web2py] Re: develop iphone apps with web2py with this plugin

2011-05-16 Thread mattgorecki
I started building mobile views using jQuery Mobile just a few days
before you released this.  For the most part we did the same things,
but I have a bit of code that in models/0.py that checks for a mobile
user agent and adjusts the view accordingly.  This way I can use the
same controller for both the regular view and the mobile view.  The
normal view would be at index.html and the mobile view at
index.mobile.html.

You'll need mobile.sniffer and PyWURFL modules for this to work.

Here's the code: https://gist.github.com/974920

Matt Gorecki

On May 14, 11:52 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I find that designing the app formobilefirst forces to keep
 navigation simple and that is good.

 On May 14, 10:23 pm, Jason Brower encomp...@gmail.com wrote:







  On 05/14/2011 11:57 PM, Massimo Di Pierro 
  wrote:http://web2py.com/plugins/plugin_jqmobile/about

   Please send us comments and suggestions

  Excited to give it a try in some of my apps. Though I should probably
  complete the apps first for normal browsers. :D
  BR,
  Jason Brower


[web2py] Re: Insert blank record crashes in sqlite

2011-05-11 Thread mattgorecki
I'm not able to find anything SQLite specific, but this is what the
MySQL docs say about empty rows:

If both the column list and the VALUES list are empty, INSERT creates
a row with each column set to its default value:
INSERT INTO tbl_name () VALUES();
In strict mode, an error occurs if any column doesn't have a default
value. Otherwise, MySQL uses the implicit default value for any column
that does not have an explicitly defined default.

Matt


On May 11, 6:50 pm, Jim Karsten iiijjj...@gmail.com wrote:
 I use the following line in a controller to add a blank record.

 record_id = db.mytable.insert()

 This works fine using MySQL but crashes with sqlite. The error is:

 File /root/staging/1.94.5/web2py/gluon/dal.py, line 4344, in insert
   return self._db._adapter.insert(self,self._listify(fields))
 File /root/staging/1.94.5/web2py/gluon/dal.py, line 763, in insert
   raise e
 OperationalError: near ): syntax error

 The SQL is:   INSERT INTO mytable() VALUES ();

 I get a similar error in the sqlite console but it works fine in MySQL

 sqlite INSERT INTO mytable() VALUES ();
 Error: near ): syntax error

 Not sure if this is a bug or not. Some dal methods produce an syntax error
 if no fields are provided.

     db(db.mytable.id == 1).update()
     SyntaxError: No fields to update

 Should insert() without fields be a syntax error?

 Regards,
 Jim Karsten


[web2py] Re: Web2py and message queue's

2011-05-09 Thread mattgorecki
Instead of using a database table as an intermediary you should take a
look at using an actual message queue.  I'm personally using
BeanstalkD with the BeanstalkC python module.

When a new message is created, you could create a bit of JSON that
contains the message and the list of recipients.  Then you would have
a python worker process script that would wait for new messages and it
would take care of actually sending the email/sms.

http://kr.github.com/beanstalkd
https://github.com/earl/beanstalkc

Matt

On May 9, 6:13 am, villas villa...@gmail.com wrote:
 I once set something up with this kind of functionality.  Simplified
 concept was:

 1. Two tables, e.g.:
   Messages: subject, body
   MessQueue: to_id, from_id, message_id, dest, stat, sent_on
     note: dest is either an email address or mobile tel no.

 2. A message is created and multiple recipients chosen. For each
 recipient an entry is made in the messqueue table.

 3. A background script (outside web2py) polls the messqueue and sends
 message via email or text message. Result is stored in stat field.

 4. In addition to receiving the messages via email/text, each user can
 see a list of their messages when they log on.

 On May 8, 10:22 pm, Pystar aitoehi...@gmail.com wrote:







  Hi all,
  In the app I am developing I want to include messaging which would
  allow users to send messages to single users or make a broadcast to
  multiple users. I have a database for the messages which for now would
  only be simple text, no video or pictures. I would like to know the
  best way I can go about implementing this. For now, this is how I
  think it should work, the user composes the message and sends it, the
  message is inserted into the messages table of the sender and also
  inserted into the messages table of the recipient/recipients.
  I have some misgivings about this, because if the number of recipients
  are very many, that means alot of INSERTS would be done which might
  bog down my server. I have been thinking about using a MESSAGE QUEUE
  for this.

  I need advice/tips. I am stuck


[web2py] Re: How should I present the content?

2011-05-08 Thread mattgorecki
RRDTools generates static images so HTML and CSS would work just fine
to start.

Matt

On May 8, 2:37 pm, Leon Chop l...@datadesign.se wrote:
 Hello,
 Thanks for advice pbreit! I would like to use rrdtools but do not know
 if it's possible only with HTML5/CSS5. But true as you said, KIS and
 see how far I get thanks!
 regards
 Leon

 On 8 maj 2011 18:41 pbreit pbreitenb...@gmail.compbreitenb...@gmail.com 
 wrote:
  Keep it simple. Start with HTML and CSS and see how far you get. Then
  consider layering in JavaScript and Jquery. For charting, you either
  need to generate the images in Web2py and server them as GF.JPG/etc or
  use a Javascript-based charting library
  (ex: http://www.reynoldsftw.com/2009/02/6-jquery-chart-plugins-reviewe
  d/).


[web2py] Re: How do you manage/version you applications and web2py core?

2011-05-02 Thread mattgorecki
You're right.  This is how I do it.  I use github extensively for my
apps and as long as the application directory is the root of the git
repository you won't run into any conflicts.

On May 2, 9:25 am, pbreit pbreitenb...@gmail.com wrote:
 I'm not even sure you need to .hgignore your app since you will never be
 pushing web2py. I don't.


[web2py] Re: Should I work for free? Funny

2011-01-14 Thread mattgorecki
I like that it was all done with CSS.  No images in sight.


[web2py] Re: web2py-related thread at reddit

2011-01-06 Thread mattgorecki

 Sadly, there is a cadre of redditors who simply reflexively downvote any
 post or comment that is remotely positive about web2py (usually without
 making any response).

Reddit itself adds downvotes to all posts.  Why this is, I don't know,
but it's more than likely not malicious.