On Fri, Oct 30, 2009 at 10:27 AM, mdipierro <mdipie...@cs.depaul.edu> wrote:

>
> yes but in the shell remember to do
>
> db.commit()
>
> else your transaction may lock the web app and if it locks for too
> long it is no good.
>

.... really, really no good on a production, live, running system;  less of
a concern on your own computer / laptop on a development version.

Nevertheless, the point is to get in the habit (just as you would hit "save"
often in an editor!) to either:

db.commit()

often, or exit the shell often - getting back in only when you need to do
something.



>
> On Oct 30, 10:06 am, Yarko Tymciurak <resultsinsoftw...@gmail.com>
> wrote:
> > On Fri, Oct 30, 2009 at 9:59 AM, Nick Jennings <nkj...@gmail.com> wrote:
> >
> > > When I do that I get the ipython console and the actual web2py server
> > > does not start.
> >
> > Nick -
> >
> > Just to clarify for you, there is nothing wrong with having TWO command
> > lines running simultaneously:  a server, AND a command line next to it;
> > I actually do this more frequently than you would think - changing /
> adding
> > data or changing code affects the other (well, in the command line shell,
> > you have to either exit it frequently, OR you have to consciously and
> > manually do db.commit()'s).
> >
> > Hope this is useful.
> >
> > - Yarko
> >
> >
> >
> > > On Oct 30, 3:45 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > You need to specify  an appname
> >
> > > > python web2py.py -S appaname -M
> >
> > > > On Oct 30, 9:06 am, Nick Jennings <nkj...@gmail.com> wrote:
> >
> > > > > Oh thats cool! So I started up the web2py server with the -M
> module:
> >
> > > > > python web2py.pl -M
> >
> > > > > Then when I went to the python shell I could mess with my db
> objects:
> >
> > > > > In[2]:
> > > > > post = db(db.post.id==1).select()[0]
> >
> > > > > Out[2]:
> >
> > > > > In[3]:
> > > > > print post.body
> >
> > > > > Out[3]:
> > > > > <p>dfsdf s<strong>df sd sdghjf</strong>ghjfgjh fs</p>
> > > > > <p>kk</p>
> > > > > <p>'</p>
> > > > > <p>k<em>k;</em>'</p>
> > > > > <p>k<strong>'</strong></p>
> > > > > <p><strong>;;'</strong></p>
> > > > > <p>jklkl;lhj<strong>jfghjkfhkfhjkfhjkfhjkfhjkfhjkfh</strong></p>
> >
> > > > > Thanks for the tip Yarko, is it a bug that the -M is needed? or
> should
> > > > > -M always be specified (assuming you plan on using the web-console)
> ?
> > > > > -Nick
> >
> > > > > On Oct 30, 2:46 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com>
> > > > > wrote:
> >
> > > > > > On Fri, Oct 30, 2009 at 7:16 AM, Nick Jennings <nkj...@gmail.com
> >
> > > wrote:
> >
> > > > > > > I'm very new to python, and not sure how to use the python
> console.
> >
> > > > > > Thanks for reporting this - it looks like the web-based shell is
> > > failing at
> > > > > > this (at least in the latest version on launchpad).
> >
> > > > > > Try the command line shell for now:
> >
> > > > > > $ python web2py.py -S my_app -M
> >
> > > > > > The  "-M" part will ensure that your models (and so your database
> > > tables)
> > > > > > are defined for the console.
> > > > > > You might also like having ipython (interactive Python)
> installed, as
> > > if it
> > > > > > is, it will be used (and, among other
> > > > > > things, you will have code completion available to you - by using
> the
> > > TAB
> > > > > > key).
> >
> > > > > > > when i bring it up, and try to do anything i get errors i don't
> > > > > > > understand. I tried to create a post var with:
> > > > > > > post = db(db.post.id==1).select()[0]
> > > > > > > which did not work.
> >
> > > > > > > clearly im missing something fundamental here, and would
> appreciate
> > > > > > > any guidance with how to properly use the python console.
> thanks in
> > > > > > > advance!
> > > > > > > -nick
> >
> > > > > > > On Oct 30, 3:36 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > > > > > Can you print to console the post.body? perhpas it is stored
> > > escaped
> > > > > > > > for some reason.
> >
> > > > > > > > On Oct 29, 8:33 pm, Nick Jennings <nkj...@gmail.com> wrote:
> >
> > > > > > > > > Hello All,
> >
> > > > > > > > >  I'm writing a simple blog and using tinyMCE for text
> > > formatting.
> > > > > > > > > Saving it to the database works fine, but when I try to
> view
> > > it, the
> > > > > > > > > XHTML is escaped. In the book it says I can use the XML
> > > function to
> > > > > > > > > specify I do not want the content escaped. In my simple
> blog,
> >
> > > > > > > > > In the default/show.html I put:
> >
> > > > > > > > > {{=XML(post.body, sanitize=True)}}
> >
> > > > > > > > >  But it doesn't seem to make any difference, all the
> formatting
> > > > > > > > > characters come out escaped, and showing up in the output.
> >
> > > > > > > > > Any help would be great!
> > > > > > > > > Thanks,
> > > > > > > > > -Nick
> >
> >
> >
>

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

Reply via email to