Re: Call method of the session template

2013-10-10 Thread Bill Freeman
The remove method requires an argument. You're not supplying one (you can't in a template variable reference). On Thu, Oct 10, 2013 at 1:29 PM, Ricardo wrote: > Hi, I'm using django carton to shopping cart. > I am not able to call the method remove_single in my template. on line 15 > I tried s

Re: Call method of the session template

2013-10-10 Thread Bill Freeman
d block tag: ''item.remove_single'', expected > 'empty' ou 'endfor' " > > Ricardo > > > 2013/10/10 Bill Freeman > >> The remove method requires an argument. You're not supplying one (you >> can't in a templa

Re: How do I correctly encode filenames for use in https-response "content-disposition" header?

2013-10-11 Thread Bill Freeman
Not sure, but perhaps you need quotes around the file name to avoid having the user agent terminate the filename on space? E.g.; ..."attachement; filename=" + '"' + rep_setup..+ '.xlsx"' On Fri, Oct 11, 2013 at 6:27 AM, DJ-Tom wrote: > Hi, > > I'm serving files via HttpResponse and cur

Re: New to Django cannot figure URLpatterns

2013-10-15 Thread Bill Freeman
ary to the url pattern that you quoted. That would only match titles that were composed entirely of digits. Be sure which one is there. You may actually want \w, or even [^/]. Bill On Tue, Oct 15, 2013 at 4:38 AM, Tom Evans wrote: > On Mon, Oct 14, 2013 at 11:58 PM, Mark Strickland >

Re: django cron job - stops after reading some portion of huge file - why is this?

2013-10-15 Thread Bill Freeman
s = f.read(1024*1024) n += len(s) print n print 'done' That should work. If not, does your O/S not correctly handle files that big? Bill On Tue, Oct 15, 2013 at 6:55 AM, doniyor wrote: > I am reading file from url and parsing it and saving some infor

Re: django cron job - stops after reading some portion of huge file - why is this?

2013-10-15 Thread Bill Freeman
e given. >> >> Can you, in python, read through the file, doing nothing with the data? >> E.g.: >> >> f = open('your/file/path/here') >> n = 0 >> s = True >> while s: >> s = f.read(1024*1024) >> n += le

Re: Django data to Javascript

2013-10-15 Thread Bill Freeman
I'd probably put the script tag outside the for loop. But I don't see where you're passing should_have_found_list to the context. If it's an item (top level) in form.field_mapping, then it needs to be something like: ... {% for shbr in form.field_mapping.should_have_found_list %} ... I d

Re: Django data to Javascript

2013-10-16 Thread Bill Freeman
On Wed, Oct 16, 2013 at 3:39 AM, drakko wrote: > ... > > But accessing should_have_found_list in template has no problems. I have > separate JS file that contains functions (event handlers for buttons etc.). > I can't figure out (total newbie in JS :D ) how to access (or pass) > should_have_fou

Re: DJANGO and SOAP

2013-10-16 Thread Bill Freeman
It is possible to use urllib2 to deal with headers and use lxml to create/parse bodies. More work, and no automatic WSDL processing, but fully general. I've had to go that way when the vendor on the other end did some not strictly legal SOAP things. ZSI used to be a good SOAP choice, but has sor

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
The file you want (assuming that your shell is bash) is .bashrc because it is run every time a bash shell is started, even if it is not a login shell. Note, however, that settings that shouldn't be done multiple times, such as appending ":$HOME/bin" to the PATH, should be protected with an if so t

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
If the program mysql_config is installed on your box, it may be installed in a directory that is not on your path. If you can find it on your box (try the locate and find commands), you can add the directory to your PATH by hand before running pip (or easy_install). It only needs to be there for

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
essed your comment correctly, is there a good, basic tutorial > on {guard variables}, as well as the larger schema into which they fit? > Preferably one that *does* assume intelligence, but does *not* assume a lot > of existing knowledge on the part of the user? > > > Whatever the case, th

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
lled, but the damn server can't see it. > > I've switched it to a sqlite database for now, but this is pissing me > off... > > > On Wed, Oct 16, 2013 at 11:22 AM, Bill Freeman wrote: > >> If the program mysql_config is installed on your box, it may be installed >

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
nificant user of this > computer. Cheers! > > > On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman wrote: > >> What I mean by "I don't know about sourceing virtualenvwrapper.sh" is >> that I don't know, and don't have the inclination to research, whether, >

Re: Doing the basic tutorial, MySQL-python problems.

2013-10-16 Thread Bill Freeman
QL-Python, which I can't tell > if that's the same package or something entirely different... I'm drowning > in new software and concepts at the moment. Argh. > > > On Wed, Oct 16, 2013 at 11:49 AM, Bill Freeman wrote: > >> If it's like PostgreSQL, it should

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Bill Freeman
monstrable reason to do > so. > > I'm kinda suspicious of virtualenv in the first place because of this, but > the sales pitch by that nice young man, Simeon Whatsisname, convinced me > that it was a good idea to get a handle on it. > > > On Wed, Oct 16, 2013 at 12:51 PM, Bill

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-17 Thread Bill Freeman
t;> Installing pip...done. >> >> Activate the env: >> >> $ . testenv/bin/activate >> (testenv)$ >> >> Note that the prompt changed and is now pre-pended by the env name. >> >> Deactivate the env: >> >> (testenv)$ deacti

Re: How to handle values_list?

2013-10-17 Thread Bill Freeman
Try: {{ name.0.name }} On Thu, Oct 17, 2013 at 2:30 PM, Andrew Michael wrote: > Hi, > > I am new to Django and need some help. My issue is on my web page the data > is showing up like this: [u'Green'] and I want it to only show Green - > without the unicode wrapping. Can you please explain

Re: How do you apply a decorator to all views in a views.py file?

2011-05-10 Thread Bill Freeman
igure out how the development server returns stack traces (and I'll bet that it's a piece of exception middleware) and plug in there. Bill On Tue, May 10, 2011 at 3:50 PM, Shawn Milochik wrote: > I have a decorator I'd like to apply to every view in a given views.py file. > Is t

Re: abstact model base class field override

2011-05-24 Thread Bill Freeman
better to RY (repeat yourself). Or, depending on what you're doing, a one to one relationship may be a better choice. Good luck. Form classes, by the way, have similar, though seemingly less severe, issues. Bill On Thu, May 19, 2011 at 7:21 PM, Valya Golev wrote: > Hi, > > C

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
ere me, I'd probably be using a foreign key reference from Verb to Word, rather than sub-classing. Bill On Wed, Jun 22, 2011 at 9:45 PM, Matt Gardner wrote: > Hello all, > > I have a model hierarchy in my django app, and there is one very > important task that I do not know how

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
uot;record" and a Verb instance "record", do they share any data (such that if you change it in one it is changed in the other) or do they just have duplicate copies of some data? Bill On Thu, Jun 23, 2011 at 11:36 AM, Matthew Gardner wrote: > Thanks, Bill, for your comments. &g

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
eads - you may need to play with transactions and roll backs. And, of course, things could change in a future version even if this works now. Good luck, Bill On Thu, Jun 23, 2011 at 2:22 PM, Matthew Gardner wrote: > On Thu, Jun 23, 2011 at 2:18 PM, Matthew Gardner wrote: >> >> cla

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-24 Thread Bill Freeman
Verb could refer to the same Word. But you know your needs. Bill On Thu, Jun 23, 2011 at 8:44 PM, Matthew Gardner wrote: > Thanks for your input, Bill, I appreciate it.  I think I'm just going to > take a hit and switch to an explicit OneToOneField instead of trying to make

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-24 Thread Bill Freeman
Sorry. I'd been thinking in terms of a not null constraint and confusing myself that it would apply in both directions. Bill On Fri, Jun 24, 2011 at 10:25 AM, Tom Evans wrote: > On Fri, Jun 24, 2011 at 3:15 PM, Bill Freeman wrote: >> So long as it *IS* one to one.  I.e.; there

Re: unable to import Modules Present in subdirectores

2011-06-29 Thread Bill Freeman
cannot import a module named "Views.py" using the name "views", as in "polls.views". You would have to use, for example, "polls.View". If the name of the package is "Polls" then you would have to use "Polls.Views". Bill On Wed, Jun

Re: Deferred fields

2011-06-30 Thread Bill Freeman
Use a property in combination with an ordinary null=True field. Always access it (from python or template code) via the property. On Thu, Jun 30, 2011 at 4:13 PM, Ori wrote: > Hi, > > I'd like to defer calculating a value for a particular field until the > value is required. > > Suppose I have t

Re: virtualenv with dev server

2011-07-14 Thread Bill Freeman
you give to manage.bat on along to: \path\to\virtual\environment\bin\python.exe manage.py %something_that_gets_args% Then, with this on you path, you can just say "manage runserver". But, as I say, I don't really do Windows, and I'm assuming that .bat files work like they used to,

Re: django form radio input layout

2011-07-14 Thread Bill Freeman
g that is likely to change out from under you. (Though adding a suitable iterator method on Choice/MultiChoice Fields to the API would not be unwelcome.) Bill On Thu, Jul 14, 2011 at 3:10 PM, NateB wrote: > > > CrabbyPete wrote: >> >> I am trying to do the same thing. Did you

Re: How to configure pgAdminIII

2011-07-15 Thread Bill Freeman
The information that you need to fill in this form is the same information that you used to configure the DB connection in setings.py. The "name" is arbitrary, something you can use to identify which DB you want to administer when pgAdmin knows about several. 5432 is the default PostgreSQL port, u

Re: auto_now, auto_now add -- good or bad?

2011-07-15 Thread Bill Freeman
mplement his own is a little like saying that you should implement your own encryption scheme instead of using an available implementation - you have a good chance at getting it wrong. Bugs happen, and they get noticed and fixed. The prior existence of a bug is not a good justification to avoid th

Re: Django + PyPy = ?

2011-07-25 Thread Bill Freeman
Get PyPy running properly first? You second example still has the error message, even before python's banner is printed. That's not related to Django at all, I'll bet. Best to find a PyPy FAQ, mailing list, or IRC channel on which to ask. Bill On Fri, Jul 22, 2011 at 6:40 PM,

Re: Django + PyPy = ?

2011-07-25 Thread Bill Freeman
It still doesn't seem like a Django issue, but a pypy issue. You need to be able to run stuff from other than the pypy-dist/bin directory for pypy to be useful. One possibility is that you are actually getting a different pypy executable. Say (on *nix) "which pypy" from one of those other direct

Re: Django + PyPy = ?

2011-07-28 Thread Bill Freeman
r name.) BTW, I'm not sure, but I don't expect that mod_wsgi would be willing to run you using pypy. Bill On Wed, Jul 27, 2011 at 4:34 PM, Dmitry Pisklov wrote: > That's basically the information I'm trying to find. PyPy docs says nothing > about that, and they doesn'

Re: Django + PyPy = ?

2011-07-29 Thread Bill Freeman
les by hand using pypy. But before you go to far, find one simple package that you have installed, something without a lot of dependencies, in your python, that you can't import from the pypy prompt, and see what it takes to install that for pypy. Bill On Fri, Jul 29, 2011 at 1:37 PM, Dmit

Re: tar xzvf Django-1.3.tar.gz

2011-07-30 Thread Bill Liao
Hello, Technical Writer, 7zip can uncompress this kind of file. wishing to see your book. regards wliao On Sat, Jul 30, 2011 at 9:33 PM, Stuart wrote: > Those commands assume you are using linux. There is more information > for Windows users over here: > https://docs.djangoproject.com/

Re: Django + PyPy = ?

2011-08-02 Thread Bill Freeman
See if there is a .pth file somehow made pypy specific in /home/wsgi/pypy-1.5/site-packages or /home/wsgi/pypy-1.5 that mentions the PIL package but nothing else. On Tue, Aug 2, 2011 at 1:19 PM, Dmitry Pisklov wrote: > Well... > > $ /home/wsgi/pypy-1.5/bin/pypy > Python 2.7.1 (b590cf6de419, Apr 3

Re: I've upgraded python from 2.5 to 2.7 do I need to reinstall django?

2011-08-05 Thread Bill Freeman
s probably best to remove them and let 2.7 build its own. 2.7, IIRC, comes with sqlite, but if you are using, say, psycopg2 or mysql, you will probably need to install the python packages for that as well. The underlying lib files and DB installation should be fine as they are. Bill On Fri, Aug 5,

Re: "Great circle" using the django ORM?

2011-08-11 Thread Bill Freeman
Only on a flat earth of radius 1 radian. Henrik is correct on a spherical earth (which I find close enough). On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco wrote: > The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) ) > > Le 11 août 2011 17:09, "Thomas Weholt" a écrit : >> I got a model

Re: "Great circle" using the django ORM?

2011-08-11 Thread Bill Freeman
gt; > Le 11 août 2011 19:55, "Bill Freeman" a écrit : >> Only on a flat earth of radius 1 radian. Henrik is correct on a >> spherical earth (which I >> find close enough). >> >> On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco >> wrote: >>>

Re: "Great circle" using the django ORM?

2011-08-12 Thread Bill Freeman
o it doesn't have to be dead on. But this should really be a >>> reusable app or widget. Seems like more than just me needs this >>> functionality. If I get something going I'll look into making it >>> generic and reusable. Anybody interesting in helping out makin

Re: English translation for error message?

2010-12-21 Thread Bill Freeman
On Tue, Dec 21, 2010 at 5:53 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > [jhayw...@cmlnxbld01 invdb]$ python manage.py shell > Python 2.7 (r27:82500, Dec 2 2010, 14:06:29) > [GCC 4.2.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > (

Re: How to verify the content-type & charset of uploaded file?

2010-12-27 Thread Bill Freeman
canner about it. (F-prot, I believe, is one that is available for *nix.) As far as I know, it's probably at least as hard as you originally thought. At least, I don't know of any shortcuts. Bill On Sat, Dec 25, 2010 at 11:31 PM, Andy wrote: > In the doc (http://docs.djangopr

Re: Django - Verfication of runserver vs browser

2011-01-24 Thread Bill Freeman
It is also possible that you have firewall settings that prevent you from accessing the box. Bill On Mon, Jan 24, 2011 at 1:21 AM, Shawn Milochik wrote: > If you've been messing around quite a bit trying to fix other issues, the > port may be held up by a zombie process or something.

Re: copying sqlite database file between projects

2011-01-25 Thread Bill Freeman
h checking.) Does the settings.py configuration give an absolute path or relative path including "../some_dir/..." that doesn't work in the new context? Bill On Tue, Jan 25, 2011 at 10:36 AM, Ben Dembroski wrote: > Hi all, > > Afraid I've got another newbie question.  

Re: account errors when create superuser on cygwin

2011-01-27 Thread Bill Freeman
I'm not sure whether this is your problem, but file permissions can be fussy with Windows. You might try going into the manage.py shell and trying to open the file with python's open builtin, e.g., if the database file already exists: f = open('path_to/db_file') or if it doesn't: f = op

Re: need help with images

2011-01-27 Thread Bill Freeman
hether you are using the development server, or are, for example, running under mod_wsgi behind, say, apache. So, we need more information in order to help you. Bill On Thu, Jan 27, 2011 at 4:03 PM, nicolas lubkov wrote: > hello im having a terrible time just showing images in my web. i ca

Re: account errors when create superuser on cygwin

2011-01-28 Thread Bill Freeman
Did you create a superuser when you originally ran syncdb? If so, you can work around the problem in the admin, logged in as that original superuser, making additional superuser through the web. Have you tried logging in as the "jack" user? The fact that the name is now already taken implies tha

Re: How can I show a list of values in a text input field?

2011-02-07 Thread Bill Freeman
at you want if you pass the related object manager to the template, but it is a bit hairy for a template, so I'd suggest having your view function calculate the desire value string for the input, and pass that instead. When you parse the posted value, you will still need to look up the object

Re: cannot login to admin site using admin credentials

2011-02-09 Thread Bill Freeman
You *might* need to drop all the auth_xxx tables, syncdb, and try again. Just a thought, since you've already broken the schema. But you might want to capture a dump of the database before you do stuff like this. Bill 2011/2/8 xpanta : > I tried deleting auth_user in order to force mana

Re: PDF response using wkhtmltopdf.

2011-02-17 Thread Bill Freeman
Popen documentation, I'm sure, probably with examples. Bill On Wed, Feb 16, 2011 at 2:02 PM, juanefren wrote: > I am using wkhtmltopdf to create PDF files, how ever I don't know how > to return them properly, docs says using a single dash instead of > output file name wil

Re: Django & Postgres explicit SQL parameters escape

2011-02-21 Thread Bill Freeman
that any embedded quotes are escaped, etc. It is also possible to use named parameters and pass a dictionary. At one point this was broken in the SQLite back end, but has probably been fixed by now. I know from personal experience that it works with the PostgreSQL back end. Bill On Mon, Feb 21,

Re: How to format django template code nicely with notepad++?

2011-02-22 Thread Bill Freeman
looks like one step. On Tue, Feb 22, 2011 at 10:20 AM, Bill Freeman wrote: > You *could* use Tidy, then post process with a sed script to convert > the '%20's to spaces. > > There may be comparable Windows tool, but if you want sed, you can > install Cygwin. > > But i

Re: How to format django template code nicely with notepad++?

2011-02-22 Thread Bill Freeman
You *could* use Tidy, then post process with a sed script to convert the '%20's to spaces. There may be comparable Windows tool, but if you want sed, you can install Cygwin. But if you install Cygwin, you could edit with vim. Since you're editing templates, you probably have python installed. If

Re: How to format django template code nicely with notepad++?

2011-02-22 Thread Bill Freeman
ll >> just do what i do in notepad++ then format it in vim. i'll keep >> looking around for a nice formatter though. >> >> On Feb 22, 5:20 pm, Bill Freeman wrote: >> > You *could* use Tidy, then post process with a sed script to convert >> > the

Re: How to format django template code nicely with notepad++?

2011-02-22 Thread Bill Freeman
stalled. second how can i specify > where vim needs to look to find the dll? > > > On Feb 22, 5:20 pm, Bill Freeman wrote: >> You *could* use Tidy, then post process with a sed script to convert >> the '%20's to spaces. >> >> There may be comparab

Re: How to format django template code nicely with notepad++?

2011-02-23 Thread Bill Freeman
ackaging, sometimes requires X server libraries, even though there is no display, and thus no need (or ability) to run an X server. There's also NX, but ssh -Y is so easy to set up.] Bill -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to format django template code nicely with notepad++?

2011-02-23 Thread Bill Freeman
On Wed, Feb 23, 2011 at 11:58 AM, Tom Evans wrote: ... > > Aargh, we're mortal enemies - I guess Eight Megs And Constantly > Swapping is no longer an insult I can use :) The last time I used a machine with fewer than 8Mb of RAM, emacs was nowhere near that big. Besides, what are you running all

Re: jquery document ready aggregation

2011-02-28 Thread Bill Freeman
ent from that in which it appears in the template. You could, of course, default the variable to a standard name. Bill On Fri, Feb 25, 2011 at 10:26 AM, kost BebiX wrote: > Hi! I would like to write two simple tags, one would be called {% domready > %}, and another one is {% domready_rend

Re: a rookie problem about 'Modules'

2011-03-01 Thread Bill Liao
On Tuesday, March 1, 2011, iRick wrote: > hi,i'm a freshman for python. i got a problem about "Modules" > this is my dir > A/ >      a.py >      __init__.py >      B/ >              __init__.py >              b.py >      C/ >              __init__.py >              c.py > > and i wrote thi

Re: JavaScript Parameter

2011-03-03 Thread Bill Freeman
Or if this is a static at page load array, render it in a tag in your template. On Thu, Mar 3, 2011 at 9:17 AM, urukay wrote: > Hi, > > what script do you mean, how does it look like? > > If you are using JQuery, just use JQuery's UI autocomplete to do the > same thing. > > Radovan > > On 3. Mar

Re: adding model_dict['admin'] = model_admin is good idea?

2011-03-04 Thread Bill Freeman
some future version of Django. That's not to say that the admin API may not someday directly support the features you need, but if it doesn't now, then you must consider where to best invest your effort. Bill -- You received this message because you are subscribed to the Google Gr

Re: AW: parameter, but not in the URL

2011-03-04 Thread Bill Freeman
You might also pass the necessary parameters in a POST type form, where the parameters don't appear in the URL, and if you're really security conscious you can require that the POST come over https. Bill On Fri, Mar 4, 2011 at 6:00 AM, Szabo, Patrick (LNG-VIE) wrote: > That

Re: current recommendations for using email as username

2011-03-08 Thread Bill Freeman
We've even had problems (converting people's old site accounts) with non-email usernames exceeding 30 characters. On Sat, Mar 5, 2011 at 12:49 AM, creecode wrote: > It would be grand if the max_length was upped. > > On Mar 4, 7:51 pm, Shawn Milochik wrote: > >> > Email addresses have been allowe

Re: weird ifnotequal issue

2011-03-08 Thread Bill Freeman
That's a weird field name. I could see there being a corner case. If it were me, I'd stick a breakpoint in the ifequal implementation, possibly, if you have a lot of other ifequal tags to get past conditioned (normal python if statement) on having gotten "." in the arguments. Then you can see wh

Re: Payment Gateways

2011-03-08 Thread Bill Freeman
require your to touch the credit card number. If you never had it, you can't be responsible for compromising it. Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.c

Re: celery tasks and circular imports

2011-03-08 Thread Bill Freeman
h A2 and B import A1). But this often obfuscates the code. Readable code is always a priority for me. Bill On Mon, Mar 7, 2011 at 9:55 AM, Brian Bouterse wrote: > I too "protect" code from being interpreted at import time by putting import > statements directly in the tasks that

Re: which statements are right?

2011-03-08 Thread Bill Freeman
same person (you should be in different frames of mind for the two tasks). That being said, django does not prevent your template from having side effects. You just need the cooperation of your view and/or models and/or write a template tag or filter. Bill -- You received this messag

Re: How to get next and previous element in a forloop in the template

2011-03-08 Thread Bill Freeman
Apart from writing your own for tag, you could, for instance, supply a generator (or equivalent) on your model, or passed in by your view, that returns 3 tuples of (this, prev, next), or perhaps easier to read in the template, toy objects having this, prev, and next attributes (or properties). On

Re: render_to_response a HTML msg

2011-03-10 Thread Bill Freeman
Use: {% if html_message %}{{ html_message|safe }}{% endif %} Presuming that you believe that the variable's content is, indeed, safe. Bill 2011/3/10 Thiago Carvalho D' Ávila : > I'm having some problem while trying to render some HTML code as a template > variable. &

Re: render_to_response a HTML msg

2011-03-10 Thread Bill Freeman
On Thu, Mar 10, 2011 at 12:14 PM, Tom Evans wrote: > 2011/3/10 Thiago Carvalho D' Ávila : >> Oh, thanks a lot. That worked, but now I have one more doubt... >> >> What are the security issues related to the use of safe variable? When can I >> consider it safe? Is it possible to make some kind of i

Re: django remove unicode from query result ?

2011-03-10 Thread Bill Freeman
If you know your content only has characters that exist in your default, you can say: m.append([str(s) for s in i.values()]) Or, read up on the encode method of unicode objects to see about how to ignore characters that don't translate, or for encoding into other than your default characer se

Re: using Django from cron

2011-03-10 Thread Bill Freeman
On Thu, Mar 10, 2011 at 12:49 PM, Tom Evans wrote: > On Thu, Mar 10, 2011 at 5:42 PM, Sells, Fred > wrote: >> I'm sure the solution is out there somewhere, but my google search is >> giving me too many false positives. >> >> I have a stand along python program that will be run as a cron job and I

Re: Packaging and development workflow for decoupled apps.

2011-03-10 Thread Bill Freeman
27;m not sure whether the django deployment instructions you have will use these, but if not you could certainly make a module for inclusion by settings.py that figured out what to add to sys.path (if it's not already there) by inspecting the files in the develop-eggs directory.

Re: Packaging and development workflow for decoupled apps.

2011-03-11 Thread Bill Freeman
ing seems to be specifically aware of subversion at some level, offering to use revision information in version numbers. I haven't noticed support for other VCSs, but there could be ways to use them by having script wrappers on your shell path...). Then you can simply update to another revisio

Re: Is it safe to change the "id" field of a model from int to bigint in the DB schema?

2011-03-14 Thread Bill Freeman
t you should check in the case of yours. So long as the ORM supports your db's bigints at all, which I believe is a function of the database back end, python deals with int versus long transparently, especially in the newer versions. But test. Bill On Sun, Mar 13, 2011 at 12:02 AM, Andy wrote

Re: Cannot import models.py in views.py

2011-03-17 Thread Bill Freeman
Try: from webservices.reviewsapp.models import Category Bill On Thu, Mar 17, 2011 at 1:44 PM, Ricardo F. Teixeira wrote: > Hi list : ) > > I'm having a strange problem. I'm developing a webservice that > communicate with a database. > In my views.py file I'm

Re: Pretty URLs: fundamental flaw?

2011-03-18 Thread Bill Freeman
pon submit which rewrites the action attribute before allowing the default submit action to continue. But Django can help you too. You can accept the form parameters as normal GET or POST parameters, and return a redirect to the corresponding "pretty"* url. [* Beauty is in the eye of t

Re: django tutorial on asus netbook

2011-03-22 Thread Bill Freeman
t 2.6.x if you're going to do it, and either read carefully about using 'altinstall' rather than 'install' when you build it (if there is no package) or set the prefix so that it gets installed in your home directory, where it won't replace the meaning of 'python

Re: Is there any way to override variable of parent (super) template in child template

2011-03-28 Thread Bill Freeman
Try: {% extends 'base.html' %} {% with title="My title" %} {% block content %} Any other content stuff. {% endblock %} {% endwith %} No guarantees. Let us know if it works. Bill On Mon, Mar 28, 2011 at 6:18 AM, Vladimir Mihailenco wrote: > Is there any way to over

Re: authentication switching mid-session

2011-03-30 Thread Bill Freeman
Do you have any caching in front of things? On Wed, Mar 30, 2011 at 7:07 AM, Chris Curvey wrote: > When my Django system is under heavy load (system CPU > 90%), I start > getting complaints from users that their authentication changes in the > middle of a session.  For example: > > 1) Bob logs in

Re: export DJANGO_SETTINGS_MODULE

2015-01-21 Thread Bill Freeman
It looks like you are typing "*django-admin.py startproject WebSite*" at the python prompt, which is incorrect. You type it at the shell. If you get command not found, then instead type "python full/path/to/django-admin.py startproject WebSite". And in any case, the current directory must be the

Re: Issue in Django count string in a template

2015-02-12 Thread Bill Freeman
I presume that your messages are model instances. If so, create a queryset for the unread messages in your view, and pass that, or the result of applying .count() to it, as a template context variable, say "unread_message_count". On Thu, Feb 12, 2015 at 1:06 PM, Ronaldo Bahia wrote: > I am faci

Re: Issue in Django count string in a template

2015-02-12 Thread Bill Freeman
Show me your view. On Thu, Feb 12, 2015 at 2:49 PM, Ronaldo Bahia wrote: > Thanks for answering. > > Can you provide some example? > > Cheers > > Em quinta-feira, 12 de fevereiro de 2015 17:00:28 UTC-2, ke1g escreveu: >> >> I presume that your messages are model instances. If so, create a >> qu

Re: django doesnt wait for my time.sleep

2015-03-04 Thread Bill Freeman
Sleeping in a web server, which potentially has many users, is considered bad form, even if it works. A better place for such time outs is in JavaScript in the browser. Some designs use a view that the JavaScript (or user) can poll to determine when the resource is available. On Wed, Mar 4, 2015

Re: Can't run django!

2015-03-04 Thread Bill Blanchard
Can we see a sanitized version of your settings file? My guess is there's probably a typo in there somewhere. On Mon, Mar 2, 2015 at 10:44 AM, David Zahedi wrote: > Hi there, > > I am using python 2.7 and django 1.75; when I run "manage.py runserver" I > get the following error: > > CommandErro

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Bill Freeman
Did you remember to set the content type of your response to application/json? On Mon, Mar 9, 2015 at 1:18 PM, Henry Versemann wrote: > First to be clear up front let me say that I'm using Django1.7, Python > 2.7.8, and the requests (Requests: HTTP for Humans >

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Bill Freeman
If it's not the basics, then you haven't provided enough information to allow someone to spot the problem. If you post the code that is performing the modification, someone may be able to spot the issue. On Mon, Mar 9, 2015 at 1:50 PM, Henry Versemann wrote: > Yes Id did do that. The problems I

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-10 Thread Bill Freeman
OK. but I need more code context. The if statement that does the modification is clearly python, so at that point rspnsdata must be a python dictionary, not a JSON string. Yet, if I understand you correctly, it is JSON to begin with (and you are using json.loads() to turn it into python data so

Re: Using the eval() command

2015-03-10 Thread Bill Freeman
eval() operates on an expression, not a statement. Assignment makes it a statement. Why wouldn't you just say: innerDict['+newinnrkey+'] = newinnrval On Tue, Mar 10, 2015 at 5:25 PM, Henry Versemann wrote: > I have a new dictionary that I want to build, using data from another > dictionary

Re: Django 1.6's lifespan for security updates?

2015-03-11 Thread Bill Freeman
u're going this far, you may as well take full control by building Apache httpd as well, though, so long as a suitable development package is available, you may not need to.. It's not as big a deal as it may sound. If you're not using httpd/mod_wsgi, I can't offer any advice on

Re: Load Template without rendering/parsing

2015-03-16 Thread Bill Freeman
But that's what the template loader does. It loads *DJANGO* templates. If it does the loading, the template will receive Django processing. I see two choices: 1. Quote everything in the template that looks like a Django template special syntax so that the rendering process instead just renders

Re: Django TCP socket communication

2015-03-27 Thread Bill Freeman
There is a sense in which what you are describing, for the Django side, is what a webserver, including one involving Django, ordinarily does. The only requirement the web server makes (and some can get around it with work) is that the data sent over the socket, at least from the client (microcontr

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
Hi Stephanie, I've had success with the following jQuery library: https://github.com/elo80ka/django-dynamic-formset You can administer the formsets normally in your view and forms files. Reference here: https://docs.djangoproject.com/en/1.7/topics/forms/formsets/ Here is a code snippet of a temp

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
, "Stephanie Socias" wrote: > Thank you all SO much for your advice. Even just hearing that this is a > complicated problem and that it's not just me, really helps. > > I will post my code shortly. I'm now trying to incorporate some of your > feedback. > > B

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
try looking at the javascript console in your browser to see if you get any error messages. Hope this helps! Bill On Mon, Mar 30, 2015 at 8:19 PM, Stephanie Socias wrote: > Thank you, Bill. That was silly of me. I'm just confused on where/how > those actual links are displayed. I can&#x

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
ank you, Bill! I'm getting a TypeError that $(...).formset is not a > function > I'll see what's up! > > On Mon, Mar 30, 2015 at 8:29 PM, Bill Blanchard > wrote: > >> Hi Stephanie, >> You have two jQuery selectors in your formset function and I'm not

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
. If it's found, then I might be stumped, or it might be some kind of import issue with the base jquery file or a conflict. If it's not found, you'll have to troubleshoot the issue related to pointing to the correct source location. Bill On Mon, Mar 30, 2015 at 9:54 PM, Stephani

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
ond is learning — as romantic poet John Keats put >> it — to be “capable of being in uncertainties, mysteries, doubts, >> without any irritable reaching after fact & reason.” >> >> Seeking Genius in Negative Space, Chris Messina >> >> https://medium.co

Re: Multiple Django Forms

2015-03-31 Thread Bill Blanchard
Hi Stephanie, Ping me offline, I might be able to help you out. On Mar 30, 2015 1:43 PM, "Stephanie Socias" wrote: > Thank you for your suggestions! > > Unfortunately, as I am very green at the moment, I nee more help to > implement all of these new techniques. Given that what I'm trying to >

<    3   4   5   6   7   8   9   10   >