Re: Strange unit test / OAuth Issue

2010-09-07 Thread Bill Freeman
Why not check which version of oauth you have in each place? Even if there isn't a usable version indicator in the library, you could generate a file containing the chacksums of all the py files, sort it, and compare it. On Tue, Sep 7, 2010 at 4:46 AM, Chris wrote: > So I wrote some django unit

Re: PayPAL-IPN-request doesn't call the view

2010-09-10 Thread Bill Freeman
vided for, log the contents of request.POST. It will be something simple, such as there's some field they no longer provide or don't always provide. Bill On Thu, Sep 9, 2010 at 10:26 AM, wrote: > ok thanks; I should have mentioned that. > the view is called when loaded from a browse

Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-09-16 Thread Bill Freeman
and pdb. That said, you could also try turning on DEBUG, temporarily, in the production instance. This will give you the friendly list of url patterns tried, and what they were trying to match. Hopefully. And it might just be obvious from there. Bill On Wed, Sep 15, 2010 at 6:02 PM, dclaar wrot

Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-09-16 Thread Bill Freeman
Well, you have to hope that behavior under the development server gives you a clue where to put the prints, or breakpoints. You might find yourself patching a piece of middleware to look for the troublesome path and only doing a set_trace() for it. Then you can single step your way into the url d

Re: IPAddressField inserted as empty string although null=True

2010-09-20 Thread Bill Freeman
I believe that this is documented. I think that it's a limitation of forms that character fields store an empty result as a null string. All the null=True means is that the model field (not the model form field) is willing to send the database a null, should it find None in the instance attribute,

Re: How to use custom classes in django

2010-09-22 Thread Bill Freeman
Start with the tutorial (for python version 2.x) at python.org On Wed, Sep 22, 2010 at 4:56 AM, jake2891 wrote: > It doesnt need to be a class i am new to python / django and come from > a php background so was just wondering what the best practice is? Is > it to just put all requests and handlin

Re: help setting 'apps' folder... path issue

2010-09-22 Thread Bill Freeman
Or you can add it to sys.path in your settings.py file. On Wed, Sep 22, 2010 at 10:43 AM, Shawn Milochik wrote: > It's probably your PYTHONPATH. > > Check the result of: > > echo $PYTHONPATH > > I'm guessing that your apps directory is not in the path. If not, you can add > it to your path. > >

using both SQL and NonSql (MondoDB) in same project?

2010-09-27 Thread Bill Seitz
I know Django will support multiple SQL databases by just having a tuple of DATABASES entries in settings.py. But can I put a single item in DATABASES for a SQL part, and a 'from mongoengine import connect' section in as well? I'd like to have users/accounts/payments in SQL, and all my main/ mess

Re: Really slow performance on webfaction

2010-09-28 Thread Bill Freeman
ld be qualified without a m2m join). Bill On Tue, Sep 28, 2010 at 12:12 PM, Shawn Milochik wrote: > Do you see anything at all like this if you run your app from your > development box? > You can always use the Python debugger to trace for your code and look for > bottlenecks. > (Aw

insert into middle of embedded document?

2010-09-29 Thread Bill Seitz
I'm treating a task hierarchy as a tree. I want to add a subtask to a top-level task. But I don't want to append at the end of the existing list, I want to put it at a specific position in the list. Here's my existing record: > db.master_projects.find() { "_id" : ObjectId("4ca1397c06391121743320

Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-10-01 Thread Bill Freeman
And thank you for the pointer to the modwsgi debugging page. On Fri, Oct 1, 2010 at 12:39 PM, dclaar wrote: > Just as a follow-up, > http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Python_Interactive_Debugger > was pretty helpful. In the end, it turned out to be one of those > incredib

Re: how to add login info while opening url

2010-10-12 Thread Bill Freeman
IIRC, you will need to use urllib2 and provide a "urlopener" that handles the 403 and responds with the credentials. The more recent python (e.g.2.6) documentation is pretty clear about it. Again, from memory. Bill On Tue, Oct 12, 2010 at 1:52 PM, harryos wrote: > mm..I tried t

Re: Different logins in same browser session and login_required

2010-10-19 Thread Bill Freeman
them. Browsers run by separate users are separate. On windows you might do this with the switch user without logging out functionality. I don't know about Macs. Bill On Tue, Oct 19, 2010 at 10:55 AM, PyMan wrote: > Hi guys, > I need some help about logins and session and any help wo

Re: Converting Django to Desktop App? (Multiple Instances)

2010-10-29 Thread Bill Freeman
This will work. Concurrency is Oracle's problem. Each Django is a client, and gets a separate connection to Oracle. Transaction management is bread and butter to the big databases. That said, you may not need apache. This sounds like a group of cooperating users with a very low request rate, s

Using formsets with multiple models

2010-10-29 Thread Bill Brigham
QuestionForm containing fields for 0..N possible fields, i.e. multiplechoice_choice_0, multiplechoice_correct_0, multiplechoice_choice_1,... But this feels wrong to me. It seems overly complicated which makes me think I'm going about it the wrong way. Any help would be much appreciated please

Re: 2D map application: performance and design question

2010-11-01 Thread Bill Freeman
integers, but if that was just by way of example, and they are really some complex (non-scalar) data type, the comparisons may not be cheap on the database. Bill On Mon, Nov 1, 2010 at 8:13 AM, Javier Guerra Giraldez wrote: > On Mon, Nov 1, 2010 at 5:55 AM, Cal Leeming [Simplicity Media Ltd] &g

Re: Django timestamp to Javascript timestamp

2010-11-29 Thread Bill Freeman
local machine's timezone. JS data/time manipulations have enough stuff to fix this, but you have to work a bit, including considering whether you are in daylight savings time, etc.. Bill On Mon, Nov 29, 2010 at 1:16 PM, Matt Thompson wrote: > Hello guys and girls, > > I'm look

Re: reverse drops the project from the url returned

2009-12-30 Thread Bill Freeman
Since your urlconf is passing "case" as a named (keyword) argument, you (may) have to pass it that way to reverse: ...reverse('case_url', kwargs={'case':case.id})... Bill On Mon, Dec 28, 2009 at 8:22 PM, davathar wrote: > I'm stuck on a "revers

Re: Seemingly Random Admin Errors

2009-12-31 Thread Bill Freeman
an use ssh port forwarding to get to it, though this can be a bit slow. But python runs pretty much everywhere, so I'd really suggest doing the development on the same computer where you are running your browser, and then you certainly can access, for example, port 8000. Good luck, and Happy

Re: questions from a noob - win7 using django

2009-12-31 Thread Bill Freeman
gt; but im impatient and frustrated! You can't write python without writing python. If you haven't already done so, find the tutorial on python.org and do it with patience and interest (might take you a couple of hours), and then read all the python documentation you can find about impor

Re: Tutorial help

2009-12-31 Thread Bill Freeman
Your code doesn't belong in any directory being served by webserver at all. If your hosting arrangement requires that, then it's the wrong hosting environment. In order of preference django should be running: under mod_wsgi under mod_python as the development server with the front end acti

Re: django-audiorecorder ?

2010-01-04 Thread Bill Freeman
te deserve what they get.) But so long as it's a short clip, even MS sound recorder will do, and I assume that MACs have something like that. Most linux's too, have (at least one) suitable tool. So if it were me, I'd simple provide instructions as to how to create a file to upload.

Re: Beta testers for a syntax highlighting widget

2010-01-04 Thread Bill Freeman
in how it looks mode. So it seems to me that what's really called for is an extension to html mode of some existing editor widget. Bill On Sun, Jan 3, 2010 at 11:07 AM, aditya wrote: > Anyone? Limited testing will do, I just want to make sure I haven't > overlooked something. > &g

Re: Passing a parameter into a queryset for a generic view

2010-01-04 Thread Bill Freeman
There may be an easier way, but I'd write a view, even if I then called the generic view from there. As you've probably figured out, your definition of the queryset occurs once at import, when object_id isn't even defined, let alone coming from each request in turn. Bill On Sun,

Re: unicode encoding problem

2010-01-04 Thread Bill Freeman
I think that you will eventually have trouble with using non-ASCII for non-string purposes (class or method name, variable or attribute names). Bill On Sun, Jan 3, 2010 at 6:48 PM, Simon Davies wrote: > I know I'm missing something really simple really but I  keep getting > this er

Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-04 Thread Bill Freeman
Can you make it fail in the development server, with DEBUG turned on? If so, you can get more helpful error display and/or do pdb.set_trace() and poke around. On Mon, Jan 4, 2010 at 4:25 PM, Patrick May wrote: > Hi, > > I have Django running under Apache with mod_wsgi.  I've got a simple URL >

Re: Help with a query :$

2010-01-05 Thread Bill Freeman
ne database query.) 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For mor

Re: oauth handling against twitter

2010-01-05 Thread Bill Freeman
On Tue, Jan 5, 2010 at 8:29 AM, hackndoes wrote: > I am using the oauth-python-twitter from google code to establish > oauth authentication  with twitter from my django app. > I don't use django oauth application as part of my solution cause i > have no need, i only need a thin use of oauth to mak

Re: Exiting Postgresql user to Django App user

2010-01-06 Thread Bill Freeman
Have you tried setting DATABASE_USER in settings.py to the desired user? On Wed, Jan 6, 2010 at 2:10 AM, Rama wrote: > Hi > I would like to use existing postgresql users with my django app, I > wonder is there any solutions already available with django... > > Please let me know. -- You received

Re: Project layout: put templates and js/css together?

2010-01-18 Thread Bill Freeman
reasonably easy to set up apache to serve a directory's content, including that in sub-directories, while I don't know how to go about keeping it from serving templates in the same directory. Too bad they feel far away. What are you using to edit them? Bill On Mon, Jan 18, 2010 at 8:49 A

Re: no attribute 'save_m2m'

2010-01-18 Thread Bill Freeman
Have you, perhaps, overridden the save() method of your model form, and neglected to capture **kwargs and pass it on to the superclass method? On Mon, Jan 18, 2010 at 1:23 PM, GoSantoni wrote: > Hi Nek4life, > > Unfortunately that didn't work. > > TypeError at /blog/new/ > save() got an unexpecte

Re: Django, manage.py and Ubuntu

2010-01-19 Thread Bill Freeman
nsert: import pdb;pdb.set_trace() And step along to see how it's finding its files. Good luck. Bill On Tue, Jan 19, 2010 at 1:38 PM, MauroCam wrote: > Hi, > > Please forgive the possibly daft question, but as an Ubuntu newbie I > am going crazy with the following problem. >

Re: Django, manage.py and Ubuntu

2010-01-19 Thread Bill Freeman
h the rest of the arguments you supplied. Modify your manage.py scripts to manipulate sys.path before importing anything else. Or investigate and deploy the virtualenv tool. The last is my favorite, though you still have to remember to "activate" the appropriate environment, so I

Re: Django, manage.py and Ubuntu

2010-01-19 Thread Bill Freeman
ee if the output gives you any insights: ### import sys sys.path.append('..') import django print django I'm headed out soon, so I won't be able to comment further today. Bill On Tue, Jan 19, 2010 at 6:56 PM, MauroCam wrote: &g

Re: Django, manage.py and Ubuntu

2010-01-20 Thread Bill Freeman
On Tue, Jan 19, 2010 at 7:57 PM, MauroCam wrote: > Bill, > > thanks for all your help. I have fixed it by manually saving > PYTHONPATH in.profile, and the sys.path is now reflecting the correct > path. Runnnig the loaddata command now correctly loads the data! > > Not

Re: Can I wrap the "extends" tag in an "if" tag?

2010-01-20 Thread Bill Freeman
in turn extends). You probably want to reverse the sense of the test, however to something like if no hide_header, so that unaware view/template combinations that extend base.html get the header by default. Bill On Wed, Jan 20, 2010 at 11:09 AM, Stodge wrote: > Can I wrap the "extends&qu

Re: Can I wrap the "extends" tag in an "if" tag?

2010-01-20 Thread Bill Freeman
But then you have to include the header content in every template that extends base.html which sort of defeats (part of) the purpose of extends. On Wed, Jan 20, 2010 at 4:40 PM, Tim wrote: > Could you do it in a block? > > In base.html > > {% block header %}{% endblock%} > > {% block content %}{%

Re: Should a decorator be used here or should I do something else.

2010-01-21 Thread Bill Freeman
still pretty magic.) A shared function that you call from the view to filter a queryset based on age criteria might feel more explicit. Bill On Wed, Jan 20, 2010 at 5:15 PM, Jeffrey Taggarty wrote: > Hi Guys, I have a bit of a dilemma in terms of design of a small web > application... >

Re: Admin calendar popups on datefield suddenly missing

2010-01-22 Thread Bill Freeman
Note that the net tab in firebug is one way to see which references aren't loading. On Fri, Jan 22, 2010 at 6:26 AM, David De La Harpe Golden wrote: > Walt wrote: >> Okay, we're getting somewhere. It can find the JS file(s) just fine > > The static files maybe. > >> and I see that the calendars a

Re: Remove items from queryset?

2010-01-22 Thread Bill Freeman
course, you don't need to generate actual instances if you don't intend to modify and save them, and can pick and choose the fields you want to return (this, too, has it's details to work out). Bill -- You received this message because you are subscribed to the Google Groups &

Re: Remove items from queryset?

2010-01-22 Thread Bill Freeman
d) q = q.exclude(id__in=excludes} Or, if you'll be excluding more than you will be including, you can enumerate those you want to keep and use them with filter instead of exclude. On Fri, Jan 22, 2010 at 12:39 PM, Igor wrote: > Bill, > > You're correct in all your guesses - I want

Re: templatetag produce extra newline

2010-01-22 Thread Bill Freeman
I'm pretty sure that your templatetag does produce the newline. The url tag, for example, doesn't add a newline. How about posting the code? On Fri, Jan 22, 2010 at 12:37 PM, Ali Rıza Keleş wrote: > Hi, > > I have a templatetag which decides somthing and returns it. I works well > within HTML,

Re: templatetag produce extra newline

2010-01-22 Thread Bill Freeman
lose() print repr(s) Probably you have an editor that insists on ending files with newlines. Or perhaps you had not considered that newline. Anyway, I dummied up a test version of your code, and it works fine for me, with no trailing newline. Bill On Fri, Jan 22, 2010 at 1:15 PM, Ali Rıza Keleş

Re: templatetag produce extra newline

2010-01-22 Thread Bill Freeman
leş wrote: > On Fri, 2010-01-22 at 15:07 -0500, Bill Freeman wrote: >> I believe that you will find that the file >> tags/find_which_display.html has a newline >> at it's end.  If you don't have the *nix utility od, you can, with any >> conventint &g

Re: how to use model name in templates

2010-01-25 Thread Bill Freeman
ity to lie about the model name, this eliminates the need for the method. Bill On Mon, Jan 25, 2010 at 9:35 AM, Ali Rıza Keleş wrote: > Hi, > > How can I use model name in Templates? > > I tried something like this: > > Firstly model is here, > > cl

Re: Model Field Subclass

2010-01-25 Thread Bill Freeman
ise, I'd expect your original approach to work. Bill On Mon, Jan 25, 2010 at 9:55 AM, Igor wrote: > Ok, I've figured the answer myself - but maybe someone will find it > useful... > > When retrieving an ImageField, Django doesn't return the field but > rather the u

Re: [App Idea] Django-CDN

2010-01-26 Thread Bill Freeman
Three messages in, and I still don't know what "CDN" stands for, other than "Canadian", which doesn't seem to fit. On Tue, Jan 26, 2010 at 4:03 PM, Dj Gilcrease wrote: > libcdn api brainstorm, my intent is not to support all the features of > each cdn but only to support those that would be used

Re: now template tag

2010-01-26 Thread Bill Freeman
I think that this is because now is a tag and date is a filter, and you probably have a a "date" variable in context. You could try passing in a "now" variable from your view. Try rendering {{ date }} in this template to see whether there is such a variable. I think that you can only use variabl

Re: Django 1.1 features covered in book.

2010-01-29 Thread Bill Freeman
Yes, but you can only read it on line. It's the 1.1 documentation and release notes at djangoproject.com . On Fri, Jan 29, 2010 at 9:49 AM, Sebastian Pawlus wrote: > Hi > Do you know any Django books which cover functionalities introduced by > version 1.1? > thanks > > -- > You received this mes

Re: Django Model Audit Log

2010-01-29 Thread Bill Freeman
If worse comes to worst, you could always patch the url dispatcher to store the user in a global variable before it calls the view. It should be sure to set that variable to None when the view returns, so that the global doesn't keep a reference on the user object between requests (a try finally a

Re: Django Model Audit Log

2010-01-29 Thread Bill Freeman
This is much better than my ramblings. On Fri, Jan 29, 2010 at 12:08 PM, tom wrote: > maybe that middleware can help you out with getting the username > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > On 29 Jan., 18:05, Shawn Milochik wrote: >> I need to implement auditing for

Re: logic of forloop.revcounter and revcounter0

2010-02-02 Thread Bill Freeman
is roughly equivalent to {% ifequal forloop.revcounter0 0 %} or {% ifequal forloop.revcounter 1 %}. To get a better handle on what has which value when, you could sprinkle some {{ forloop.revcounter }} and {{ forloop.revcounter0 }} instances in your loop. Bill On Tue, Feb 2, 2010 at 4:30 AM, harryos wrote:

Re: Help with math functions...

2010-02-03 Thread Bill Freeman
00//4) (yes, two slashes does integer divide) or Decimal(str(100/4)), or try the original examples in a python2.x version where the single slash operator still returns an int if both arguments are int. Bill On Wed, Feb 3, 2010 at 1:12 PM, Chris McComas wrote: > This is kinda of a general and k

Re: How to use CheckboxSelectMultiple() widget

2010-02-04 Thread Bill Freeman
m. Untested, but I've done similar. Should be close. Bill On Thu, Feb 4, 2010 at 1:27 AM, mojito wrote: > I have a list of files I'd like to render as a list of check boxes > with multiple selection. Then from the frontend I want to add the > ability to sav

Re: Please Help With POST Problem

2010-02-04 Thread Bill Freeman
If you are running behind, for example, apache, and the content type headers are correct, apache might expand the gzip stuff for you. I wouldn't be surprised to find that the python/django http request stuff doesn't handle gzip, but it might. It might be possible to return an error response saying

Re: django_evolution evolve not found

2010-02-05 Thread Bill Freeman
Perchance it needs to be added to settings.INSTALLED_APPS ? On Fri, Feb 5, 2010 at 12:22 PM, gintare wrote: > I have installed django_evolution from Debian package. > It is now under /usr/lib/pyhton2.5/site-packages/django_evolution > > i also added : >  ln -s `pwd` /django-trunk/django   /usr/li

Re: how to do object lookup using hour ,minute

2010-02-08 Thread Bill Freeman
table "AS". Bill On Sat, Feb 6, 2010 at 6:21 AM, jimgardener wrote: > hi > > I am a beginner with python and django  and am writing my first > application.I need to retrieve some objects of my model class created > at different minutes in an hour.The class stores a

Re: Custom commands called outside project path

2010-02-09 Thread Bill Freeman
os.chdir(sys.path[0]) --- certainly before importing any django stuff. The os.chdir() call may not be necessary, but can't hurt. Both of these have the disadvantage of the script needing to know the path to your project, but something has to know it. Bill On Tue, Feb 9, 2010 at 1:34 PM,

Re: Is any thing for python like .jar files for java.

2010-02-09 Thread Bill Freeman
You'll need to tell me what it is that jar files do for you beyond being yet another archive format. For that use, there are tar file (compressed or not), etc. If you are looking for something from which the python interpreter can load code and certain other things without unpacking first, then e

Re: Tutorial 1: AttributeError at /time/ 'module' object has no attribute 'now'

2010-02-09 Thread Bill Freeman
our import. If you're not running in the development server, then you might replace your "now = ..." and "html = ..." lines with: html = "datetime is %r." % datetime which will tell you what datetime is at that point. You will have to restart apache (or perhaps

Re: Custom commands called outside project path

2010-02-09 Thread Bill Freeman
ntab with crontab -e on a linux box has no user specification because it edits the crontab of the invoking user. Perhaps it's different for a directly edited root crontab.) Bill On Tue, Feb 9, 2010 at 5:27 PM, creecode wrote: > Hello Tim, > > On Feb 9, 10:34 am, Tim Daniel wrot

Re: Can't get Uploaded File into DictReader

2010-02-11 Thread Bill Freeman
normalize the line endings. I suspect that DictReader process the file as an iterator of lines, so you can probably fix line endings, if necessary, using a generator, or perhaps even a generator expression. Bill On Tue, Feb 9, 2010 at 8:50 PM, jeff wrote: > > I'm trying to upload a CSV

Re: Make a new model outside of models.py

2010-02-11 Thread Bill Freeman
ch in django's internal structures) is likely to be hard to maintain, and be dependent on django internals that can change from version to version. Bill On Thu, Feb 11, 2010 at 3:51 AM, Sameer Rahmani wrote: > Hi , > is there any way to build a new model from outside of models.py ? or in >

Re: Need help storing/retrieving values from a form.MultipleChoiceField

2010-02-11 Thread Bill Freeman
It's probably a little more complex than that. When you want to display the current DB value in a form for editing, you're going to have to turn it back into a list. If I recall correctly, there is a field on djangosnippets that implements storing a multi-select as comma separated values. I don'

Re: nested lists

2010-02-15 Thread Bill Freeman
A list (or queryset or other iterable) of objects, each of which has an attribute named "city_list" which contains a list(or queryset or other iterable of strings (or objects with a unicode representation that is meaningfully represented as a string) such as the name of a city. On Sat, Feb 13, 201

Re: dynamic variable in templates

2010-02-15 Thread Bill Freeman
Or a method on the project model, maybe called chain, that looks the project instance's name up in chains. The you could say "for item in project.chain", for example. On Sat, Feb 13, 2010 at 3:31 PM, Daniel Roseman wrote: > On Feb 13, 7:20 pm, Madis wrote: >> http://push.cx/2007/django-template

Re: Problem with defer

2010-02-23 Thread Bill Freeman
How do you know they weren't deferred? You can still access them if they were, IIUC. It just causes additional queries, behind the scenes. On Mon, Feb 22, 2010 at 12:31 PM, Dexter wrote: > Oh, I'm sorry, > > no error appears, but the queryset returns the complete objects with all the > fields,

Re: Restrict choices in ModelForm for ForeginKey field

2010-03-01 Thread Bill Freeman
ss to data from the request will take further research. It may be that between form instantiation and rendering that you can store a value on the field instance that formfield can access (it just gets 'self' and normally empty kwargs when called). I've incl

Re: Restrict choices in ModelForm for ForeginKey field

2010-03-02 Thread Bill Freeman
. There's no database interaction involved. What bothers you about it? Bill On Tue, Mar 2, 2010 at 11:00 AM, AlienBaby wrote: > Hi, thanks for the pointers,  I followed through Bill's suggestion, > and while I could understand the approach I did indeed have problems > w

Re: open()

2010-03-04 Thread Bill Freeman
aining manage.py (the "project directory"). I'm not sure about the modwsgi case. Bill On Wed, Mar 3, 2010 at 9:05 AM, andreas schmid wrote: > zubin71 wrote: >> >From a method defined in a view i need to get the source of an html >> file in the templates direc

Re: Changing template variables

2010-03-04 Thread Bill Freeman
Write your own view instead of using direct_to_template. On Thu, Mar 4, 2010 at 10:06 AM, Kevin Renskers wrote: > Hi, > > I am wondering if it is possible to change template variables before > they get rendered in a template. > > For example, I use something like this in my template: > return dir

Re: Changing template variables

2010-03-04 Thread Bill Freeman
Write your new view so that it can be used generically. On Thu, Mar 4, 2010 at 10:22 AM, Kevin Renskers wrote: > Well yes, but I do not want to change all of my views. I want a > generic solution to change template variables before they get > rendered. > > > On Mar 4, 4:1

Re: ifequal issue

2010-03-10 Thread Bill Freeman
Try adding code to render the values that you are trying to compare, so that you can see in what way they are not equal. They it will probably become obvious in what way the conversion through the GET or POST data and view isn't quite what you want. E.g.; before the select: berufe_id: {{ berufe_

Re: ifequal issue

2010-03-10 Thread Bill Freeman
th berufe_id = 1 > > Not sure if this a type (int vs. string) error? > > On Mar 10, 4:18 pm, Bill Freeman wrote: >> Try adding code to render the values that you are trying to compare, >> so that you can see in what way they are not equal.  They it will >> probably beco

Re: ifequal issue

2010-03-10 Thread Bill Freeman
On Wed, Mar 10, 2010 at 11:13 AM, Tom Evans wrote: > {% ifequal item.id|stringformat:"s" berufe_id %} Cool. I spend my filter investigation time looking for one that would convert berufe_id to an int (no joy). -- You received this message because you are subscribed to the Google Groups "Djan

Re: ifequal issue

2010-03-11 Thread Bill Freeman
be manipulated by non-programmers, becomes clearer to understand. Bill On Wed, Mar 10, 2010 at 4:17 PM, wolle wrote: > Hi Tom, > > really cool idea, but it does not work... > > >                                -- Bitte Berufsgruppe wählen > -- >                          

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Bill Freeman
ke a 2.5 use the pyc files of a 2.6 installation). See the docs for the apache configuration that tells mod_wsgi where to find your xxx.wsgi file (WSGIScriptAlias, I think). Bill On Thu, Mar 11, 2010 at 8:53 AM, bx2 wrote: > The best option is to use buildout (there is no need for creating &

Re: REMOTE_ADDR

2010-03-16 Thread Bill Freeman
Is your middleware getting called? Is the else clause of your try ever reached? Is reali_p in the format you expect? (In the development server a pdb.set_trace() can help you with that. If that's working, does the request that reaches your view (another pdb.set_trace()) contain your tweak to re

Re: mr.developer

2010-03-17 Thread Bill Freeman
nore to exclude the .svn directories (and likewise, make svn ignore the .hg and .hgignore files at the top level, if the svn checkout is rooted at or above the same directory). Then just make sure that your changed files are checked into mercurial before running buildout, and you can revert them after

Re: django rendering

2010-03-19 Thread Bill Freeman
ffect. All still dependent on context internals (though I notice that the dicts attribute of contexts doesn't have a leading underscore, so maybe it's intended that you can access it). Bill On Thu, Mar 18, 2010 at 10:40 AM, taniman wrote: > I have am using a django custom tag to change

Re: Newbie question: value inequality in Manager Method?

2010-03-19 Thread Bill Freeman
; as being more akin to assignment. The answer to your problem is to use exclude instead of filter: ...get_query_set().exclude(ccWaarde=0) Bill On Fri, Mar 19, 2010 at 9:35 AM, Daniel Roseman wrote: > On Mar 19, 1:22 pm, BobAalsma wrote: >> In models.py, whe

Re: UnicodeDecodeError Solution?

2010-03-19 Thread Bill Freeman
there before it can be moved to the live site. You are using revision control on these templates, I hope? Bill On Fri, Mar 19, 2010 at 10:44 AM, Steven L Smith wrote: > We have a freelance designer that, for various political reasons, we need to > give access to our templates directory. The pro

Re: An odd issue with loading /media/ files

2010-03-19 Thread Bill Freeman
interpreted as relative to what you thought it was? Bill On Fri, Mar 19, 2010 at 10:48 AM, Jeffrey Taggarty wrote: >  Hi guys, I have a bit of an issue I can't seem to work out. Maybe > someone can shed some light on the  issue. > > I have a app that generates an xml, inside th

Re: Remove session on browser close

2010-03-22 Thread Bill Freeman
And if the user disables javascript, or kills the browser without normal exit, or loses his connection, or pulls the ethernet cable, or has a power failure? On Mon, Mar 22, 2010 at 10:06 AM, Wiiboy wrote: > Couldn't you use Javascript for this? For example, on the > onbeforeunload event, delete t

Re: Nested for loop: {% cycle ... %}

2010-03-25 Thread Bill Freeman
n the state that was last rendered. So, if when you look at it it is "odd" then the next rendering would be "even", so we do an extra cycle in this case, making "odd" be next, for the first cycle in the next run of the inner loop. But if it doesn't work, try &quo

Re: Nested for loop: {% cycle ... %}

2010-03-25 Thread Bill Freeman
x27;t advance. On Thu, Mar 25, 2010 at 5:43 PM, mhulse wrote: > Hi Peter and Bill! Thanks for the quick replies, I really appreciate > it. :) > > @Peter: > > I tried this: > > == > > {% for foo, baz in tuple %} > ... > > ... > {% cyc

Re: Passing context variables from template to view

2010-03-26 Thread Bill Freeman
Actually, by the time your user can click a button the "result-set" is no longer around, because the context is no longer around (render and the view function have returned). All that's left is the rendered representation. I see two possibilities: 1. You render the data into a hidden form which

Re: global name 'self' is not defined

2010-04-02 Thread Bill Freeman
You need to learn python. It isn't C++ or Java Method definitions which are neither decorated with the classmethod not staticmethod decorators receive the instance as their first argument, and you must explicitly specify a parameter to receive it. This parameter is traditionally called "self" (b

Re: global name 'self' is not defined

2010-04-02 Thread Bill Freeman
You are discarding the result of your first render_to_response and displaying the second, which is always an empty form (except when the form is valid, when you are returning an HttpResponse. You probably meant to put a return in front of that render_to_response as well. But there could also be p

Re: very simple noob question - annoying caching problem

2010-04-02 Thread Bill Freeman
3. If you're running under Apache rather than the deveolpment server, did you restart apache? (The development server restarts the app when you change the code, but the apache - mod_wsgi or apache - mod_python scheme does not, and you are still running the old code.) On Fri, Apr 2, 2010 at 1:30 P

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread Bill Freeman
I once saw something for this on djangosnippets. Search hard. On Fri, Apr 2, 2010 at 1:09 PM, ben wrote: > Hi, I am new to Django. I am currently using the latest Django 1.2 > from trunk. I am trying to store a list of values in a > CommaSeperatedIntegerList. I would like to use a > CheckboxSele

Re: Using a template twice on the same page

2010-04-02 Thread Bill Freeman
You can put a snippet in a separate template file and {% include %} it twice from the same pages specific template. I frequently do this in a for loop for rendering more complex list items on more than one page, so I have one place to define how a list item looks. But including it directly twice

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread Bill Freeman
your choice tuples must be strings. Bill On Fri, Apr 2, 2010 at 3:37 PM, ben wrote: > Sorry. I pasted code that I was experimenting with. I thought maybe > the validation code was looking for strings because that is what the > error code said it was looking for. Before that I had been using

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-04 Thread Bill Freeman
under emacs, because when you hit a breakpoint, emacs pops up the relevant file in another "window" (what emacs calls panels). But then I do everything in emacs, so your favorite tool may be just as good. Bill On Sat, Apr 3, 2010 at 11:30 AM, ben wrote: > Either I do

Re: global name 'self' is not defined

2010-04-05 Thread Bill Freeman
it out for something? Bill On Sat, Apr 3, 2010 at 6:22 AM, H.İbrahim Yılmaz wrote: > Hi all, > I change my view as below but, show no Form... > > from django.shortcuts import render_to_response > from django import forms > from yenicrm.musteri.models import * > from yenicrm

Re: Noticed some strange behaviour of request.GET.get()

2010-04-07 Thread Bill Freeman
1. Why is this view code in urls.py? 2. What is the value of subdir_path in the trace back? (There's a little arrow you can click to see the variable values fro the frame.) 2010/4/7 Alexey Vlasov : > Hi. > > There's a simple code in urls.py: > == > def ls (request): >    import os

Re: Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread Bill Freeman
tent. That is, when it's really hard to fit something in an existing box, you should probably build a different box. Bill On Wed, Apr 7, 2010 at 12:35 PM, pedjk wrote: > Ok, I'm quite new to Python and Django so this might actually have a > simple solution. > >

Re: Urgent Help Needed On Python/Django ModelChoiceFields

2010-04-07 Thread Bill Freeman
ur problem. Bill On Wed, Apr 7, 2010 at 2:54 PM, pedjk wrote: > Thanks Bill. I'll clarify. > > Basically what I want to do is give each option under the choice field > a function. So once the user has selected an option under the drop > down box, that would initiate a script which w

Re: Noticed some strange behaviour of request.GET.get()

2010-04-07 Thread Bill Freeman
String concatenate, format, comparison, indexing a dictionary*, all work with mixed types, unless the conversion from unicode to byte string can't be done with the current codec when forced to bytestring, in which case you get a suitable exception. Besides, this wouldn't explain why the value of s

Re: Double arrays in models django

2010-04-07 Thread Bill Freeman
You need one matrix table, having a row for each matrix. You need one matrix_row table, having a row for each row of any matrix, mostly containing a foreign key on the matrix table, showing of which matrix the row is part, plus it's row number in that table. And you need one matrix_row_values tab

<    1   2   3   4   5   6   7   8   9   10   >