Re: how to eliminate duplicates

2010-06-17 Thread Shawn Milochik
Use South data migrations. Sent from my iPad, in accordance with the prophesy. -- 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

how to eliminate duplicates

2010-06-17 Thread Kenneth Gonsalves
hi I have a problem - there is a model called Player with first_name and last_name. There is a unique_together constraint on first_name and last_name. However I find that the people doing data entry have been entering things like Ram Sharan and RAM SHARAN which are two different names. Of

Re: Selling Django

2010-06-17 Thread Richard Shebora
Kenneth, You are right... of course. However, I am not trying to disguise django as a cms, just trying to say it would be great to have a best practices declaration for a cms within django. And for all the other great modules that don't yet play well together out of the box. Thanks, Richard

Re: Error while customizing admin/change_form.html

2010-06-17 Thread Richard Bolt
You're getting a recursion error because you're trying to extend admin/ change_form.html with itself. In other words your copy of admin/ change_form.html in the directory location you have is the default admin/change_form.html template now... You can either: 1. Copy the entire

Re: Selling Django

2010-06-17 Thread Yo-Yo Ma
This thread shows a very prevalent side of most developers that makes me ashamed to tell people that I'm a developer. The OP is not saying that we should go out and advertise that Django is a great CMS. In fact he spends half of his post making trying to preemptively shut all the know-it-all

Re: Selling Django

2010-06-17 Thread Kenneth Gonsalves
On Thursday 17 June 2010 19:36:18 Richard Shebora wrote: > You are correct. The "drupal/joomla/plone/wordpress space" does exist > and it is where most people (non-developers) look first. These are > the people who need to perceive django in a more positive light if the > goal is to increase

Re: Serving media files

2010-06-17 Thread Graham Dumpleton
On Jun 18, 3:53 am, Jagdeep Singh Malhi wrote: > Sir Graham > my actual problem is this :- > >  Myhttp://localhost/admin/is display in  pattern without grapic or > image not  like that which is shown in >

Re: sessions across subdomains - required settings?

2010-06-17 Thread Vasil Vangelovski
Not really. Giving them a different secret key won't make much difference. Just make sure your site id is the same. On Thu, Jun 17, 2010 at 11:22 AM, Aljosa Mohorovic wrote: > if i have a project with domain example.com and it's deployed as 3 > wsgi apps: > -

Re: Selling Django

2010-06-17 Thread Richard Shebora
Matt, Between you and Russ I see what you mean. I will contact Tom and Venkatraman regarding their concept to see how I can help. I am not proficient with django's paradigm yet, but I can get better in the process. Thanks, Richard Shebora On Thu, Jun 17, 2010 at 11:36 AM, Matt Hoskins

Re: Selling Django

2010-06-17 Thread Richard Shebora
Russ, Yes, I did at first see this as one issue. I see that your "Enterprise" site should not define best practices but at most refer to them as further reading. My email addresses the same issues as Tom and Venkatraman above. Thanks for explaining. Thanks, Richard Shebora On Thu, Jun 17,

Re: Serving media files

2010-06-17 Thread Jagdeep Singh Malhi
Sir Graham my actual problem is this :- Myhttp://localhost/admin/ is display in pattern without grapic or image not like that which is shown in Tutorial http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02 MY admin page (http://localhost/admin/) Django administration

Re: models.URLField with verify_exists=True pass non existent Urls to DB

2010-06-17 Thread Karen Tracey
On Wed, Jun 16, 2010 at 5:14 PM, aurel...@gmail.com wrote: > Thanks Karen! > > Django 1.0 Web Site Development book (code example is from that book) > has following paragraph: > "By specifying correct field types in our form, we don't have to > implement any > additional input

Re: Selling Django

2010-06-17 Thread backdoc
This is also one of the things I like most about Django. It's helpful, but not so much that it gets in the way or makes doing anything "outside the box" difficult. But, I'm just a newbie who's learning and doing lots of stuff wrong. But, I continue work in Django because it seems like a sound

Re: How to pass a raw ORDER_BY command or function call to a results query object?

2010-06-17 Thread Ian Lewis
In this case you want to use extra(). Assuming jobs is a QuerySet or Manager instance: jobs = jobs.extra(select={greatest_time': 'GREATEST(startTime, queueTime)'}) jobs = jobs.extra(order_by=['-greatest_time']) On Thursday, June 17, 2010, Kyle wrote: > Without any

Re: File - .dat

2010-06-17 Thread Christoph
If you want to get a response. Why don't you make a minimal example? >From your email I do not understand what your problem is. I thought you want to generate a file like the one you posted but what about all that Django stuff? What do you want to do? Is it correct, that you want a file with

Re: Selling Django

2010-06-17 Thread Matt Hoskins
Richard, That is where most people who are looking for something *in that space* look first - i.e. they have a set of requirements where those platforms are a good fit for what they're trying to do, but it isn't the only space. Those people aren't the people who pay my wages at present because,

Re: "'str' object has no attribute 'source'" for a simple test tag

2010-06-17 Thread Daniel Roseman
On Jun 17, 4:11 pm, Derek wrote: > Running Django 1.2.1 with Python 2.6 > > I am trying to create a simple test tag (the more complex ones are not > working either...). > > In the templatetags directory, I have this code in the my_tags.py file: > > from django import template

Re: Selling Django

2010-06-17 Thread Russell Keith-Magee
On Thu, Jun 17, 2010 at 10:06 PM, Richard Shebora wrote: > @Matt > > You are correct.  The "drupal/joomla/plone/wordpress space" does exist > and it is where most people (non-developers) look first.  These are > the people who need to perceive django in a more positive light if

Re: admin filters getting reset after admin action

2010-06-17 Thread derek
On Jun 17, 5:44 am, rahul jain wrote: > Hi there, > > I have some filters set-up on admin page. As soon as I perform admin > action. All filters are getting reset. > > Is this is a bug from framework ? No. There are work-arounds to get back to these; Google this group

"'str' object has no attribute 'source'" for a simple test tag

2010-06-17 Thread Derek
Running Django 1.2.1 with Python 2.6 I am trying to create a simple test tag (the more complex ones are not working either...). In the templatetags directory, I have this code in the my_tags.py file: from django import template register = template.Library() @register.tag def foo(eggs=None,

Special characters and symbols in django?

2010-06-17 Thread c.poll...@bangor.ac.uk
Hi all i have an application in django that is used by our academics to apply for approval for projects So it will be used by many different people many of whom will be cut and pasting scientific information from MS Word into text fields in django forms Underneath it all is an oracle database

Re: Selling Django

2010-06-17 Thread Richard Shebora
@Matt You are correct. The "drupal/joomla/plone/wordpress space" does exist and it is where most people (non-developers) look first. These are the people who need to perceive django in a more positive light if the goal is to increase django market share. They are the people who hire you and I.

How to pass a raw ORDER_BY command or function call to a results query object?

2010-06-17 Thread Kyle
Without any filtering, I can execute the following SQL query to get my ordered data: SELECT * from EXECUTION_JOB ORDER BY GREATEST(startTime, queueTime) DESC; But in Django, it seems like the order_by only likes passing of field names, not a function call. Is there a way to have it bass a raw

Re: Selling Django

2010-06-17 Thread Matt Hoskins
> plug and play.  A manager/developer making the decisions on a platform > for their next project should be able to download django and just plug > in the functionality he/she needs.  Dependencies will exist but that's > normal. > If all that would happen django would be an easy choice for

Re: Why does django's default test suite runner set settings.DEBUG = False?

2010-06-17 Thread Tom Evans
On Thu, Jun 17, 2010 at 1:14 AM, Russell Keith-Magee wrote: > On Thu, Jun 17, 2010 at 5:40 AM, Peter Bengtsson wrote: >> This is a new feature of Django 1.2. I'm curious, why does it want to >> do this? I want to control this for my settings so that I

automatic documentation (docutils) does not pull in class methods?

2010-06-17 Thread pk
The automatic documentation generated, via docutils, in the admin interface for a django app does not pull in documentation for methods defined for classes, only attributes. Is this a "feature" of the django implementation or docutils? Thanks, P.K. -- You received this message because you are

Re: Selling Django

2010-06-17 Thread Richard Shebora
I have been thinking about this for a while and am writing this because everything said so far interests me greatly... I am not a qualified django developer (yet), but have been successfully building commercial sites for over ten years with the last five in python/zope/plone. I love the

Re: Serving media files

2010-06-17 Thread Graham Dumpleton
On Jun 17, 9:17 pm, Jagdeep Singh Malhi wrote: > i am using this > linkhttp://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-... > > In this link i am unable to under stand topic  SERVING MEDIA FILES > the lines(given below) which is used in this

Serving media files

2010-06-17 Thread Jagdeep Singh Malhi
i am using this link http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi In this link i am unable to under stand topic SERVING MEDIA FILES the lines(given below) which is used in this tutorial , i am able understand where we edit this line , if its edit in

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Alex
Thanks all! I will try a combination of these pointers. server/client communication patterns seems to be a recurring theme (or nightmare!) of mine. This conversation has been very helpful and reassuring - I can see that the hard and fast rule is 'when in doubt, json it'

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Matt Hoskins
On Jun 17, 10:31 am, Ian McDowall wrote: > > In some cases, I don't use templates to build a JSON response.  It can > be straightforward to write it as a string inline.  I don't personally > yet use the built in Python JSON module as I don't want to limit the > Python

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
Sorry, other posters have picked up two of my errors. It is a while since I used application/json and I was running on (incorrect) memory. My reasoning for using plain text is as follows. I regard parsing JSON using eval() as a security risk on the client side. If you have complete control of

sessions across subdomains - required settings?

2010-06-17 Thread Aljosa Mohorovic
if i have a project with domain example.com and it's deployed as 3 wsgi apps: - www.example.com - admin.example.com - api.example.com is there something in settings.py that should be shared across wsgi apps except SESSION_COOKIE_DOMAIN? i can't figure out if i should use the same SECRET_KEY in

Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Graham Dumpleton
On Jun 17, 6:28 pm, Dmitry Dulepov wrote: > Hi! > > Radhakrishna wrote: > > I have deployed my django project to Apache using mod_wsgi. In urls.py > > I am mapping "gateway/" to gateway.py which imports 'pyamf' module. > > The problem is, even though pyamf module is in

Re: Is there any kind of verbose_name for apps?

2010-06-17 Thread Massimiliano della Rovere
That's how I solved it, but I was wondering if there were something more official :) On Wed, Jun 16, 2010 at 20:27, patrickk wrote: > I don´t think there is (although this issue has already been discussed > years ago) - no ability to change apps-name and/or

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Matt Hoskins
I was just copying Ian's choice of mimetype - see Ian's comment above "I choose text/plain deliberately but you might choose text/json (or something else)."... Although it's worth pointing out that "text/json" shouldn't be used, since "application/json" is, as you rightly point, the mimetype for

Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Dmitry Dulepov
Hi! Radhakrishna wrote: > I have deployed my django project to Apache using mod_wsgi. In urls.py > I am mapping "gateway/" to gateway.py which imports 'pyamf' module. > The problem is, even though pyamf module is in python path, its not > able to find it. I can import it from command line and

Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Radhakrishna Bhat
Any py gurus? On Wed, Jun 16, 2010 at 8:42 PM, Radhakrishna wrote: > This may be very silly, but I cant figure out the problem. Everything > seems to be in place. > I have deployed my django project to Apache using mod_wsgi. In urls.py > I am mapping "gateway/" to

Re: Selling Django

2010-06-17 Thread Russell Keith-Magee
On Thu, Jun 17, 2010 at 12:26 AM, finn wrote: > Hi, > > I have with interest followed the thread "Seeking Django vs. Joomla > comparison", and it has inspired me to start this new thread. > > I consider myself a Python/Django programmer, and I do so because my >

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Dmitry Dulepov
Hi! Matt Hoskins wrote: > return HttpResponse(simplejson.dumps(data),mimetype='text/plain) Small correction: mime type should be application/json. -- Dmitry Dulepov Twitter: http://twitter.com/dmitryd/ Web: http://dmitry-dulepov.com/ -- You received this message because you are subscribed to

Re: DateField issues

2010-06-17 Thread Daniel Roseman
On Jun 17, 6:40 am, Sheena wrote: > Thanks > > The question is how do I populate a field with some other date, for > example, there's a date of birth field that the auto stuff wont be > ideal for... > In the populate method i mentioned before, i passed the dob(date of >

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Matt Hoskins
Django has an escapejs filter so if you're using a template to generate json you'd be safer doing, e.g.: "first_name":"{{ one_member.first_name|escapejs }}" That way if someone sticks something untoward (like a double quote) in your first_name or last_name fields it won't break things :). For

Re: Selling Django

2010-06-17 Thread Dmitry Dulepov
Hi! finn wrote: > Now to the problem: a lot of people who needs websites have heard of > Drupal or Joomla! or WordPress or PHP. But NOBODY has EVER heard about > Django. That's because Django is not a CMS. You cannot take it, install onto web site and start adding content. With CMS you do

Re: Model validation (not form validation)

2010-06-17 Thread derek
On Jun 16, 8:20 am, MH wrote: > Hi, > I'm making a model, that has a bit complex dependencies between the fields, > such as date progression (start_date must not be later than finish_date). > I'm looking for a way to validate these dependencies while creating (or >

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Ian McDowall
Hi Alex, here is a small example of a JSON response. I don't mix HTML and JSON personally (I use HTML pages and then fetch JSON via AJAX calls so). Here is a fragment of code from one of my views: t = loader.get_template('members/member_info.json') c = Context({'member_set':member_set})