Re: possible filter bug with manytomany fields and slice?

2009-04-16 Thread Margie
Ah - ok, cool, good to know. I am on 1.1 pre-alpha SVN-9814. Am moving soon to the 1.1. beta. I originally encountered this on a case that wasn't quite what I posted. I had a situation where I was guaranteed that my Task had only a single tile in the tiles field. So I was trying to filter lik

Re: setting a model field to null

2009-04-16 Thread Margie
blah.foo = None should do the trick On Apr 15, 8:01 pm, rvr wrote: > How can I set a model field to null after it has had a non-null value? > > -- > class Blah(models.Model): >     foo = models.IntegerField(null=True) > > blah = Blah() > blah.foo = 5 > > # now set it to null > blah.foo = ??? > -

Komodo and auto-complete

2009-04-16 Thread Mariano Sokal
Hello again... I was using notepad++ and now Im trying to switch to komodo edit. Has anyone been successful on getting 'auto-complete' working? I get the following error: "evaluating 'models' at models.py#21: could not resolve first part of 'models' (error determining completions)" Thanks in

Re: possible filter bug with manytomany fields and slice?

2009-04-16 Thread Malcolm Tredinnick
On Thu, 2009-04-16 at 00:01 -0700, Margie wrote: > Ah - ok, cool, good to know. I am on 1.1 pre-alpha SVN-9814. Hmm .. then maybe there's an actual problem there. The ability to use nested querysets was added in r9701 (with a few bug fixes in subsequent patches). I only said 1.1-beta as a rough

Problem with self referencing Foreign key field and mysql InnoDB

2009-04-16 Thread limas
I were using Mysql MyISAM. But I want to enable transaction. So i shifted to InnoDB. Actually I have one model as below (*designed somebody i can't change). class Folder(models.Model): folder_id=models.AutoField(primary_key=True) user_name=models.ForeignKey(User) folder_na

Re: manage.py loaddata fails to report error [was: Why does dumpdata, flush, loaddata cycle not result in same db content?]

2009-04-16 Thread Russell Keith-Magee
On Thu, Apr 16, 2009 at 11:30 AM, Phil Mocek wrote: > > On Thu, Apr 16, 2009 at 11:03:33AM +0800, Russell Keith-Magee wrote: >> Loaddata doesn't take input from stdin - it loads files that are >> specified on the command line. > > Thanks, Russell. > > I should have read the documentation for the

Admin widget for filter_vertical and filter_horizontal slow

2009-04-16 Thread maco
My model has two Foreign Keys. Each FK has 4000 entries or more. In admin.py I use filter_horizontal for those FK. I noticed that JS widget is slow both on first render of admin page (add item) and on every selection of an FK item inside the widget. I takes 5 seconds AFTER admin page already load

Re: Problem with self referencing Foreign key field and mysql InnoDB

2009-04-16 Thread Daniel Roseman
On Apr 16, 8:33 am, limas wrote: > I were using Mysql MyISAM. But I want to enable transaction. > So i shifted to InnoDB. > Actually I have one model as below (*designed somebody i can't > change). > > class Folder(models.Model): >         folder_id=models.AutoField(primary_key=True) >         us

Running two django version from same python.

2009-04-16 Thread Harish
Hi Folks, Is it possble to install two seperate django versions (0.97 and 1.0.x) in one python site-package file. If yes how and if no why? Regards Harish Bhat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

signals vs. save()

2009-04-16 Thread koranthala
Hi, I was comparing between signal and save() and came across this following mail chain - http://groups.google.com/group/django-users/browse_thread/thread/d0ff6dd3432d25fa/99a92f9f4b343b1e In this it is mentioned that - --- If you want to implement some functionality that operates across

Re: Need help first user of django..

2009-04-16 Thread johan.uhIe
You already know the Django Documentation. Another good ressource is the Django Book. Have a look at this: http://djangobook.com/ Maybe you should work through the entire book to get a good understanding how forms and flatpages work. --~--~-~--~~~---~--~~ You receiv

Re: Running two django version from same python.

2009-04-16 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-04-16, o godz. 12:27, przez Harish: > Is it possble to install two seperate django versions (0.97 and > 1.0.x) in one python site-package file. > If yes how and if no why? Use separate virtual environments for each version with virtualenv. There's no way t

Re: Need help first user of django..

2009-04-16 Thread commander_coder
Those are both good, and the book _Practical Django Projects_ by Bennett is another good choice. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Tom Evans
On Thu, 2009-04-16 at 11:06 +1200, Wayne Koorts wrote: > Also just another tip: it is a good idea to not use named colour > values ("green" / "red" etc.) as each CSS rendering engine might > interpret it differently. For green you could use: "color: rgb(0, > 255, 0);" and for red you could use: "

Re: Problem with self referencing Foreign key field and mysql InnoDB

2009-04-16 Thread Tom Evans
On Thu, 2009-04-16 at 00:33 -0700, limas wrote: > I were using Mysql MyISAM. But I want to enable transaction. > So i shifted to InnoDB. > Actually I have one model as below (*designed somebody i can't > change). > > class Folder(models.Model): > folder_id=models.AutoField(primary_key=True)

Some django-based jobs available

2009-04-16 Thread tonemcd
I hope I'm not breaching etiquette here. We have two jobs going at the moment, where a large proportion of the work will be in Django. To apply, you *must* go through our University online system. Sorry about that. The URLs are; Infrastructure Development Officer: http://is.gd/sJW9 and Web Dev

Re: Newcastle, UK Django positions (was "Some django-based jobs available")

2009-04-16 Thread Tim Chase
tonemcd wrote: > I hope I'm not breaching etiquette here. Not particularly...however you may also want to post on http://djangogigs.com to reach the broadest audience. One other tip -- though your email CC's Newcastle, UK addresses and the below redirectors point to the Newcastle pages, it's

Problem to install psycopg

2009-04-16 Thread Sergio González - Paraguay
Hello everybody I'm trying to install psycopg2 in my fedora. this is the error in the command line: [...@machine psycopg2-2.0.9]$ python setup.py build running build running build_py running build_ext error: No such file or directory [...@machine psycopg2-2.0.9]$ Can someone help me please --

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Les
You might post your settings.py as a help to other newbies On Apr 15, 7:21 pm, Anthony wrote: > Thanks. > > I was just trying to get the stylesheet to show up.  I have a full CSS > template I got from somewhere else that I'll be using now that it's > being successfully pulled in. > > On Apr 15,

Re: Newcastle, UK Django positions (was "Some django-based jobs available")

2009-04-16 Thread tonemcd
Thanks for the rewrite of the subject line Tim, I should have put more location information into the post. I've also added it to django-gigs to get a wider audience. And thanks for being understanding regarding those 'abominably long target URLs' - it's an outsourced operation over which we have

Re: Running two django version from same python.

2009-04-16 Thread Marcin Mierzejewski
Hi Harish, On Apr 16, 12:27 pm, Harish wrote: > Is it possble to install two seperate django versions (0.97  and > 1.0.x) in one python site-package file. > If yes how and if no why? You can put django into your project directory, e.g. /myproject /__init__.py /manage.py /urls.py /

Django admin question

2009-04-16 Thread zayatzz
http://docs.djangoproject.com/en/dev/intro/tutorial02/#adding-related-objects On that page is small picture of adding choice to a poll. There is selectbox and textfields. My question is - how to choose which field of poll model will be shown in this selectbox? Alan. --~--~-~--~~

Re: Django admin question

2009-04-16 Thread Daniel Roseman
On Apr 16, 2:18 pm, zayatzz wrote: > http://docs.djangoproject.com/en/dev/intro/tutorial02/#adding-related... > > On that page is small picture of adding choice to a poll. There is > selectbox and textfields. > > My question is - how to choose which field of poll model will be shown > in this sel

Re: Unittests

2009-04-16 Thread Daniel Joshua Worth
the method past_performance() simply checks if the date of the performance is before today's date. >>> Can you send your test.py file to the list? import unittest from booking.models import * class PerformanceTest(unittest.TestCase): def setUp(self): self.performance = Performance.ob

Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis
Hello, Recently, we are solving a conceptual question of designing clean urls for list and detail views of objects with slugs. Let's say we have products with their slugs. In the naive way, the list view could be accessed by /products/ and the detail views could be accessed by /products/

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Marcin Mierzejewski
Hi Aidas, > 7. Using the controlling words before the type of list: >     /by-popularity/products/ >     /featured/products/ >     /page5/products/ >     /add/products/ >     /products/myproduct/ >     /products/myanotherproduct/ 8. Using parameters /products/?sort=popularity /products

Re: signals vs. save()

2009-04-16 Thread Alex Gaynor
On Thu, Apr 16, 2009 at 6:39 AM, koranthala wrote: > > Hi, >I was comparing between signal and save() and came across this > following mail chain - > > http://groups.google.com/group/django-users/browse_thread/thread/d0ff6dd3432d25fa/99a92f9f4b343b1e > >In this it is mentioned that - > --

PDFs with Pisa

2009-04-16 Thread Alfonso
Hi, I'm trying out Pisa to generate PDFs and am getting a weird error when rendering the pdf: Caught an exception while rendering: 'Context' object has no attribute 'push' Here's the code I'm using (largely unchanged from pisa example) http://dpaste.com/34323/ It seems to hit this error whene

Re: possible filter bug with manytomany fields and slice?

2009-04-16 Thread Alex Gaynor
On Thu, Apr 16, 2009 at 3:15 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Thu, 2009-04-16 at 00:01 -0700, Margie wrote: > > Ah - ok, cool, good to know. I am on 1.1 pre-alpha SVN-9814. > > Hmm .. then maybe there's an actual problem there. The ability to use > nested querysets

help! i'm new in django

2009-04-16 Thread 83nini
Hi all, I'm new to django and i'm trying to go through the first tutorial to create a website. I am using the tutorial on the official website, problem is i have no idea where i should put the folder where i am to keep the project that i'm making! thanks guys for help. cheers --~--~-~--

Re: Django admin question

2009-04-16 Thread zayatzz
So this means, that i can return whichever other value with this unicode method... even value from other models? Alan. On Apr 16, 4:22 pm, Daniel Roseman wrote: > On Apr 16, 2:18 pm, zayatzz wrote: > > >http://docs.djangoproject.com/en/dev/intro/tutorial02/#adding-related... > > > On that page

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Andrew Ingram
Ok, best practices time. Segments: Only introduces a new segment if it indicates a page that is a logical descendant of the previous, traversing a category hierarchy would be the typical example /books/thrillers/ Query Parameters: Used to define the viewing parameters of the current level in th

Re: help! i'm new in django

2009-04-16 Thread Alfonso
Hi 83nini, It doesn't matter too much where you place the actual project folder for the django code, just ensure all your paths are setup correctly. For example I just have mine sitting in ~/Users/me/django/ django_projects/ but could be anywhere. Good luck! A On 16 Apr, 14:41, 83nini <83n...@

Fieldlookup: NOT

2009-04-16 Thread Thomas Guettler
Hi, For forms which display a list of results I use: form=QueryForm(request.GET) queryset=MyModel.objects.filter(**form.cleaned_data) But, now I need to use exclude() instead of filter(). I looked at the queryset API, but it seems that there is no alternative to qs.exclude().

Re: Running two django version from same python.

2009-04-16 Thread Ayaz Ahmed Khan
On 16-Apr-09, at 3:27 PM, Harish wrote: > Hi Folks, > > Is it possble to install two seperate django versions (0.97 and > 1.0.x) in one python site-package file. If yes how and if no > why? > Describing how I have done it for my scenario, I wrote about it a while back.

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
Here are the advantages and disadvantages I see myself: > 1. One of the approaches is to use special symbols for the controlling > words, which are not allowed in slugs, like in last.fm or wikipedia > does. (+) url rules for the app might be defined in a separate file (+) shortness (-) unusual/un

Re: Fieldlookup: NOT

2009-04-16 Thread Christian Joergensen
Thomas Guettler wrote: > Hi, > > > For forms which display a list of results I use: > form=QueryForm(request.GET) > > queryset=MyModel.objects.filter(**form.cleaned_data) > > But, now I need to use exclude() instead of filter(). > > > I looked at the queryset API, but it seem

Re: help! i'm new in django

2009-04-16 Thread 83nini
thanks a million for the tip, the first command worked :) On 16 Apr, 15:52, Alfonso wrote: > Hi 83nini, > > It doesn't matter too much where you place the actual project folder > for the django code, just ensure all your paths are setup correctly. > For example I just have mine sitting in ~/User

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
> 8. Using parameters >      /products/?sort=popularity >      /products/?filter=featured >      /products/?page=5 >      /products/add/ >      /products/myproduct/ >      /products/myanotherproduct/ In this case, you still need to have a black list of words like "add", "export", "print", "rss",

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Marcin Mierzejewski
Hi Archatas, On Apr 16, 4:07 pm, "Aidas Bendoraitis [aka Archatas]" wrote: > > 8. Using parameters > >      /products/?sort=popularity > >      /products/?filter=featured > >      /products/?page=5 > >      /products/add/ > >      /products/myproduct/ > >      /products/myanotherproduct/ > In th

Re: Django admin question

2009-04-16 Thread Daniel Roseman
On Apr 16, 2:47 pm, zayatzz wrote: > So this means, that i can return whichever other value with this > unicode method... even value from other models? > > Alan. If you want, and you've got a way of getting there from the current model - eg via a foreign key. Bear in mind though that this value

Admin - Hide fields on add, show on change?

2009-04-16 Thread Alfonso
Is it possible to hide some irrelevant fields when a user adds a record via django admin, i.e. they are only relevant on the change view? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Emacs/yasnippet bundle for Django 1.0

2009-04-16 Thread Jon Atkinson
Hello, I've been wanting a better set of Django snippets to use with yasnippet/Emacs for quite a while. I was at a bit of a loose end yesterday, so I decided to do something about this :-) I've based this set of snippets on Brian Kerr's excellent set of Django 1.0 snippets for Textmate[1]. They'v

problem with iexact / icontains matches and TR locale

2009-04-16 Thread omat
Hi all, In Turkish, the capital for 'i' (ascii char) is 'İ' (a non-ascii char) and capital for 'ı' (non-ascii) is 'I' (ascii). I want to match slugified version of a username, which comes from the requested URL to a user. If the username contains 'I', which is a legal ascii character for a user

Re: Admin widget for filter_vertical and filter_horizontal slow

2009-04-16 Thread Christopher Dodd
Yeah, this is a known issue. http://code.djangoproject.com/ticket/3202 I ran into it myself and have been trying all kinds of things to work around it. Once you get enough rows in a table the default controls are no longer feasible. Have you looked into the raw_id_fields option? It wasn't an opti

Re: Emacs/yasnippet bundle for Django 1.0

2009-04-16 Thread Jon Atkinson
Hello, > http://github.com/jonatkinson/yasnippet-djangotree/master Somehow I managed to make a typo :-) The correct link to the github page is: http://github.com/jonatkinson/yasnippet-django/tree/master Cheers, --Jon --~--~-~--~~~---~--~~ You received this mes

Re: Changing raw_id_field from 'id'

2009-04-16 Thread Christopher Dodd
I do something similar in http://groups.google.com/group/django-users/browse_thread/thread/14e580f3dd32e87d# Do you want a comma delimited list of barcodes? Assuming the barcode value is another field, you may be able to reuse some of my code but override the RawIdField instead of Field. On Ap

Re: reuse FilteredSelectMultiple

2009-04-16 Thread Dorian
Also, make sure that is included in your template, otherwise it will not work. {{form.media}} does not include it by default. Dorian On Feb 17, 4:31 pm, Alex Gaynor wrote: > On Tue, Feb 17, 2009 at 7:27 AM, wrote: > > > I'm trying to reuse FilteredSelectMultiple from admin.widgets in my > >

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
> /products/?action=add > /products/?action=print > /products/?action=rss > /products/myproduct/?action=rss > /products/myproduct/?action=print > Those are examples of ugly (not clean anymore) urls. In such a case, you would need to have a wrapper view in Django, which would return the results of

Re: How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-16 Thread Christopher Dodd
I can almost see how forms.models.inlineformset_factory could be tweaked to follow ManyToMany relationships to create inline formsets, perhaps with a parameter telling it which ManyToMany field to use. Am I barking up the wrong tree? Are these questions better off in the developer's group? On Ap

Re: Need help first user of django..

2009-04-16 Thread Aaron
well, I am currently employed in a company. I need to finish adding my web design for their site. when I took the job I assumed he used apache or some hosting service provider. I later on after designing the stuff and getting hired it. I asked him what he uses for a server he said google. I neve

Re: signals vs. save()

2009-04-16 Thread koranthala
On Apr 16, 6:41 pm, Alex Gaynor wrote: > On Thu, Apr 16, 2009 at 6:39 AM, koranthala wrote: > > > Hi, > >    I was comparing between signal and save() and came across this > > following mail chain - > > >http://groups.google.com/group/django-users/browse_thread/thread/d0ff... > > >    In this

Authenication for django.views.generic Views

2009-04-16 Thread Col Wilson
I'm using generic views to render my pages (django.views.generic.date_based, django.views.generic.list_detail etc) and they're very handy. However, the app I'm trying to build would like a security and on reading the "User Authentication in Django" document, it just talks about adding authenticat

newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread gry
[django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] My first django toy app. I've been working through the tutorial http://docs.djangoproject.com/en/dev/intro/tutorial02/. I've already done a few cycles of (change-model, ./manage.py syncdb) with success. I just added email and birthday fields t

Re: Need help first user of django..

2009-04-16 Thread Aaron
I took a look at that site. It's informative. I just don't see anything about flagpages. I saw how to map a url to a view meaning server-sided code. currently I need 3 things to show up. 2 forms and content from flagpages to display. I also need to use if statements to display those 2 forms on

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Aneesh
This is by design. syncdb only checks to see if it needs to create any new DB tables for any models; it does NOT alter existing model tables. See http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb for more info. If you don't have any valuable data in the table (ie, you're just develo

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Brian Neal
On Apr 16, 11:00 am, gry wrote: > [django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] > My first django toy app.  I've been working through the > tutorialhttp://docs.djangoproject.com/en/dev/intro/tutorial02/. > I've already done a few cycles of  (change-model, ./manage.py syncdb) > with succes

TemplateSyntaxError: Settings issue?

2009-04-16 Thread Aneesh K
I have two environments for my new Django site: dev and production. Everything works great on my local dev machine with "manage.py runserver". When I try to view any page on the production site, I get a "TemplateSyntaxError Caught an exception while rendering: No module named tasks". "tasks" is

Re: django-grappelli setup problem

2009-04-16 Thread Lars Stavholm
So that all went well. Now all I need now is the bookmarks and the sidebar navigation box. They're not visible as of right now and I'm not sure what to do about it. The recommended fixtures are loaded. Any ideas anyone? /L Lars Stavholm wrote: > patrickk wrote: >> line 53 of base.html is {% get

is it possible to have more than one search result in a view

2009-04-16 Thread nixon66
I have the view below and wonder if its possible to add other search results into the view or would I need to write seperate ones. Ideally, I'd like to have firm_search = Activity.objects.filter(firm__firms__icontains=q) client_search= Activity.objects.filter(clients__client__icontains=q) Would

Re: is it possible to have more than one search result in a view

2009-04-16 Thread nixon66
Oop, should be can you have more than one search results in a view for a search form. On Apr 16, 12:54 pm, nixon66 wrote: > I have the view below and wonder if its possible to add other search > results into the view or would I need to write seperate ones. Ideally, > I'd like to have > > firm_se

Getting the Model type of an unknown object?

2009-04-16 Thread Matthew
Is it possible to do this? I'm using a custom MultiQuerySet snippet to merge a bunch of querysets from different models, and then I want to iterate over the resultant list, but I want to be able to pull out from each object in the list its own Model type so I can perform a few comparisons/functio

Re: Need help first user of django..

2009-04-16 Thread Aaron
I got a new question. I notice in the admin panel I can see flatpages. In each page in the admin it offers content. Do I put html code in their? Or is it just a fast way to change text? I was given a zip folder that is named flatpages. Inside is each html page of what the website has or supp

Re: django-grappelli setup problem

2009-04-16 Thread patrickk
it´s really easy to debug here: line 60 of index.html is {% get_navigation request.user %}. check the templatetag (navigation.py) and see if the user is there and if the navigation is loaded (e.g. using "print object_list" when the dev-server is started). if there are problems, use the shell (pyth

Running django test suite

2009-04-16 Thread jeffhg58
I recently installed django 1.1 beta and I needed to run the django test suite. So, under the tests directory I executed runtests.py. I received some errors when trying to execute all the tests. I was expected that all the tests would have passed. I am thinking it might be with my setup. Here are

Re: is it possible to have more than one search result in a view

2009-04-16 Thread commander_coder
Perhaps I don't understand the question, but why cannot your context include a number of different pieces of data? return render_to_response('country/search_detail.html', {'search_results': search_results, 'firm_search':firm_search, 'client_searc

Re: TemplateSyntaxError: Settings issue?

2009-04-16 Thread Brian Neal
On Apr 16, 11:33 am, Aneesh K wrote: > > Why is the TemplateSyntaxError raised, and why don't I see this > problem on my development server? > > Thanks! > Aneesh Could be a python path problem? Put the directory that has your application in it on the python path. I think when you do the manage.p

Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Wayne Koorts
>> Also just another tip: it is a good idea to not use named colour >> values ("green" / "red" etc.) as each CSS rendering engine might >> interpret it differently.  For green you could use: "color: rgb(0, >> 255, 0);" and for red you could use: "color: rgb(255, 0, 0);". > > That is incorrect, the

Re: possible filter bug with manytomany fields and slice?

2009-04-16 Thread Margie
First let me mention I am on sqlite3! Perhaps it doesn't support this? I do not know much about the various sql db interfaces, so I have no idea what supports what .. I've actually sort of lost track at this point of what I was originally trying to do. But here's some more information on the ge

Re: Getting the Model type of an unknown object?

2009-04-16 Thread Daniel Roseman
On Apr 16, 6:02 pm, Matthew wrote: > Is it possible to do this? > > I'm using a custom MultiQuerySet snippet to merge a bunch of querysets > from different models, and then I want to iterate over the resultant > list, but I want to be able to pull out from each object in the list > its own Model

Re: Authenication for django.views.generic Views

2009-04-16 Thread Colin Bean
On Thu, Apr 16, 2009 at 8:25 AM, Col Wilson wrote: > > I'm using generic views to render my pages > (django.views.generic.date_based, django.views.generic.list_detail > etc) and they're very handy. > > However, the app I'm trying to build would like a security and on > reading the "User Authentic

Re: Authenication for django.views.generic Views

2009-04-16 Thread Daniel Roseman
On Apr 16, 4:25 pm, Col Wilson wrote: > I'm using generic views to render my pages > (django.views.generic.date_based, django.views.generic.list_detail > etc) and they're very handy. > > However, the app I'm trying to build would like a security and on > reading the "User Authentication in Django

Re: signals vs. save()

2009-04-16 Thread Marco Maier
On Thu, Apr 16, 2009 at 5:25 PM, koranthala wrote: > > On Apr 16, 6:41 pm, Alex Gaynor wrote: > > On Thu, Apr 16, 2009 at 6:39 AM, koranthala > wrote: > > > > > Hi, > > >I was comparing between signal and save() and came across this > > > following mail chain - > > > > >http://groups.google

Re: Authenication for django.views.generic Views

2009-04-16 Thread Dan Harris
http://docs.djangoproject.com/en/dev/topics/auth/#limiting-access-to-generic-views hope this helps. Basically you write your own view which calls the generic view after you have done your authentication. On Apr 16, 11:25 am, Col Wilson wrote: > I'm using generic views to render my pages > (djan

Re: TemplateSyntaxError: Settings issue?

2009-04-16 Thread Aneesh
Thanks BN, your intuition was spot on. It was a python path problem. Adding the following line to my dispatch.fcgi file did the trick. sys.path += ['/path/to/my/project'] It seems that "manage.py runserver" took care of this in my dev environment, so the issue didn't come up. On Apr 16, 10:43 

Re: django-grappelli setup problem

2009-04-16 Thread Lars Stavholm
patrickk wrote: > it´s really easy to debug here: > line 60 of index.html is {% get_navigation request.user %}. > check the templatetag (navigation.py) and see if the user is there and > if the navigation is loaded (e.g. using "print object_list" when the > dev-server is started). if there are pro

Queries, how to get what i want?

2009-04-16 Thread zayatzz
I need help with making queries. I keep reading http://docs.djangoproject.com/en/dev/ref/models/querysets/ http://docs.djangoproject.com/en/dev/topics/db/queries/ but neither of those pages has exactly what i want nor explains why i cant get what i want with existing queries. Ill first post exis

Re: Authenication for django.views.generic Views

2009-04-16 Thread Col Wilson
Thanks all. I have some reading to do, but I have also noticed in the meantime that generic views docs (http://docs.djangoproject.com/en/dev/ ref/generic-views/#ref-generic-views) have a hook into the auth system. Look for 'login_required'. Having said that, I still have a bit of reading to do.

Re: is it possible to have more than one search result in a view

2009-04-16 Thread nixon66
That's what I was thinking, so my question is can I do this? def search_detail(request): if 'q' in request.GET: q = request.GET['q'] search_results = Activity.objects.filter (country__country__icontains=q) firm_search = Activity.objects.filter (firm__firm__icontains=q

Re: django-grappelli setup problem

2009-04-16 Thread patrickk
I´m working with the request-context-processor. I´ll change that for the user (because the auth-processor is required for the admin anyway). nevertheless, without the request-processor, bookmarks probably doesn´t work. simple fix: just add "django.core.context_processors.request", to your templat

Re: Getting the Model type of an unknown object?

2009-04-16 Thread BradMcGonigle
Oddly enough I am trying to do the exact same thing Matt is trying to do. I tried this: {% for object in stream_list %} {% if object._meta.Entry %} but underscores are not allowed to start variables and attributes. Is there another way to do this at the template level or is my syntax jus

Re: Getting the Model type of an unknown object?

2009-04-16 Thread BradMcGonigle
Bah! As usual...I figure this out right after posting something. This works: {% for object in stream_list %} {% ifequal object._meta.object_name 'Entry' %} On Apr 16, 4:33 pm, BradMcGonigle wrote: > Oddly enough I am trying to do the exact same thing Matt is trying to > do. > > I tried

Re: Fewer columns in admin popups

2009-04-16 Thread Dave Benjamin
On Apr 11, 9:29 am, Dave Benjamin wrote: > Is it possible to exclude columns from the popup list view? I may have answered my own question. It looks like the popup is generated from the changelist_view method of ModelAdmin, and this method gets the request as a parameter. I was able to modify th

Re: Fewer columns in admin popups

2009-04-16 Thread Alex Gaynor
On Thu, Apr 16, 2009 at 5:13 PM, Dave Benjamin wrote: > > On Apr 11, 9:29 am, Dave Benjamin wrote: > > Is it possible to exclude columns from the popup list view? > > I may have answered my own question. It looks like the popup is > generated from the changelist_view method of ModelAdmin, and thi

Re: is it possible to have more than one search result in a view

2009-04-16 Thread greatlemer
Whoops, I think I hit the wrong reply option when I tried to post to this just now as it doesn't seem to have gone to the group. If what you're looking to do is to combine the results of both queries into one then what you probably want to use are the django Q objects to give something like this:

csv download link or views that the modify more than one template...

2009-04-16 Thread Nick
I'm interested in returning both an html view (as a template) and a link to a csv file (either as a template or using the CSV module) in response to a query (GET or POST). Is there a way to both of these actions simultaneously without hitting a database twice and without writing a file to disk?

Re: Fewer columns in admin popups

2009-04-16 Thread Dave Benjamin
On Apr 16, 2:20 pm, Alex Gaynor wrote: > This code isn't threadsafe.  If you use your application in a multithreaded > application they will "cross the streams" so to speak and you will see > things rendred with the wrong list display. Ahh, that's what I was afraid of. Thanks for the confirmatio

Re: Generic relations and unit tests.

2009-04-16 Thread Stavros
Is there some way I can empty the contenttypes table before the fixtures are loaded and have django load them normally? That would take care of this problem, as it would mean that the proper contenttypes would get loaded from the fixture. Unfortunately, I have not been able to find a way to run co

Re: Fewer columns in admin popups

2009-04-16 Thread andybak
Is there any other approach to this that could be thread safe? On Apr 16, 10:46 pm, Dave Benjamin wrote: > On Apr 16, 2:20 pm, Alex Gaynor wrote: > > > This code isn't threadsafe.  If you use your application in a multithreaded > > application they will "cross the streams" so to speak and you w

Re: Two projects, one admin, filebrowser

2009-04-16 Thread shacker
On Apr 15, 12:37 am, patrickk wrote: > ### if your intranet-site and your public-site are on the same server > you could maybe use a symlink as well. > ### you could also "hack" the upload-function. define a second upload- Ah, right - by just symlinking the upload dir from one site to the other

Re: Queries, how to get what i want?

2009-04-16 Thread google torp
Hi. I think the problem is that get is being run before the exclude when you still have two results and fails as it can only handle a single result. In this case you can't use get but should use filter().exclude()[0] to get the result. On Apr 16, 10:01 pm, zayatzz wrote: > I need help with makin

Re: Fewer columns in admin popups

2009-04-16 Thread Dave Benjamin
On Apr 16, 3:30 pm, andybak wrote: > Is there any other approach to this that could be thread safe? Well, one way would be to cut and paste the entire body of changelist_view from django/contrib/admin/options.py and add some logic around the call to the ChangeList constructor. However, this woul

Query exclude in and selective sort questions

2009-04-16 Thread Thierry
Let's say I have a list of words in my database: ['bbb', 'aaa', 'zzz', 'ddd'] How can I retrieve a list of the above excluding the following words ['aaa', 'zzz'] by using __in? I can do the above with: words_list = Words.objects.exclude( Q(word_name = 'aaa') | Q(word_name = 'zzz')

Re: Help! PNG file upload error...

2009-04-16 Thread higer
Can anyone tell me why does this problem occur? On Apr 12, 2:13 pm, higer wrote: > Thanks for your suggestion. But Python 2.5 already has zlib moudle. > To png file,I wrote lines of code to save it first on disk and then > handled the saved copy,then that works. > I do not why there is some diff

Re: setting a model field to null

2009-04-16 Thread rvr
Obviously I misread something. None works perfectly. Thanks very much. On Apr 16, 3:05 pm, Margie wrote: > blah.foo = None should do the trick > > On Apr 15, 8:01 pm, rvr wrote: > > > > > How can I set a model field to null after it has had a non-null value? > > > -- > > class Blah(models.Model

Creating menu from self-nested list

2009-04-16 Thread skydark
I have an app in which the objects can relate to themselves and I wrote a view function that returns a nested list in a similar structure as the one accepted by the unordered_list built-in template tag. [['cat1', ['sub1',sub2]], ['cat2', ['sub3', ['sub4,[sub5]]] ]] I want more than just a simple

how to organize favorites in template?

2009-04-16 Thread James
Hi, I'm writing a video site on app engine where the user can tag videos as favorites. What I've done is store the keys of a users favorite videos in a dict, and I try to determine if I should be allowing them to add or remove this video from their favorites like this (truncated): {% for video

Django doesn't validates CharFields before gitting the DB?

2009-04-16 Thread Horacio de Oro
Hi! I've a problem with Django not validating my 'CharField's. Maybe I'm misunderstanding the docs, and Django doesn't do this kind of validations? I've made a simple example. This is the model: class SimpleModelC(models.Model): name=models.CharField(max_length=256) image_content_type=mo

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread zayatzz
If the tables of this app hold no info, then you can do python manage.py reset appname. This clears all tables of this app but the changes will hit database :) Alan On Apr 16, 7:11 pm, Aneesh wrote: > This is by design.  syncdb only checks to see if it needs to create > any new DB tables for an

Re: FileUploadHandler not called in realtime

2009-04-16 Thread legutierr
I am experiencing exactly the same problem with Apache running against FastCGI on a Mac. It would seem that the problem is on the Django side, not on the webserver side if this is the case. Thomasz- Have you figured out a solution to this problem? Did you log a bug in the defect tracker? --~--~

  1   2   >