You can use the template language to test against what you think are constants,
the parser is actually testing 2 "literals".
The parser tests for 2 literals with names 'None' and 'False'.
When parser tries to resolve these in the context a VariableDoesNotExist
exception is thrown and both object
On Apr 25, 2011, at 5:39 AM, Kane Dou wrote:
> * Daniel Gerzo [2011-04-25 13:07:46 +0200]:
>
>> On 25.4.2011 12:40, Kane Dou wrote:
>>> * Daniel Gerzo [2011-04-24 17:52:13 +0200]:
>>>
Hello all,
say I have a following form:
class MyForm(forms.Form):
id = for
On May 1, 2011, at 8:01 AM, doniyor wrote:
> Hi there,
> i am trying to overwrite handler404 of django so that i can call my
> own view function when it doesnot find the appropriate view and if it
> tries to give Http404. the whole problem is as follows:
>
> i defined my view function called 're
On May 5, 2011, at 5:50 PM, John Crawford wrote:
> I'm using the filebased email backend for testing (although the console
> version had the same problem). When I send email, either via function or
> template, lines that are too long, are broken, with an '=' sign at the end.
> For instance:
>
On May 6, 2011, at 8:35 AM, Shawn Milochik wrote:
> Sorry, I was going off of your pasted code.
>
> Sounds like this could be a case for annotate.
> http://docs.djangoproject.com/en/1.3/ref/models/querysets/#annotate
>
> I recommend reading this whole page, along with the two prerequisite pages
On May 10, 2011, at 12:50 PM, Shawn Milochik wrote:
> I have a decorator I'd like to apply to every view in a given views.py file.
> Is there an elegant way to do that in Django?
>
> I searched Google and the docs but didn't find anything.
>
> So, I wrote some code which works and demonstrates
django.contrib.contenttypes.models import ContentType
for object in most:
foo = ContentType.objects.get(id=
object['content_type']).get_object_for_this_type(object['object_id'])
You can also see
https://github.com/coleifer/django-generic-aggregation
This will get you clo
On May 29, 2011, at 7:13 PM, Margie Roginski wrote:
> Anyone know if there is a way to save out a test database that is
> created through the django TestCase module?
>
I think this gets you close:
https://docs.djangoproject.com/en/1.2/ref/django-admin/#testserver-fixture-fixture
django-admin
//docs.python.org/library/itertools.html#recipes
You could use unique_everseen, still creates a set, but might be useful
if you intention is only to iterate through the remaining list.
# overkill for example...
tuple(unique_everseen(chain(t1, t2, t3)))
('a...@b.com', 'b...@b.com',
Hi,
It seems that the contenttype framework and the sites contribs
conflict with using the autocommit:True database option. I'm not
really sure what happens but here is a simple test case that shows
that the order of the tests causes a failure. It looks like from the
SQL that the save point is be
On Mar 2, 2011, at 8:28 AM, Rodrigo Cea wrote:
> I am developing a site that I want to link with Facebook and Twitter.
>
> So as to not reinvent the wheel, I'm looking for apps or snippets that can
> help with this, specifically:
>
> 1) allow users to register and login with their Facebook and
On Mar 10, 2011, at 5:26 PM, sushanth Reddy wrote:
> I using jplot in my app .if list is in unicode(u) ,it not displaying the
> charts,thats the reason i want to remove it ...
>
Pass a json string then have the Java(?) side convert it back into "objects"
In [1]: import json
In [2]: json.dumps
On Mar 11, 2011, at 5:02 AM, pols wrote:
> hai
> I have two models as shown belove
>
> from django.db import models
> from django.db.models import Sum
> # Create your models here.
> class polls(models.Model):
> question = models.CharField(max_length=200)
> pubish_date = models.DateTime
On Mar 11, 2011, at 10:46 AM, Daniel Roseman wrote:
> On Thursday, March 10, 2011 11:59:15 PM UTC-8, Ndungi Kyalo wrote:
> Hi guys. Am using django non-rel on appengine. I am using django's
> auth backend for my authentication, since I did not want to have to
> force my users to use gmail login
On Mar 16, 2011, at 8:49 AM, Margie Roginski wrote:
> Hmmm ... so I just got back to trying this and I actually don't think
> the annotate call as suggested does what I am looking for. Say I want
> to annotate queues with the number of closed tasks. This call:
>
> Queue.objects.filter(task__sta
Ben,
You should a have a look at https://github.com/bueda/django-boilerplate
"django-boilerplate is an attempt to set up a standard convention for
Django app layouts, to assist in writing utilities to deploy such applications.
A bit of convention can go a long way."
It's very similar to what yo
On Mar 18, 2011, at 6:38 AM, Ricardo F. Teixeira wrote:
> Hi everyone!
>
> Without using raw SQL queries how can I make multiple joins using this
> model?
>
Do a search for "django select_related reverse one to many" for some
alternatives
> I'm trying to get something like this:
>
> SELECT
On Mar 22, 2011, at 10:03 AM, cootetom wrote:
> I'm using the psycopg2 python library and have tried postgresql 8 and
> now 9.
>
> The error, in brief, is:
>
> "
> Template error
> In template c:\python26\lib\site-packages\django\contrib\admin
> \templates\admin\base.html, error at line 58
> Caug
On Mar 22, 2011, at 12:10 PM, Bobby Roberts wrote:
> how else would you pull in information from another model into the
> current model list view in admin?
>
>
There are some options:
Search for
http://www.google.com/search?q=ModelAdmin+__
You'll find http://code.djangoproject.com/ticket/10743
> On Tue, Mar 22, 2011 at 5:29 PM, Jason Culverhouse
> wrote:
> On Mar 22, 2011, at 12:10 PM, Bobby Roberts wrote:
>
> > how else would you pull in information from another model into the
> > current model list view in admin?
> >
> >
> Ther
On Mar 23, 2011, at 4:25 AM, Malcolm Box wrote:
> Further investigation: looks like it's a South/syncdb interaction. The
> UserProfile will be created by the south migration, but of course that
> hasn't run when the auth post_install runs to prompt for a superuser.
>
> Sadly syncdb --migrate doe
On Mar 23, 2011, at 12:19 PM, Julien Castets wrote:
> Hello,
>
> from django.contrib.auth.models import User
>
> class Team(models.Model):
> users = models.ManyToManyField(User)
>
>
> I would like to retrieve every User in my database who does not belong
> to a team.
Left outer join is you
On Mar 30, 2011, at 9:47 AM, Calvin Spealman wrote:
> I think your best bet is
>
> MyModel.objects.filter(some_field__in=ok_values).count() == len(ok_values)
>
> On Wed, Mar 30, 2011 at 12:44 PM, dmitry b wrote:
>> Hi,
>>
>> is there a way to check in bulk for record existence and get back a
On Mar 30, 2011, at 2:31 PM, Pablo Vidal wrote:
> I need to know how to filter in the django admin model License, the
> licenses of the user logged-in to the admin.
>
> class License(models.Model):
>user = models.ForeignKey('wiki.User')
>name = models.CharField(max_length = 100)
>
>
On Mar 30, 2011, at 4:50 PM, Mike Ramirez wrote:
> On Wednesday, March 30, 2011 04:20:32 pm Shawn Milochik wrote:
>> I have the exact same problem. I hope there is a solution, because
>> good site design often results in image references in the CSS.
>
>
I think you guys are over analyzing the
On Mar 30, 2011, at 5:10 PM, Mike Ramirez wrote:
> On Wednesday, March 30, 2011 05:01:08 pm Jason Culverhouse wrote:
>> On Mar 30, 2011, at 4:50 PM, Mike Ramirez wrote:
>>> On Wednesday, March 30, 2011 04:20:32 pm Shawn Milochik wrote:
>>>> I have the exact s
On Mar 31, 2011, at 1:18 PM, jay K. wrote:
>
> I think i found the source of all problems
>
> I am not a python expert, so I was wondering if anybody can tell me what this
> code means
>
> // beginning of code
>
> from django.db import models
>
>
> class TranslationForeignKey(models.Foreig
There is a snippet http://djangosnippets.org/snippets/1729/
"Template tag to handle navigation item selection"
which is quite useful for creating navigation/menu structure
Jason
On Apr 12, 2011, at 11:43 AM, javatina wrote:
> You can put your current menu option in context and then, while
> rende
28 matches
Mail list logo