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:
>
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
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
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
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
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,
>
> >
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
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
===
# 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
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.
>
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
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
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
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
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
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
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
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
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
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
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
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
> 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
--~--~-
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
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
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
> 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
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
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
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
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
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
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
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
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
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
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
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
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
; ' 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
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.
>
&
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
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
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
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
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
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
--~--~-~--~~---
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
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,
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
--~--~
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
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
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
. 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
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
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
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
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
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
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
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
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
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
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
, 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
__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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
--~--~-~--~
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
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
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.
7;s mine:
http://simon.incutio.com/syndicate/django/rss1.0
Cheers,
Simon
jango running in the world. It
would be great to compile some success stories for the website.
Cheers,
Simon
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
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/
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
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
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
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?
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
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
a more elegant
solution.
Cheers,
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
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
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
101 - 200 of 710 matches
Mail list logo