Re: update_object generic view doesn't see model's get_absolute_url

2010-07-30 Thread David
Solved. I used Django's traces to discover that the object wasn't being passed to the view on POST. Inserting some exceptions in different places in the source, I found that it was at the point the form was saved that the model reference was lost. Looking at the form I realized I wasn't

Re: UnicodeEncodeError

2010-07-30 Thread EricBrian
Daniel, if I don't do that, I get the unicode error in the list of dashboards in the admin section. On Fri, Jul 30, 2010 at 04:29, Daniel Roseman wrote: > On Jul 29, 11:27 pm, Eric wrote: > > I am getting this error in the Django Administration

update_object generic view doesn't see model's get_absolute_url

2010-07-30 Thread David
I am using the generic view django.views.generic.create_update.update_object to edit a model. The form is displayed, the model gets updated, but on redirect, I get an ImproperlyConfigured exception. Django tells me I need to define a get_absolute_url method, but I already did, it just doesn't

Re: manage.py hangs near (or at) the end

2010-07-30 Thread psgou...@gmail.com
fwiw, the user error in question was that a developer had added a call to threading outside of any function definition or protected area. as such the manage.py process finished, but the thread was left hanging. On Jul 21, 6:16 pm, "psgou...@gmail.com" wrote: > I've seen a

Re: Flexigrid

2010-07-30 Thread Gonzalo Delgado
El 30/07/10 15:41, Ramesh escribió: > I want to use Flexigrid for my project. I have used it before on > TurboGears and it's really nice. > > Can somebody please help me how can I use flexigrid for my project? > tutorials link to start for using Flexigrid on django? > http://is.gd/dTrPN --

*Unnecessary* instances of HTML escape sequences like ?

2010-07-30 Thread Chris Seberino
I understand the need for web pages to denote the 5 HTML special characters >, &, <, ', and " with alternate representations like . (These 5 are the *only* special characters in HTML right?) What I don't understand is why an HTML page encoded with UTF-8 would use this

Flexigrid

2010-07-30 Thread Ramesh
Hi, I want to use Flexigrid for my project. I have used it before on TurboGears and it's really nice. Can somebody please help me how can I use flexigrid for my project? tutorials link to start for using Flexigrid on django? Thanks a lot in advance, RB -- You received this message because you

how to get parent of related m2m model instance from within a template?

2010-07-30 Thread J
I have a model, which has a related model, which then has a related m2m field (See defs below). I want to add a method to the m2m model (ie: "Button") which, when called in a template, will get me the original record that called the relation. Is this possible? See method attempt below in the

Re: django_session not in "default" DB

2010-07-30 Thread Jocelo
Hi, Thanks for your previous reply. I'm still having problems... now I'm getting the following error: NameError: global name 'Session' is not defined I check up the documentation, I understand that 'django.contrib.sessions.backends.db' makes the Session model available in the DB router

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jeff Green
Thanks Jason! That fixed the issue. On Fri, Jul 30, 2010 at 10:23 AM, Jason wrote: > Actually - make that change to the rest of the field options too. The > word wrap threw me off there at the end. > > On Jul 30, 8:16 am, Jason wrote: > > Looks like

Re: Form Validation

2010-07-30 Thread Daniel Roseman
On Jul 30, 4:49 pm, rupert wrote: > Here's the view template: > > def respondant(request): > >         user = request.user > >         if set(RESPONDANT_FIELDS).issubset(set([key for key,value in > request.POST.items()])): >                 form =

Re: Form Validation

2010-07-30 Thread rupert
Here's the view template: def respondant(request): user = request.user if set(RESPONDANT_FIELDS).issubset(set([key for key,value in request.POST.items()])): form = RespondantForm(request.POST) if form.is_valid():

Re: Form Validation

2010-07-30 Thread Daniel Roseman
On Jul 30, 4:42 pm, rupert wrote: > I'm trying to use this line of code in form validation, and it is not > working: > > {{ form.field_name.errors }} > > The following lines do output: > {{ form.filed_name}} > {{ form.field_name.help_text }} > > Any thoughts? Could it be

Form Validation

2010-07-30 Thread rupert
I'm trying to use this line of code in form validation, and it is not working: {{ form.field_name.errors }} The following lines do output: {{ form.filed_name}} {{ form.field_name.help_text }} Any thoughts? Could it be something in the view? Here is the index.html page:

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jason
Actually - make that change to the rest of the field options too. The word wrap threw me off there at the end. On Jul 30, 8:16 am, Jason wrote: > Looks like you are generating the fields in two different cases. > Here's the second one: > >                

Re: test's client.post says post but request.method says GET

2010-07-30 Thread Phlip
On Jul 30, 3:28 am, Phlip wrote: > > What's the value of `self.url`? One possibility is that it doesn't end > > with a slash > > Ends with a slash. I'm now checking the response goodies, like > response.status, to see if any other redirections happen! Yup - a redirect. My

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jason
Looks like you are generating the fields in two different cases. Here's the second one: self.fields[config.ConfigurationName] = forms.ChoiceField( choices=choicelist, required=False) Change that to:

Re: values with distinct not working as expected

2010-07-30 Thread Scott Gould
You don't need order_by to get distinct values per se, but in this case you need to put it in to override whatever default ordering you have on your model (since any order_by fields will be included in the query and thwart your distinct()). On Jul 30, 3:52 am, tuxcanfly

Re: Need Help!

2010-07-30 Thread Alex Robbins
You could look here: http://djangopeople.net/us/ny/ Or try posting here: http://djangogigs.com/ or here: http://djangozen.com/jobs/ Hope that helps, Alex On Jul 29, 11:27 am, Ken wrote: > Looking for a django developer in the NYC area! > I would appreciate any help, if

Re: Regex problem in urls

2010-07-30 Thread Alex Robbins
Based on the urls.py file you are showing us, it seems like /start/ should be a valid url. Are you running the dev server with automatic reloading? Sometimes you need to force a reload on it to see changes. (I normally notice that in the admin, but it could come up anywhere stuff gets cached in

Re: Re: Best way to find near people

2010-07-30 Thread Bill Freeman
A couple of possible optimizations: First, because cos is single valued over the range of possible angles (as measured from the center of the earth, 0 <= d <= PI) distance is monotonic with cos distance. So you can pre-calculate the cos of the distance, and compare the innder expression to that:

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 30/07/2010 12:06, Jirka Vejrazka wrote: >> I still have 2 approaches i can take. > > I still believe that there is a 3rd option there - to bypass the > view / auth / login machinery completely :) > > > If your primary goal is to cache the statistics and the statistics > does not depend

filebrowser w/ grappelli

2010-07-30 Thread Bobby Roberts
hi group. I've got filebrowser working great with grappelli. It uploads images and does the sizes automatically. I have a question though. How do you choose the size you want to to use from the filebrowser popup window when you want to insert an image? I don't see any way to do it. Does

Re: Python/Django hosting

2010-07-30 Thread Shawn Milochik
On Thu, Jul 29, 2010 at 1:22 PM, kostia wrote: > Thanks, I already know about webfraction. Great site. > > If anyone can provide cheaper solution, hosted in Europe, please write > me. > > -- http://lmgtfy.com/?q=django+hosting+europe=1 -- You received this message

ManyToMany to languages

2010-07-30 Thread Alessandro Ronchi
I need to put a manytomany that points to a list of languages. I need to create another language model or I can use a django languages one? -- Alessandro Ronchi http://www.soasi.com Hobby & Giochi http://hobbygiochi.com http://www.facebook.com/hobbygiochi -- You received this message because

[SOLVED] Re: Filtering within a ModelForm

2010-07-30 Thread Casey S. Greene
Hi Derek, Thanks for your help -- I had tried both of those but couldn't get them to work with generic views. In the end I just abandoned the generic view and used the __init__() approach and things worked. -- Casey On 07/28/2010 09:35 AM, derek wrote: On Jul 26, 6:52 pm, "Casey S.

Show mail instead user name in ForeignKey at admin

2010-07-30 Thread Alexandre González
Hi! When I'm using user as ForeignField in some of my models I get a box with the username, can I override this with the mail instead the username? I've tested making a Proxy class, but I think that the proxy classes isn't for this. I heard about MonkeyPatch but I don't know how to use it, or

Re: django autocomplete search with jQuery

2010-07-30 Thread Quenten Griffith
I actually just set this up last weekend. I used this link to understand how to do it http://lethain.com/entry/2007/dec/01/using-jquery-django-autocomplete-fields/ I also found a plugin that takes most of the work off of you from developing the feature.

[SOLVED] Re: Django Dev server doesn't reflect changes

2010-07-30 Thread barun
On Jul 30, 10:33 am, Samuel Baldwin wrote: > Try clearing any server or browser caches first. > > -- > Samuel Baldwin - logik.li -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Raw sql and admin site

2010-07-30 Thread Spoksss
# model class class Category(models.Model): CATEGORY_SEPARATOR = "." name = models.CharField(_('name'), max_length=255) idname = models.CharField(_('idname'), max_length=255, db_index=True, unique=True,) prio = models.IntegerField(_('prio'), default=0) description =

Re: Best way to present N items in table row for list

2010-07-30 Thread Wadim
On 29 июл, 12:08, Roald de Vries wrote: > First: list is a very unlucky name for a parameter, since it's the   > type of [] > > Second: list comprehension rules! > >      def groupListByRow(list): >          return [lst[start:start+5] for start in range(0, len(lst), 5)] > >

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jeff Green
Here is my form class class StationInfo( forms.Form): def __init__( self, *args, **kwargs): super( StationInfo, self).__init__( *args, **kwargs) request = args[1] selecttuple = "choice0", "--Select One--" userid = threadlocals.get_current_user() user

Re: moving to django 1.2.1

2010-07-30 Thread tiemonster
I cover some of the new changes in Django 1.2 in this article: http://www.tiemonster.info/a/24005/ Most of this information comes straight from the changelist. Others were things that the core developers must have assumed were common sense, but that I didn't think about when upgrading. If you run

Re: Django Dev server doesn't reflect changes

2010-07-30 Thread Samuel Baldwin
Try clearing any server or browser caches first. -- Samuel Baldwin - logik.li -- 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

Re: test's client.post says post but request.method says GET

2010-07-30 Thread Phlip
> What's the value of `self.url`? One possibility is that it doesn't end > with a slash Ends with a slash. I'm now checking the response goodies, like response.status, to see if any other redirections happen! -- You received this message because you are subscribed to the Google Groups "Django

Re: Raw sql and admin site

2010-07-30 Thread Daniel Roseman
On Jul 29, 11:38 pm, Spoksss wrote: > Hi, > > I try to use raw sql in admin site, it is possible somehow? > > I use postresql and have some problem with ordering. > > I have in database something like: > Category(id=1, name='first', parent_category=None, >

Re: generate cache by visiting protected links

2010-07-30 Thread Jirka Vejrazka
> I still have 2 approaches i can take. I still believe that there is a 3rd option there - to bypass the view / auth / login machinery completely :) If your primary goal is to cache the statistics and the statistics does not depend on the user that is logged in (you did pass a user with

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 29/07/2010 18:48, David De La Harpe Golden wrote: > On 29/07/10 16:58, Benedict Verheyen wrote: > >> So calling a thread once from within a view is not safe ? > > Depends on what your expectations are... > > I haven't managed to dig up the paragraph discussing the issue that I > recall

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 29/07/2010 21:10, Jirka Vejrazka wrote: >> That's why i asked on what Django uses as a key to set and entry in the >> cache. >> If i generate the page and put it on the cache and then rely on Django to >> get it, >> the key i use needs to be the same as Django uses otherwise the page isn't

Re: LANGUAGES var isn't in all views

2010-07-30 Thread Baurzhan Ismagulov
On Fri, Jul 30, 2010 at 11:14:42AM +0200, Alexandre González wrote: > If I add: > > import settings > LANGUAGES=settings.LANGUAGES > > and return it in the render_to_response it works perfectly, but can I > automatice this in all views? Sure, it works for me without passing LANGUAGES

Re: LANGUAGES var isn't in all views

2010-07-30 Thread Alexandre González
If I add: import settings LANGUAGES=settings.LANGUAGES and return it in the render_to_response it works perfectly, but can I automatice this in all views? On Fri, Jul 30, 2010 at 10:55, Baurzhan Ismagulov wrote: > On Thu, Jul 29, 2010 at 11:52:31PM +0200, Alexandre González

Re: LANGUAGES var isn't in all views

2010-07-30 Thread Baurzhan Ismagulov
On Thu, Jul 29, 2010 at 11:52:31PM +0200, Alexandre González wrote: > 42 {% for lang in LANGUAGES %} ... > It works perfectly in some webs, but in others the var LANGUAGES isn't > provide automatically, do i need to send it in the views? I don't know whether it's relevant, but do you

Re: test's client.post says post but request.method says GET

2010-07-30 Thread Daniel Roseman
On Jul 30, 1:18 am, Phlip wrote: > Django aficionados: > > Here's my test code: > >         from django.test.client import Client >         self.client = Client() >         from django.core.files.base import ContentFile >         file_content =

Re: UnicodeEncodeError

2010-07-30 Thread Daniel Roseman
On Jul 29, 11:27 pm, Eric wrote: > I am getting this error in the Django Administration section when I > add an entry for a Dashboard object. > > When I return to the item in the Admin section, the record has been > added and it displays correctly in the list of Dashboard

RE: Re: Best way to find near people

2010-07-30 Thread Henrik Genssen
I use .extra(where=[where]) and something like this (measures km, not miles): ( 6378.137 * acos( cos( radians(long) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(lat) ) + sin( radians(long) ) * sin( radians( latitude ) ) ) ) < 10 latitude and logitude are db-fields,

Re: values with distinct not working as expected

2010-07-30 Thread tuxcanfly
Thanks, that works! But I don't understand why I should order_by to get distinct values. On Jul 29, 3:59 pm, Subhranath Chunder wrote: > If you don't want to uniquify yourself, then why not simply do: > User.objects.values('username').order_by('username').distinct() > >

Re: Django Dev server doesn't reflect changes

2010-07-30 Thread Kenneth Gonsalves
On Friday, July 30, 2010 10:55:13 am barun wrote: > I've restarted the server, browser. Do I need to do anything else? browser cache? -- Regards Kenneth Gonsalves Senior Associate NRC-FOSS at AU-KBC -- You received this message because you are subscribed to the Google Groups "Django users"