Re: dynamically excluding fields in admin form

2010-02-28 Thread Simon Davies
obj == None: del form.base_fields['cancelled'] return form On 28 Feb, 13:00, Simon Davies wrote: > Hi > > I have a model which I access from the admin application.  I want to > exclude some fields dynamically. > > My model looks like this: >

stackedinline admin form-set collapse

2010-03-01 Thread Simon Davies
Is there a way to collapse the stacked inline form-sets in the admin app, a parameter I can define in admin.py for inline class. Ideally this would work so I could have extra=1, which would give me the functionality of clicking to open the form to add another object. Thanks Simon -- You

generic relations with admin

2010-03-04 Thread Simon Davies
is that when I click on a cart to view in admin, I the CartItem objects but not the Accessory objects themselves, or any other types of item. With the model design the way it is, I don't see a way of getting the admin app to do what I want, so is my model design flawed and is there a be

Python's Class members ...

2010-03-08 Thread JF Simon
Hi dudes, My object seems mysterious, as is my problem ... I'd like to understand something (it's much more related to Python than Django). Take an example : class Image(models.Model): email = models.ForeignKey('Email', verbose_name=_(u'Email')) name = models.CharField(_(u'Name'), max_le

Re: gintare

2010-03-08 Thread Simon Brunning
ut what it's called is to ask all your neighbours (namespaces) if it's their cat (object) ... and don't be surprised if you'll find that it's known by many names, or no name at all!" - Fredrik Lundh. -- Cheers, Simon B. -- You received this message because you a

Re: Python's Class members ...

2010-03-08 Thread JF Simon
Thanks for your *really* interesting explanations. It seems more clear to me and I'm going to read all about derscriptors ! Python is a facinating language ... On 8 mar, 09:16, Masklinn wrote: > On 8 Mar 2010, at 09:01 , JF Simon wrote: > > > > > Hi dudes, > > >

Re: django buildout trouble

2010-03-18 Thread Simon Brunning
good deal more detail. -- Cheers, Simon B. -- 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...@googleg

Re: [django-users] FileBrowser v 2.0

2007-06-07 Thread Simon Drabble
e duplicating wheel-construction so if you have tagging support planned or available I may take a look at your app. -Simon. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: [django-users] Re: Including [django-users] in subject line?

2007-06-09 Thread Simon Drabble
=== # Tag django mailing list # :0 * To: [EMAIL PROTECTED] { :0 fhc | sed -e 's/^Subject: /Subject: [django-users] /' } ..not that I necessarily disagree with the OP's point, bu

Re: [django-users] Re: Spawning long processes

2007-07-05 Thread Simon Drabble
args = (script, '/path/to/executable', ...) env = { ... } pid = subprocess.Popen(args, close_fds=True, env=env).pid t = Torrent.objects.create(pid=pid) ... Remember to store the pid for later wait()ing or you'll end up with zombies. -Simon. >

Re: Spawning long processes

2007-07-05 Thread Simon Drabble
can you see it with ps)? What OS are you using, and have you verified that the code you are uring works outside of django (write a small shell script that does nothing but call the external torrent process - does that work as expected?). -Simon. > On Jul 5, 2:57 pm, Simon Drabble <[EMAIL PROTECTED

Re: session in all templates?

2007-07-11 Thread Simon Drabble
menu, depends on if there is a > logged in user or not. > > Thanks, > Martin > Extend your templates from a common base, with the session info in the base. -Simon -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: session in all templates?

2007-07-11 Thread Simon Drabble
On Wed, 11 Jul 2007, Martin Kaffanke wrote: > Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble: >> On Wed, 11 Jul 2007, Martin Kaffanke wrote: >> >>> Hi there! >>> >>> How can I configure django to put the session (request.session) in

Re: Serving large files through HttpResponse

2007-08-20 Thread Simon Willison
well be worth putting it behind an nginx proxy purely to gain access to this feature. nginx is a really neat reverse proxy - I run simonwillison.net as nginx proxying through to mod_python/Apache for the dynamic pages and it's been working great

Re: Basic Form Design Question: Pulling as much as possible from models

2008-01-07 Thread Simon Willison
On Jan 7, 5:07 pm, Wes Winham <[EMAIL PROTECTED]> wrote: > http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ > > A shiny solution to the problem with code and the reasoning behind it. > Simon Willison is awesome. It's Malcolm that's awesome, I jus

Job: Django developer in central London

2008-01-07 Thread Simon Willison
questions about either the job or GCap feel free to contact me directly (don't reply to the whole list). Cheers, Simon Willison --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Context processor a bit too helpful

2008-01-07 Thread Simon Willison
fe" in your context processor: from django.utils.safestring import mark_safe def bold_word(request): html = mark_safe("A bold word.") return {'bold_word': html,} Cheers, Simon --~--~-~--~~~---~--~~ You received this mes

Re: IIS support revived

2008-01-11 Thread Simon Rivada
Thanks for the effort, I'll look into it in some time! Phillip wrote: > Just updated PyISAPIe with support for Python 2.5 and the latest > Django release. You can either use the Django-specific handler or the > WSGI adapter (example included). > > No installer yet, but there is new documentation

Re: How it's ugettext_noop() used?

2008-01-15 Thread Simon Rivada
To quote the documentation (http://www.djangoproject.com/documentation/i18n/) on this one: Use the function django.utils.translation.ugettext_noop() to mark a string as a translation string without translating it. The string is later translated from a variable. Use this if you have constant st

Re: about dpaste

2008-01-17 Thread Simon Rivada
As far as I know there is no search engine present at dpaste.com. Lic. José M. Rodriguez Bacallao wrote: > Hi folks, I need to know how can I search, explore for codes in > http://dpaste.com/ > I really can't figure out how. > > --~--~-~--~~~---~--~~ You receiv

Re: considering django for The Freesound Project, some (de)constructive critisism

2008-01-22 Thread Simon Willison
omes in, then splurge it all through to the application running behind it at once when the whole file is available to the load balancer. I'm pretty sure Perlbal has this ability. Would this solve your file upload problem, or is there something else that I'm mi

datetime 8 hours off

2008-04-01 Thread Simon Oberhammer
hey group, I have an inconsistant time problem, which goes away when I restart apache, but then creeps up again after some time. When writing comments in my custom app the time is 8hours behind (i'm CEST) *for some users*. When I login with others, its okay. in settings.py I have TIME_ZONE = 'Eur

Re: datetime 8 hours off

2008-04-01 Thread Simon Oberhammer
> What version of Django are you using?, what deployment method > are you using? (mod_python, fast cgi, mod_wscgi). i'm using mod_python and am running the current svn django. I've found an open timezone bug, but don't think its related http://code.djangoproject.com/changeset/7184 --~--~-

Re: datetime 8 hours off

2008-04-02 Thread Simon Oberhammer
anybody? after restartign apache everything is fine again.. i have to do this once or twice a day. On Apr 1, 9:15 pm, Simon Oberhammer <[EMAIL PROTECTED]> wrote: > > What version of Django are you using?, what deployment method > > are you using? (mod_python, fast cgi, mod_wsc

Re: datetime 8 hours off

2008-04-02 Thread Simon Oberhammer
thanks, i will try fastcgi tomorrow and report back. > Is the time constantly 8 hours behind or does that vary e.g. does the > offset get larger over time? it's always 8 hours behind, but not reproducable. though it happens everyday. there are php sites running on the server.. well let's see if

Re: tags separated by comma

2008-04-02 Thread Simon Oberhammer
there is already an easy to intergrate django-tagging app, http://code.google.com/p/django-tagging/ I have used and, though not the more complex features like tag AND-OR- filter thingies. it worked good for me. On 3 Apr., 01:40, ameriblog <[EMAIL PROTECTED]> wrote: > i'm interested in my politi

Re: Best practice for databases and distributed development with Django

2008-04-02 Thread Simon Oberhammer
> 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. statements. put it under SVN. when you get a new rev with the comment "db ch

Re: datetime 8 hours off

2008-04-04 Thread Simon Oberhammer
Magus on IRC told me that multiple django projects with different timezones serverd by apache / mod_python could be a problem - ie one changing TZ in a thread that also servers the other project. So I set timezone-setting to Vienna/Europe for all of them and have not seen then datetime-problem si

How to change language by clicking on link (using GET not POST) (set_language redirect)

2008-04-14 Thread Simon Tite
The documentation on how the user can change the language of a page/ site (from: http://www.djangoproject.com/documentation/i18n/), in the section "The set_language redirect view", gives the following code: {% for lang in LANGUAGES %} {{ lang.1 }} {% endfor %} This of course means the u

Re: How to change language by clicking on link (using GET not POST) (set_language redirect)

2008-04-15 Thread Simon Tite
ntical to all the other links. Without coding any extra CSS, specially for this type of "form". One thing though tony, thanks for putting your example in a loop, i.e one form per language, I was going to put all four languages into one form, then a submit button. Back to Programming 101

Re: Queryset-refactor branch has been merged into trunk

2008-04-27 Thread Simon Willison
On Apr 27, 8:48 am, Thierry <[EMAIL PROTECTED]> wrote: > What's the current opinion about integrating sql alchemy into the > backend of django's ORM? There's an active project to do exactly that hosted here: http://gitorious.org/projects/django-sqlalchemy/ Some of the features in queryset-refac

Re: sql_queries does not include all the sql statements

2008-04-29 Thread Simon Willison
cause the query to be run straight away; instead, it adds limit and potentially offset clauses to the SQL statement that is being prepared by the QuerySet. Hope that clears things up, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: need to use both django 0.96 and django trunk for work

2008-04-29 Thread Simon Willison
ents (with different stuff installed on the python path) on the same machine: http://pypi.python.org/pypi/virtualenv Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: Problem about Url

2008-05-20 Thread Simon Tite
query=request.GET("query") if "page" in request.GET("page") page=request.GET("page") #go get the data or whatever you need to do... return render_to_response("firstpage.html",locals())#or whatever

Re: Problem about Url

2008-05-20 Thread Simon Tite
Correction to last message: def intropage: query="some default value" page="1" #(default to page 1) if "query" in request.GET: query=request.GET("query") if "page" in request.GET: page=request.GET("page") #go get the dat

Re: load external xml and css with varibles?

2008-05-20 Thread Simon Tite
I'm afraid I don't quite understand all of your question, but I can possibly answer part of it, although please bear in mind I'm quite new at Django, so there may be better ways of doing it. On May 19, 11:50 am, sebey <[EMAIL PROTECTED]> wrote: > > I am thinking about making a template that has t

Some Django debugging tips

2008-05-22 Thread Simon Willison
Hi all, I've written up a bunch of techniques for debugging Django applications: http://simonwillison.net/2008/May/22/debugging/ I'm collecting more tips in the comments. Cheers, Simon --~--~-~--~~~---~--~~ You received this message becau

Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
I get the following error when trying to save a model - "userprofile.save()" - (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'), `gender` = ("\'F\'",), `hideyear` = (\'0\',), `address` = ("\'97 Rochda

Re: Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
On Jun 30, 10:02 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Simon, my guess is that the error doesn't have to do with the truncation you > see, but that something that is passing the error along is trying to be > helpful by truncating the string -- one hope

Re: Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
; ' F ' ", ... (i've put in extra spaces between the quotes for clarity). In which case your suggestion that it is trying to update a single- character field with three characters makes a lot of sense. So, ok genius :), where are the extra quotes coming from, and how can I

Re: Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
assed to the database engine? Is this possible? I suppose it must be, if I spent several hours diving into the Django source, but hopefully somebody knows an easier way? Somebody? Anybody? On Jun 30, 10:32 pm, Simon Tite <[EMAIL PROTECTED]> wrote: > Thanks Scott, for the speedy reply. > &

Re: Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
correction: the mySql command line which works is: UPDATE `app_userprofile` SET `telephone`=("'123 123'") WHERE `app_userprofile`.`id` = 1; On Jul 1, 1:14 am, Simon Tite <[EMAIL PROTECTED]> wrote: > Well, the quotes thing seems perhaps to be a bit of a red herr

Re: Programming error 1064 - possibly bad string length?

2008-06-30 Thread Simon Tite
n Karen, and Scott, for helping an idiot! :) At least now, I'm a *happy* idiot! On Jul 1, 1:57 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 30, 2008 at 7:36 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > > On Mon, Jun 30, 2008 at 7:19 PM, Simon Tite

Django newforms RadioSelect issue

2008-06-30 Thread Simon Li
he code is rendered to html is: Administrator Normal User I do NOT like the etc, I hope it can be rendered to simple format, Administrator Normal User I want to get ride of the , could you guys help me? Best Regards -Simon Li --~--~-~--~~~---~--~~ You re

Implementing OpenID in your Django app

2007-04-23 Thread Simon Willison
feedback, both concerning the API and features that would make useful additions. My plan for the next version is to include tools for associating OpenIDs with Django user accounts. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Newforms and Hidden Fields - verifying POST data

2007-04-23 Thread Simon Willison
ckled).hexdigest(): raise NastyError, "You tampered with my data!" else: my_data = pickle.loads(pickled.decode('base64')) The same technique can be used in lots of other places - cookies for example. The only way the user can tamper with th

Re: browser detection middleware

2007-05-22 Thread Simon Willison
but many proxies are notoriously badly written so I'm not sure that I'd trust it. Much better to serve up a standards compliant site for Firefox/Safari/Opera and have a single stylsheet included using conditional comments for any specific IE fixes. Cheers, Simon --~--~-~--~~---

Re: Very large scale sites in Django

2007-06-02 Thread Simon Willison
On May 31, 5:30 pm, Daniel Ellison <[EMAIL PROTECTED]> wrote: > A quick glance at the memcached site says that it's used on LiveJournal, which > gets over 20,000,000 page requests per day. Excellent. Not quite at our > traffic level, but not too shabby. :) Memcached is pretty much the industry st

access session out of view, howto find out sessionkey?

2007-10-19 Thread Simon Oberhammer
rs are not necessarily logged in thanks simon --~--~-~--~~~---~--~~ 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.com To unsubscribe from this group,

Re: access session out of view, howto find out sessionkey?

2007-10-19 Thread Simon Oberhammer
wow, I'm glad there is a cookbook entry for this :-) thank you On Oct 19, 3:30 pm, skam <[EMAIL PROTECTED]> wrote: > You should be able to build a middleware similar > tohttp://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser, > getting request.session instead of request.user --~--~

Re: Using a signal to update a counter cache??

2007-11-30 Thread Simon Willison
l at OSCON this year (in the unit testing section) - you may find the slides from the tutorial useful: http://toys.jacobian.org/presentations/2007/oscon/tutorial/ Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: pure-HTTP deployment?

2006-12-20 Thread Simon Willison
Jacob Kaplan-Moss wrote: On 12/20/06 2:23 PM, Chad Whitacre wrote: > I'm interested in deploying Django as a pure-Python HTTP daemon, much > like Zope and CherryPy are deployed. Is this done at all w/ Django? I'm pretty sure that's how Simon is serving his

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
Chad Whitacre wrote: Simon, Well, after that I have to tip my hand. :^) I've started such a project, called Aspen: http://www.zetadev.com/software/aspen/ I've got a bit of a philosophical problem with Aspen - the fact that it supports "five different development patterns&q

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
. Matt Biddulph wrote a tiny-app in Camping (a Rails micro-framework), set it running under Mongrel, pointed a reverse proxy at it and released it to the world. If he builds something else it can have its own Mongrel. That's the ease of config

Re: serving multiple hosts from a single django instance ?

2006-12-21 Thread Simon Willison
Sort of. I've achieved this in the past with a bit of ugliness - basically, I pointed everything at the same view and wrote my own code within it that dispatched based on the hostname. There's an open proposal at the moment to make the url dispatching logic a view function itself (a view that dis

Re: pure-HTTP deployment?

2006-12-21 Thread Simon Willison
Simon Willison wrote: I'm interested in this for a couple of reasons. Firstly, it's less bits of software - if we could tell people "Install Django, install Reinhardt[1]... That [1] was meant to be accompanied with a footnote saying that Reinhardt would be an awesome name fo

Re: pure-HTTP deployment?

2006-12-22 Thread Simon Willison
Sylvain Hellegouarch wrote: I'd be interested to know which version of CP Simon was running. CP3 is way more stable, efficient and comprehensive that CP2 (and its WSGI server is like ten steps ahead). __version__ = '3.0.0beta2' I'm really interested as to what kin

Re: textarea - autoamtic line break

2007-02-02 Thread Simon Brunning
write your own? <http://docs.python.org/lib/module-textwrap.html> -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

(DB related?) Memory leak with apache and mod_python

2007-02-11 Thread Mason Simon
I'm developing a Django project on Webfaction, and I noticed my memory leaking. To isolate the cause, I started a fresh project. The only things I changed in this brand new django project were the DEBUG setting, which I set to False, and the database settings, which I configured for a sqlite3 file

Trouble resolving URLs

2006-05-17 Thread Simon Johnston
I have followed the tutorials in setting up a basic index and detail page for one of my model classes. I created the project level urls.py as follows: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^accounts/$', include('RealLife.crm.urls')), (r'^admin/', include('d

Re: Trouble resolving URLs

2006-05-18 Thread Simon Johnston
Thanks to both Michael and Ivan - I spent all my time staring at the new urls file and not at the original project file :-( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: Ajax support, there is no need for reinventing the wheel

2006-06-05 Thread Simon Willison
uff on Twisted deferreds - which means MochiKit callbacks end up looking like this: var d = loadJSONDoc("example.json"); d.addCallback(gotDocument); d.addErrback(logError); You can also 'chain' callbacks and errbacks, which lets you do some really i

Re: Serious Noobie question, what the $ for in urlpatterns.

2006-06-06 Thread Simon Willison
ns are tried against the URL that has been entered in order. '^polls/' without a $ will match any URL that starts with the string 'polls/', thus terminating the lookup at that point. If you include the dollar, strings that start with

Re: Site testing How-To

2006-06-07 Thread Simon Willison
project. Fixing this would be another feather in Django's cap. Cheers, Simon --~--~-~--~~~---~--~~ 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@goog

Re: Site testing How-To

2006-06-07 Thread Simon Willison
, but your tests should be able to just set the > DJANGO_SETTINGS_MODULE env variable to use the myproject.testsettings > module. You can also use the ./manage.py --settings=myproject.testsettings command-line flag if you don't want to mess around with your e

Re: Global Escape

2006-06-09 Thread Simon Willison
__getitem__(self, key): value = super(Context, self)[key] return escape(value) You would also need to add your own 'unescape' custom template filter that reverses the effects of escape for cases where you needed to do that. Maybe unescape would be a u

Re: Mod_python and Django - PROBLEM

2006-06-10 Thread Simon Willison
case they wouldn't be sharing the same site-packages directories. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: how to integrate kid template with django

2006-06-14 Thread Simon Willison
ver method you want to generate the content to be sent back in the HttpResponse. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: OT: dynamically generated files?

2006-06-22 Thread Simon Willison
On 22 Jun 2006, at 21:33, Scott Finnie wrote: > My proposed solution is to insert the session id into the filename > (since, for a given session, there can only be one image used at any > given time). That should work but will need a cleanup job to clear > the > temp dir periodically. > > So

Re: Repetitive background tasks

2006-06-26 Thread Simon Willison
world is "Scheduled Tasks". There's a thread here that might be useful to you: http://weblogs.asp.net/pmarcucci/archive/2003/10/20/32662.aspx Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Adding search functionality

2006-06-27 Thread Simon Willison
e are instructions on upgrading from 0.9.1 here: http://code.djangoproject.com/wiki/RemovingTheMagic Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Request_Response Problem

2006-06-27 Thread Simon Willison
while request.GET.getlist (key) will always return a list of strings (or an empty list). Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: ImportError: No module named django

2006-06-28 Thread Simon Willison
gt; > I'm running Python 2.4.3 in case that matters - any ideas? It sounds like you might have two versions of Python installed. You should confirm that the shebang line in ./manage.py is for the right version. Alternatively, running 'py

Re: Store and retrieve template code from database

2006-07-05 Thread Simon Willison
ing signature: def load_template_source(template_name, template_dirs=None): ... Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: book recommendations?

2006-07-10 Thread Simon Willison
On 10 Jul 2006, at 06:42, arthur debert wrote: > also, simon willison's javascript introduction is excellent: > > http://flickr.com/photos/simon/sets/72057594077197868/ There's a better version of it up on the Mozilla Developer wiki now - other people have been fixing al

Re: debugging xmlhttprequest POST's is a PAIN! Need help.

2006-07-14 Thread Simon Willison
bit. Get yourself Firefox and the LiveHTTPHeaders extension - it's perfect for debugging this kind of thing: http://livehttpheaders.mozdev.org/ Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: Related tags query, many-to-many double join

2006-07-19 Thread Simon Willison
ng a raw SQL query, write a raw SQL query! As long as you keep all of the SQL interactions in your Django model classes your database logic will all be in the same place and maintenance should be simple. Cheers, Simon --~--~-~--~~~---~--~~ You received this m

Re: Displaying thumbnails in the admin interface

2006-07-19 Thread Simon Willison
eturned the raw html.. You need to add the just-documented allow_tags attribute to your custom method: http://code.djangoproject.com/changeset/3358 Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Django v code generators (codecharge)

2006-07-20 Thread Simon Willison
hon). Historical note: the Django ORM was originally written as a code generator, but was refactored over a year ago to use metaclasses (a dynamic language feature) to achieve the same effect in a more elegant, more maintainable way. Hope th

Re: Duct tape

2006-07-21 Thread Simon Willison
h contrib application should index models. There's no magic here - just a neat way of adding namespaced metadata to models without cluttering things up too much. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: Any good Python book recommendations?

2006-07-22 Thread Simon Willison
hon and want to learn for > use with Django. The "Learning Python" O'Reilly book is really, really good - one of the best "Learning X" books I've read for any language. Cheers, Simon --~--~-~--~~~---~--~~ You received this messag

Re: AttributeError: class Http404 has no attribute 'has_header'

2006-07-24 Thread Simon Willison
s returned an object that is an instance (or subclass) of HttpResponse. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: simplejson & umlauts

2006-07-24 Thread Simon Willison
8') # u is now a unicode string >>> print simplejson.dumps(u) "r\u00f6ck d\u00f6ts" That last line is the correct way of representing unicode in JSON. If you paste that in to Firebug it renders as "röck döts". Hope that helps, Simon --~--~-~--~

Re: Wondering about few 'burried' issues

2006-07-27 Thread Simon Willison
it. The Django core developers try to always leave an explanation when they close a ticket. Cheers, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Myghty Templates in Django - ver. 1

2006-08-01 Thread Simon Willison
le object. Django's design ensures that templating is decoupled from views, so if you want to use myghty you can just do this: from django.http import HttpResponse def myview(request): response = HttpResponse() # A file-like object interp

Django covered in podcast with Guido

2006-08-05 Thread Simon Willison
http://www.twit.tv/floss11 Django gets some good discussion about 50 minutes in. --~--~-~--~~~---~--~~ 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.

Re: Planet Django

2005-08-04 Thread Simon Willison
7;s mine: http://simon.incutio.com/syndicate/django/rss1.0 Cheers, Simon

Any live Django sites outside Lawrence yet?

2005-08-08 Thread Simon Willison
jango running in the world. It would be great to compile some success stories for the website. Cheers, Simon

Re: {% if method(arguments) %}

2005-09-11 Thread Simon Willison
perms variable (supplied by DjangoContext) can do what you are asking for: {% if perms.name_of_module %} That will be true if the user has any permissions for name_of_module. You can check individual permissions with: {% if perms.name_of_module.name_if_permission %} Cheers, Simon

Django-powered sites on the wiki

2005-09-14 Thread Simon Willison
I've started a list of public websites powered by Django on the development wiki: Django powered sites Please add your Django-powered site if it's not already listed. Cheers, Simon Willison http://simon.incutio.com/

Re: Django-powered sites on the wiki

2005-09-14 Thread Simon Willison
On 9/14/05, Simon Willison <[EMAIL PROTECTED]> wrote: > I've started a list of public websites powered by Django on the > development wiki: Here's the link: http://code.djangoproject.com/wiki/DjangoPoweredSites

Re: Design Advice: "here" in Navigation

2005-09-20 Thread Simon Willison
ist option will be highlighted. On the contactpage, nav-contactpage will be highlighted - and so on. Of course, this approach doesn't scale to hundreds of different pages very well - but it's great for small sites or for sections of large ones. Cheers, Simon Willison

Re: Surving Static Files on Django

2005-09-29 Thread Simon Willison
On 28 Sep 2005, at 21:25, Jacob Kaplan-Moss wrote: Why? In case you hadn't noticed, Django has a pretty large memory footprint; between Apache, mod_python, Python, the database drivers, etc., Apache server processes tend to weigh about 10M each (at least on my servers). Unfortunately, A

Re: Performance and scalability

2005-09-29 Thread Simon Willison
On 29 Sep 2005, at 15:06, Tau wrote: What you, the authors of django, can provide on the subject of django's performance and scalability. I find the framework architecture to be excellent but, literally speaking, what if I migrate my php sites to django. Will hardware upgrade be inevitable?

Re: Several domains, one django project

2005-09-29 Thread Simon Willison
this kind of problem. You'll need to point each domain at a separate Django config file, which can import shared settings from a base config file and then set up a domain-specific TEMPLATE_DIRS variable. Cheers, Simon

Re: Several domains, one django project

2005-09-29 Thread Simon Willison
On 29 Sep 2005, at 16:10, Adrian Holovaty wrote: Yes, this is entirely possible -- it's how Django is used at World Online. You'll just need to create a separate settings file for each domain, and just point each VirtualHost in your Apache configuration at the appropriate settings file. Ther

Re: Repeating Blocks Within a Template

2005-11-14 Thread Simon Willison
a more elegant solution. Cheers, Simon Willison

Re: "startapp" now creates views.py, not views package

2005-11-16 Thread Simon Willison
On 16 Nov 2005, at 05:53, Adrian Holovaty wrote: This is fully backwards-compatible. If you want to keep your views in a "views" directory, that's perfectly all right. The thinking is that the common case will only need a single file called views.py. Nice change. The less directory hierarchy

Re: Preventing Google Web Accelerator from prefetching

2005-11-17 Thread Simon Willison
ll have to check). HTTP purity is a nice ideal, but until the HTML form model contains better support for calling HTTP verbs that reflect what you are actually trying to do it just isn't practical in every case. It's those edge cases that make GWA's behaviour a bad idea. Cheers, Simon

Re: 20 minute wiki, sortof.

2005-11-18 Thread Simon Willison
On 18 Nov 2005, at 09:12, David Ascher wrote: Specifically, I'd love feedback on the views ( http:// da.textdriven.com:8027/sydney/file/trunk/wiki/apps/pages/views.py) and the template ( http://da.textdriven.com:8027/sydney/file/trunk/ wiki/templates/pages/page.html You should do this in

<    1   2   3   4   5   6   7   8   >