Re: ELSE condition not working

2009-01-18 Thread Ned Batchelder
example. >> >> One obvious guess here, though, is that you are only checking >> for the >> GET method. If you're submitting a form that is going to >> delete >> something, it would hopefully be done using the POST

Re: Using dinamically created tables

2009-01-23 Thread Ned Batchelder
gt; Alessandro Ronchi > Skype: aronchi > http://www.alessandroronchi.net > > SOASI Soc.Coop. - www.soasi.com <http://www.soasi.com> > Sviluppo Software e Sistemi Open Source > Sede: Via Poggiali 2/bis, 47100 Forlì (FC) > Tel.: +39 0543 798985 - Fax: +39 0543 579928 > > Rispet

Re: Using dinamically created tables

2009-01-24 Thread Ned Batchelder
nsparent, and so I could use django for > everything. > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Multithreaded development server

2009-01-28 Thread Ned Batchelder
You and core devs. > > >> and tries to inflate >> whatever problem it is that you're having (which hasn't been explained >> in detail) way out of proportion. >> > > It's true that I have not provided enough details in initial e-mail as > I shou

Re: charts in django

2009-01-29 Thread Ned Batchelder
sifire looks like it has a > great future, but depends on silverlight which is not widely deployed > yet. > > Any other ideas or comments on the above? > > Thanks, > Chris Haynes > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~---

Re: No module named PIL - Django - Gae

2009-02-06 Thread Ned Batchelder
ror still happen. > > I'm using Windows XP. > > > Somebody know how to resolve this problem? > > Thanks a lot! > > -- > Atenciosamente, > Edgard Matos > E-mail: edgardma...@gmail.com <mailto:edgardma...@gmail.com> > Skype:

Re: Beginner URL question.

2009-02-20 Thread Ned Batchelder
end. > > I realize that I could put in the full URL but that seems like it > would be less flexible. I could also try and force the URL to always > end in a slash but I'm not sure how to go about that. Is there any > way to build a relative URL that appends onto the end of the URL in

Re: Docstring documentation

2009-02-27 Thread Ned Batchelder
> This occurs through introspection of view and template tags by using the >>> >> docutils module and the __doc__ attribute on functions, you can see how it >> occurs >> here:http://code.djangoproject.com/browser/django/trunk/django/contrib/adm... >> >

Re: generating PDF using Reportlab's SimpleDocTemplate

2007-08-23 Thread Ned Batchelder
generate pdf's of information from my application. I have played with >> the example of using reportlab found in the django documentation but >> it seems a bit tedious for my purposes (painting everyline). Being >> able to use SimpleDocTemplate would seem to be the better a

Re: URL dispatcher with filter

2007-08-26 Thread Ned Batchelder
e: > # not allowed; act as if user got the wrong url > raise Http404 > > > That action_mapping bit can be cleaned up some if you keep a > tight reign on your regexp for the definition of "whatever". In > the above case, because we only explici

Re: keeping SECRET_KEY secret

2007-11-02 Thread Ned Batchelder
hon file, so feel free to use the full power of the language as you > wish. > > Because of those two results -- it's hardly a snap decision and you have > full flexibility for doing whatever you want -- this really isn't a > decision we need to revisit. Let's move on. > > T

Re: Memory leak!

2008-10-16 Thread Ned Batchelder
y once in awhile? And can anyone see some > obvious no-no I'm doing below that would cause this, any way to delete > something somehow & fix the problem? > > Thanks in advance for any advice, > bill > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Ned Batchelder
it properly I > should use a datatype within PostgreSQL that supports what I am trying > to do, but alas Django doesn't support it and neither does the other > application. > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~

Re: Getting lists/dictionaries out of the database

2008-10-18 Thread Ned Batchelder
a datatype within PostgreSQL that supports what I am trying >> to do, but alas Django doesn't support it and neither does the other >> application. >> >> > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~

Re: Console output

2008-10-19 Thread Ned Batchelder
ldn't be using the built-in server in >> production. That's why it's called the development server. >> -- >> DR. >> > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are su

Re: setting a 'default' filter for templates

2008-10-23 Thread Ned Batchelder
h > is kind of ugly. > > So I'm wondering if there is some way to tell django to use my filter > for every output it makes for a specific template. Or maybe there is > yet another good solution for this? > > I hope you can help me, thanks in advance, > > Dennis &g

Re: Different settings.py files for server and development

2008-10-23 Thread Ned Batchelder
--- > > I would like some way to have settings-local import my settings.py > file and then override specific settings. Anyone know how to do this > cleanly? > > Thanks! > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~--

Re: Different settings.py files for server and development

2008-10-23 Thread Ned Batchelder
gt; > ... should work correct? > > In settings.py I have DEBUG=False and in settings-custom.py I have > DEBUG=True, but Im getting my 500.html page, so that means it is only > respecting the DEBUG setting in settings.py. > > Any ideas? > > Thanks > > On Oct 23, 5:04

Re: Different settings.py files for server and development

2008-10-23 Thread Ned Batchelder
And BTW, my bad. Change the except: line to except ImportError, then the syntax error from the dash will be apparent in your 500 page. --Ned. http://nedbatchelder.com Ned Batchelder wrote: > settings-custom isn't a valid Python file name, because a Python > identifier can't have

Re: Subtle Memory Leak Finally Found! (DEBUG is off)

2008-11-18 Thread Ned Batchelder
in > essence, a huge list. > > Maybe this post will help someone else also one thing I don't > understand: > > Why wasn't the memory returned to me after each page view? Why was an > apache off/on necessary to clear memory? And is there anything I can >

Re: dynamic method calling

2008-11-23 Thread Ned Batchelder
gt; Don't know if anyone would consider it more elegant but it doesn't use >> getattr :) >> >> -- >> steevhttp://www.daikaiju.org.uk/~steve/ >> > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~--

Re: parameter not getting passed to view function

2008-11-24 Thread Ned Batchelder
lo there" instead of "hello there TEST" > > urls.py > (r'^hello/(?P)\S+/$', 'swamiji.poll.views.hello') > > > Views.py > > def hello(request, who): > return HttpResponse("hello there %s" % who) > > --

Re: Add db tables on-the-fly

2008-06-22 Thread Ned Batchelder
bably do (using 0.96): >> >> from django.core.management import syncdb >>syncdb() >> >> Regards, >> >> -- >> Christian Joergensenhttp://www.technobabble.dk >> > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~

Re: python strings containing backslashes

2008-06-29 Thread Ned Batchelder
string makes sure there is no additional escaped special > characters. But you still need to escape the backslash. > > Here is a good read on all this: > http://www.python.org/doc/current/ref/strings.html > > + Leeland > > > > > -- Ned Batchelder, http

Re: "Eval" in templates?

2008-07-05 Thread Ned Batchelder
Now that you have an eval tag, maybe you don't need this, but I think Django already had a simpler solution to your problem: Context: buttonDecidedAtRunTime: 'button4.html' thisPage: "/some/path" blah.html: {% include buttonDecidedAtRunTime %} The argument to the include tag

Re: Sort a list of objects by an attribute of the objects

2008-07-08 Thread Ned Batchelder
def sort_by_attr_inplace(lst, attr): > lst[:] = sort_by_attr(lst, attr) > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &

Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder
opinion > on this matter? > > Thanks, > Matic Žgur > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

Re: Markup languages vs HTML

2008-07-08 Thread Ned Batchelder
The important consideration is what is the best representation for your data? Since you are talking about user-edited content, you need to think about the user experience, and what data format is best for your users. The database concerns don't really matter after that. If you users need

Re: escape filter

2008-07-15 Thread Ned Batchelder
{{ flatpage.content|escape }} > > > > > I was expecting to see all accented chars in title and contents to be > displayed properly escaped, however, I'm seing the "raw" chars. What am > I doing wrong? > > OTOH, is there a way to isntruct flatpages to

Re: Modulo of 4 not working right

2008-07-16 Thread Ned Batchelder
3) >>>> > 36 > > Of course, you're welcome to go with Scott's suggestion of doing all > the math in one line, but it loses a bit readability going that way. > On the flip side, it probably executes slightly faster, but probably > not enough to make m

Re: Dreamhost now supports Django

2008-07-17 Thread Ned Batchelder
> 0), then it's going to be problematic for them. Previously, Dreamhost > had been running a much older version of MySQLdb and I'd be very > interested in knowing for certain that they've upgraded at some point in > the past 12 months. > > Regards, > Malcolm > > > >

Re: django and sql databases

2008-09-03 Thread Ned Batchelder
r question - can one have > similar procedures to cron job's working with django? such as regular > maintenance or in my case creation of tables due to an external > factor. > > thanks > David > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-

Re: Double Slash in URL

2008-09-08 Thread Ned Batchelder
} > > myapp.urls > {{{ > urlpatterns = patterns('', > (r'^test/$', 'modwork.views.test.index'), > }}} > > > -- > Thomas Guettler, http://www.thomas-guettler.de/ > E-Mail <http://www.thomas-guettler.de/E-Mail>: guettli (*) >

Re: Django questions

2008-09-10 Thread Ned Batchelder
Python inside the views? >>> >> If you use an appropriate templating language that supports that, yes. >> > > I don't want to use a templating language, I'd want to use Python > itself inside the views. Possibl

Re: How to render a static html page and keep processing after?

2008-09-15 Thread Ned Batchelder
notified by email when their job > has finished running), whilst running the time-intensive task in the > background. > > Any advice will be appreciated. > > Thanks in advance, > Emily > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~--

Re: Sending a filtered array to HTML

2009-03-14 Thread Ned Batchelder
can't figure out how to initialize and populate the arrays in > views.py properly. What am I doing wrong? > > FYI, this is just an example. My actual arrays are much larger which > is why I can't just hard-code the two results. > > Thanks for any help you

Re: Decoding django user password

2009-04-29 Thread Ned Batchelder
t; auth_user table? It would be really interesting to see if there is any > problems in the users part of the web when new information and tasks > are added via admin web. > > regards, > > > > Miguel > Sent from Madrid, Spain > >

Re: issue when creating new project on windows

2009-06-05 Thread Ned Batchelder
happening ? > > I have the following in my path setting: > > C:\Python26;C:\Python26\Scripts; > > Thanks in advance > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you

Re: Moving the .py(c|o) files out of the app?

2009-09-27 Thread Ned Batchelder
Python doesn't give you a way to write the .pyc files anywhere except next to their .py files. But you can compile everything ahead of time, and then either move the .pyc files somewhere else or just delete the .py files (assuming you have another copy!) The python module compileall is just

Re: How to "convert" data of anonymous users who then sign up

2009-10-13 Thread Ned Batchelder
vpotter wrote: > Hm.. Using IP for this doesn't seem to be a good idea. What about > proxy users who will have proxy's IP or users of one subnetwork behind > the NAT? > I'd store some kind of id in user's cookies and then use it to detect > posts made by user anonymously > Yes, cookies are the

Re: OT: Django logo

2008-03-25 Thread Ned Batchelder
ow that site. I checked and matched 5 fonts, but none of > them was exactly it, but still does a great job recognizing the > letters! > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are

Re: How are you storing binary data in db

2008-03-28 Thread Ned Batchelder
;> A recipe is unlikely to be a large chunk of file data. Pictures of >>> food, sure, don't store those in the DB. Storing the text in the DB >>> also means you can make use of its full text searching capability. >>> > > > > -- Ned Batchelder, htt

Re: Best practice for databases and distributed development with Django

2008-04-03 Thread Ned Batchelder
ED]> > wrote: > >>> that developer has to inform all others of the changes so they all >>> make the change manually on their own local database. >>> >> you could have a mysql-changes.sql file in your app directories. it >> holds the ALTER, DROP, etc

Re: alternative to (r'^house/edit/(\d+)/$',ediHouse)?

2008-04-11 Thread Ned Batchelder
gt; > Can exposing the primary key in url be any security issue? > > (r'^house/edit/(\d+)/$',editHouse) > > Is there alternative way without exposing the primary key in url? > > Ashish > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-

Re: alternative to (r'^house/edit/(\d+)/$',ediHouse)?

2008-04-12 Thread Ned Batchelder
strictive parameters > in queries which can be defeated by changing the ids in url, if I use > primary ids. > > thanks > Ashish > > > On Apr 11, 8:06 pm, Ned Batchelder <[EMAIL PROTECTED]> wrote: > >> Strictly speaking, exposing the primary key is not a

Re: google search results, returned to your site?

2008-04-16 Thread Ned Batchelder
must be. to be able to retrieve google search >> results and display them on your own page... but how? >> >> > There might still be a way, but the easiest, cleanest, most > straightforward way has been switched off. > > Good luck! > > Jeff Anderson >

Re: newbie: Filter an inclusion tag

2008-06-16 Thread Ned Batchelder
> I don't know how can I filter it with truncatewords. > > {% i18n_attr auction 'description' LANGUAGE_CODE|truncatewords:10 %} > doesn't work. > > Any ideas? > > thanks > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~

Re: iterate over alphabet in template

2008-06-17 Thread Ned Batchelder
object_list_name : object_list, > 'base_template' : base_template, >'alphabet_string' : ascii_uppercase }, >RequestContext(request)) > > #my template > {% for letter

Re: Django's doctest clashes with coverage.py

2007-11-24 Thread Ned Batchelder
like this >> without the need to modify the Django core. >> > > I believe the author of coverage.py, Ned Batchelder, is on the list. > Has he said whether he's willing to have Django include it without > much hoop jumping? >

Re: Django's doctest clashes with coverage.py

2007-11-25 Thread Ned Batchelder
re back > to "think about the best way to handle the option", right? :) > > Ned: thanks for your work on the module, it is incredibly helpful > during testing. I spent the last two days adding tests and removing > unused code from my apps. > > -mk > > > > &

Re: making two-column table from one-column data

2007-12-02 Thread Ned Batchelder
thing like this: [(A, B), (C, D)...] etc. > > Thanks, > Andrej Kesely > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Memcached Shared Caching - What if one of the servers drops out?

2007-12-03 Thread Ned Batchelder
only seen one > error message about it. Specifically, I got the error on line 513 of > memcache.py that the "tuple index is out of range" when it tries a > self.mark_dead() method. > > It's making me rethink the idea of pooling my cache... >

Re: Combating submission form Spam

2007-12-06 Thread Ned Batchelder
. Darryl Ross wrote: > Hey All, > > One of the websites I run has started getting spam via the contact form. > > What is the recommended way of dealing with this? Do I need to go the > route of using something like django-captcha? > > Thanks for any insight. > > Re

Re: Prevent SQL-injection

2007-12-08 Thread Ned Batchelder
lt. I´m using _0.9.6.1_ not 0.9.1... Missed a "6" there. >>> >> Now that that is cleared up, it sounds like you are trying to do: >> >> from django.db.backend import quote_name >> >> try instead: >> >> from django.db import backe

Re: Tableless models?

2007-12-13 Thread Ned Batchelder
> > Curiously, ticket #419 has to do with enabling tableless models, but > it was resolved as "duplicate", with no reference to any other ticket. > Has this really been resolved, and if so, what happened? > > Thanks > > n &g

Re: How to modify every element in a list all at once

2007-12-15 Thread Ned Batchelder
lement by .9. Here is my code that > creates the above list: > > s2 = b.sandp.order_by('orderdisplay') > > I know that I can do 's2[0].price * .9'. However, that just modifies > the first element. Is there anyway that I can do this for every > element all at once? > >

Re: Passing a dictionary as a query argument?

2007-12-17 Thread Ned Batchelder
I presume >> Django is doing this by iterating over the dictionary, but obviously >> this doesn't work for my field. Is there any way to stop Django from >> doing this, away from overriding query methods in the manager to >> convert the dictionary to something non-itera

How to create an "iffirst" tag?

2007-12-28 Thread Ned Batchelder
f I do have this tag: the comma will have space before it). So, two questions: 1) How would I create a tag like this, and 2) is there some simpler way to achieve my purpose? --Ned. -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received

Re: How to create an "iffirst" tag?

2007-12-28 Thread Ned Batchelder
Just a matter of taste. I suppose filtering in the view would be the simplest way to achieve what I'm looking for. For my own edification: is there a way to write an iffirst tag? I often wish for it. --Ned. Todd O'Bryan wrote: > On Dec 28, 2007 2:46 PM, Ned Batchelder <[EMAIL PRO

Re: How to create an "iffirst" tag?

2007-12-28 Thread Ned Batchelder
PM, Ned Batchelder <[EMAIL PROTECTED]> wrote: > >> I'm making a list of objects, and only including some of them in the output: >> >> {% for thing in mylist %} >>{% if thing.test %} >> {{thing}} >>{% endif %} >> {%

Re: How to create an "iffirst" tag?

2007-12-28 Thread Ned Batchelder
in the if clause: {% for thing in mylist %} {% if thing.test %} {% iffirst %}Things: {% else %}, {% endiffirst %} {{thing}} {% endif %} {% endfor %} --Ned. Malcolm Tredinnick wrote: > On Fri, 2007-12-28 at 15:36 -0500, Ned Batchelder wrote: > &

Re: How to create an "iffirst" tag?

2007-12-31 Thread Ned Batchelder
(again, without recompiling) was enough to break most of my attempts. > > It's also not too hard to extend this to be check whether this is the > first time around the parent loop using a similar method, although > nested "iffirst" tags seems hard. > > Best wishes, > Malc

Re: How to create an "iffirst" tag?

2008-01-01 Thread Ned Batchelder
I tried out this change, and it works well. I've created a ticket (http://code.djangoproject.com/ticket/6295) with a patch. --Ned. http://nedbatchelder.com Ned Batchelder wrote: > Malcolm, thanks for continuing this (I was away for a few days). I > was thinking about the forloop int

Re: How to create an "iffirst" tag?

2008-01-02 Thread Ned Batchelder
I may be the only one still interested in this, but the patch got incorporated yesterday (http://code.djangoproject.com/changeset/6981), so Malcolm, your original idea will now work. --Ned. Ned Batchelder wrote: > I tried out this change, and it works well. I've created a ticket >

Re: Printable article page URLs?

2008-01-02 Thread Ned Batchelder
>> So what do you folks suggest for printable versions of article pages? >> Please don't suggest CSS, I know about it and it's not really an >> option for me. >> >> Thanks, >> Mordy >> > > > > -- Ned Batchelder, http://nedbatche

Re: Printable article page URLs?

2008-01-02 Thread Ned Batchelder
robots.txt fix. The second one > is also "ugly" in my subjective django-influenced opinion. > > So what do you folks suggest for printable versions of article pages? > Please don't suggest CSS, I know about it and it's not really an > option for me. > > Tha

Re: Printable article page URLs?

2008-01-03 Thread Ned Batchelder
hen use /foos/my-foo-slug. for the contained > resources in their own flavor of format. > > In the OP's case, printable versions can be URL'd as > http://example.com/foo.prn or > http://example.com/foo.prn.html or what have you. Or maybe > use .xhtml for XHTML content, and .htm for a p

Re: The timeuntil / timesince filter doesn't handle time objects -- was that a design decision, or was that something that got overlooked?

2008-01-08 Thread Ned Batchelder
se. Those filters are useful for > displaying how long since (or until) a particular moment in time. A > "time" object isn't specific enough, since it doesn't specify the day, > so it isn't really a moment in time -- it's an infinite number of > moments in time.

Re: template for loop problems

2008-01-13 Thread Ned Batchelder
n > {{ assayDict.methods }} > > it seems like the var {{ assayDict.methods }} can't be put in the for > loop. > > does anyone have a idea how to construct this list based on the array > in python ? > > any help would be greatly appreciated, > > Richard > > > >

Re: best practices for a production site

2008-01-19 Thread Ned Batchelder
Updating to just a particular revision may work, but it is very easy for the trunk to get into a state where it would be hard to pick out just the fixes by updating specific files to specific revisions. This is labor intensive and confusing, and therefore error prone. Other people in this

Re: Trouble with pattern in urls.py

2008-01-23 Thread Ned Batchelder
me/(?P\d+)/(?P\d+)/ > $','mysite.chef.views.sort_recipes'), > (r'^admin/', include('django.contrib.admin.urls')), > (r'^chef/', include('mysite.chef.urls')), > ) > > Instead I get a Page not found (404) error. All of my other requests > work fine. Any thoughts

Re: pdf/Firefox and turning off GZipMiddleware

2008-01-25 Thread Ned Batchelder
though, so > two questions (1) does it seem reasonable that GZipMiddleware is the > problem and if so (2) is there a way to turn it off on a per-view > basis? > > -- bjorn > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~

Re: multiple function arguments

2008-01-27 Thread Ned Batchelder
, > path2=path2, filename=filename, slug=self.slug) > > path1, path2, filename and slug are all strings. num_pages is an > integer. > > Is this not the way to do this? The error message is making no sense. > > Any insight is much appreciated. > > > > -- Ne

Re: Template help, gotta be simple

2008-02-02 Thread Ned Batchelder
ields, 'data': data})) > > I want to print out the data items row-by-row but skipping 'f2' since > it's not listed in 'fields'. The above is how it seems like it ought to > work, but it just ignores me. Lots of other crazy permutations didn't > work either. > > Can someone s

Re: problems with custom template library

2008-02-03 Thread Ned Batchelder
sure what else you might have meant by running from the > shell. > Thanks for your help. > > Jonathan > >> -- >> >> regards >> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ >> Foss Conference for the common man:http://registration.fossconf.

Re: problems with custom template library

2008-02-03 Thread Ned Batchelder
> from django.template import Library > from lukenslanguages.weblog.models import Entry > > register = Library() > > @register.filter > def category_url(entry_id): > e = Entry.objects.get(id=entry_id) > return e.category.url > > I think that this is

Re: template: how to make use of forloop.counter0

2008-02-04 Thread Ned Batchelder
The more I think about your questions, the more I think Django could use a |get filter that would be similar in spirit to the |slice filter. |get would be used to get an attribute or index of an object. Then you could use: This |get filter is something I just made up, so it is not

Re: Best way to template "," and "and" separated lists?

2008-02-07 Thread Ned Batchelder
{{ pubauthor.author }} a>{% if forloop.last %}{% else %}{% ifequal forloop.revcounter 2 %} > and {% else %}, > {% endifequal %} > {% endif %} > {% endfor %} > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~

Re: About to give up!!!

2008-02-09 Thread Ned Batchelder
this and serving it > up, without even looking for any other url patterns. In fact, I'll > wager that if you fire up > http://localhost:8000/site_media/my_image.jpg in your browser, you'll > see the exact same thing as http://localhost:8000/. > > -Gul > > > > >

Re: is_secure() behind reverse proxy

2008-02-18 Thread Ned Batchelder
> request is SSL, I have some middleware to do this, but it relies on > is_secure(). Any suggestions? > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Domain Parsing Question

2008-02-18 Thread Ned Batchelder
not domain.co.uk! > > example: getDomain('bbc.co.uk') returns 'co.uk' > > Any one know of a standard protocol for parsing these urls, or do I > have to find all the unique instances of co.uk, or co.nz etc. > > Thanks > > > > > -- Ned Batchelder, http://nedbatch

Re: Using HttpResponse as a file - 'HttpResponse' object has no attribute 'seek' error

2008-02-21 Thread Ned Batchelder
oduce a string. That > string is sent back to the user. Since ZipFile wants something that acts > as a file, you need to turn the HttpResponse into something like that. > Try using StringIO. > > Regards, > Malcolm > > -- Ned Batchelder, http://nedbatchelder.com --~--~--

Re: A Python question

2008-03-24 Thread Ned Batchelder
if arg==True: > caller_frame = inspect.stack()[1] > ... > > Here 'caller_frame' contains the frame of the caller function. Now, > how can I make that frame return a particular value? > > Hope that was clear... :/ > > Thanks! > > Julien > > >

Re: makemessages failing to extract all strings from Javascript

2011-04-12 Thread Ned Batchelder
Django's Javascript message parsing is fragile. The full details are here: http://nedbatchelder.com/blog/201104/a_javascript_lexer_in_python_and_the_saga_behind_it.html I've written a patch and attached it to ticket 7704, http://code.djangoproject.com/ticket/7704. I was hoping to get it into

Re: Django Schema Migration

2007-04-19 Thread Ned Batchelder
uld automatically get > run and a log kept so that migrations do not run twice. > > Does this sound useful to anyone who is doing automated deployments? > > Mike > > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~--

Re: Cannot resolve keyword into field

2007-04-23 Thread Ned Batchelder
e tried version 0.95, 0.96 and svn trunk. All throw the same error- >>> TypeError: Cannot resolve keyword 'book' into field >>> When I try the same through "python manage.py shell" interactive >>> shell, i.e. by entering the two lines above, it works fine

Re: About create a database table dynamicly

2007-07-14 Thread Ned Batchelder
Django seems has no topic about this, anyone has any idea on it?Thank you > > Best wishes, > Nick > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: URL design for security?

2007-07-15 Thread Ned Batchelder
ault: > http://www.djangoproject.com/documentation/model-api/#automatic-primary-key-fields > > A student's row number isn't sensitive. > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this

Re: About create a database table dynamicly

2007-07-16 Thread Ned Batchelder
s very > fragile to avoid doing something that databases are designed to handle. > Don't optimise prematurely. > > Regards, > Malcolm > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message b

Re: regex in url

2007-07-17 Thread Ned Batchelder
m looking for the explanation of ?P syntax, is this >>> something related to python's regex or django's own regex. >>> >> python >> >> -- >> >> regards >> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/ >> > > &

Re: Random character in rendered HTML

2007-07-23 Thread Ned Batchelder
is character. > > The issue is that this character is creating a newline in IE, but > Firefox ignores it just fine. > > Any help on the topic would be greatly appreciated. I've searched > around and asked everyone I know to no result. Thanks in advance. > > -Sean Stoops &g

Re: Your Approach to Schema Evolution?

2006-12-24 Thread Ned Batchelder
t them in manually These two are fine for a single developer's purposes, but what about if you want to distribute your app to others? You'd have to come up with some automated process, even if it's hand-coded. I really hope Django gets a migration feature like RoR's sometime soon. >

Re: image response from Httpresponse

2007-02-10 Thread Ned Batchelder
return response() > > Is it completely wrong? Please help... > > Thanks, Lasse > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: DB API - dict of emails

2007-02-10 Thread Ned Batchelder
'foo', 'email': '[EMAIL PROTECTED]'}, >> {'username': 'bar', 'email': '[EMAIL PROTECTED]'}] >> >> Is it possible to get a dict like this with Django's db api?: >> {'foo':'[EMAIL PROTECTED]', 'bar':'[EMAIL PROTECTED]'} >> > > No, it is not possible to get that sort

Re: Model instance identity

2007-02-15 Thread Ned Batchelder
I think in this case the Python docs were mis-interpreted. The key point to consider when writing a __hash__ function is that two objects that compare equal must hash equally, and the hash value cannot change. Just because an object is mutable doesn't mean that these rules will be violated. In

Re: from .95 to six

2007-02-27 Thread Ned Batchelder
sion as Django > 0.96. The most recent release is 0.95.1. > > Yours, > Russ Magee %-) > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: debugging/breakpointing

2007-03-09 Thread Ned Batchelder
ome listener script I need to run? > > >> just before the django >> handler is called. After that you can step, set breakpoints, etc. >> > > Is there a tutorial or howto for all of this? > > > Thanks, > > > -- Ned Batchelder, http://nedb

Re: Designing for Speed - conditionals inside the view versus the template

2007-03-12 Thread Ned Batchelder
tory of software is littered with code that was > extremely efficient but impossible to maintain or adapt to changing > requirements. You can double your application's performance by buying > or leasing a new box + more memory next year. What % improvement do you > think code

Re: Deployment with Subversion

2007-03-14 Thread Ned Batchelder
e them carefully). > > For my personal work, I keep my settings.py files for production > settings outside of the project directory so that I can just untar the > new version of the code, update a symlink to the latest version and > reload the webserver process, without needing to remem

Re: Django Powered Tabblo to be acquired by HP

2007-03-23 Thread Ned Batchelder
esh Joshi, EVP at HP said: "By acquiring Tabblo's technology and > making it available to companies that host popular websites, HP will > be firmly on the path to becoming the print engine of the web." > > As Ned Batchelder wrote, acquiring technology was not the point. > In

  1   2   >