replace admin login or use login_url

2010-04-18 Thread chris_ingenhaag
Hi, is it possible to set a view / form for the admin login site. I want to use captchas with login, but the admin site uses its own. Why doesn ´t the admin use the defined LOGIN_URL in settings.py. I also found messages here with decorating admin root site but it´s deprecated and I don´t know how

Where to set proxy settings for Django?

2010-04-18 Thread Victor Hooi
heya, This is a fairly trivial thing, but anyhow: We're working on a Django app behind a corporate proxy/firewall. We have a model with URLField, and by default, verify_true is false. So of course, Django wants to punch out to the web to check if the URL exists. Now if I define "http_proxy" befo

Re: Django Admin - m2m widget with blank=true, null=true - How to unselect all FKs?

2010-04-18 Thread Victor Hooi
Jani, Aha, that worked, thanks =). Don't know why I didn't think about using Ctrl...lol. However, do you think it'd be obvious to new users, to use ctrl? Cheers, Victor On Apr 19, 2:46 pm, Jani Tiainen wrote: > On 04/19/2010 06:58 AM, Victor Hooi wrote: > > > > > > > Hi, > > > I have a field

Re: Oracle - DatabaseError: ORA-01830 with a legacy db

2010-04-18 Thread Ian
On Apr 18, 7:25 am, pablo wrote: > I had a Django1.1 project that use a legacy MySQL db. > After importing the db to oracle 11g I'm getting: > DatabaseError: ORA-01830: date format picture ends before converting > entire input string Did you use syncdb to create the Oracle schema? If not, you pr

Re: get_next_by title?

2010-04-18 Thread ChrisR
I still haven't found anything useful to help on this. Anyone have any thoughts, suggestions, pointers? -- 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

Re: Django Admin - m2m widget with blank=true, null=true - How to unselect all FKs?

2010-04-18 Thread Jani Tiainen
On 04/19/2010 06:58 AM, Victor Hooi wrote: Hi, I have a field in a model which is set to null/blank = True firm = models.ManyToManyField(Firm, null=True, blank=True) I tried using the default m2m filter, however, I wasn't sure how to unselect an entry. I also tried using filter_horizonta

Django Admin - m2m widget with blank=true, null=true - How to unselect all FKs?

2010-04-18 Thread Victor Hooi
Hi, I have a field in a model which is set to null/blank = True firm = models.ManyToManyField(Firm, null=True, blank=True) I tried using the default m2m filter, however, I wasn't sure how to unselect an entry. I also tried using filter_horizontal, and this was much more intuitive/ niftier.

feed decorator

2010-04-18 Thread Streamweaver
I'm having trouble developing a feed decorator. I feel like the decorator I've come up with should work but isn't and I wanted to ask if someone can spot my error. I have two view methods one that returns a normal HTML view and another that returns an rss feed of the same data. They both take the

Re: why am i getting this error?

2010-04-18 Thread Shawn Milochik
This is a simple Python dictionary exception; it has nothing to do with Django. > Stuff.objects.create(title=self.cleaned_data['title'], > > Exception Type: KeyError at /add_stuff/ > Exception Value: title You're asking for the value of the dictionary in key 'title,' but there's no such thing.

Re: Admin inline extra field

2010-04-18 Thread nulvinge
I managed to solve it. part of my model was: class Hour(models.Model): store = models.ForeignKey('Store', unique=True) And it shouldn't have been unique. Hmm, maybe there should be some warning message to clarify this or atleast document it, because I have searched a lot of docs to find wha

Re: Admin inline extra field

2010-04-18 Thread nulvinge
Since this thing seems to be under some development now I should maybe say that I'm using the debian python-django package version 1.1.1-5. On Apr 19, 1:21 am, nulvinge wrote: > I simply can't get the extra field of inlining to work with the admin > interface. > Whatever I do the admin interface

Admin inline extra field

2010-04-18 Thread nulvinge
I simply can't get the extra field of inlining to work with the admin interface. Whatever I do the admin interface only shows one row of Hour Here's my admin.py: from gshop.gs.models import (Store, Brand, District, Category, Hour) from django.contrib.gis import admin class MyGeoAdmin(admin.OSMGeo

Using legacy database with Django

2010-04-18 Thread Daniel Winter
Hello, I am evaluating the use of Django for a project. I went through the tutorial and read some of the other documentation. The problems is we use an existing database structure. There is no real way arround using that. So I would like to hear if and how you would use that with Django. Let

Re: form won't save my submitted form

2010-04-18 Thread JoJo
ok thanks i got that working but i just have one more question to ask you, when i refresh the page the data is still there ok, but when i leave the page and come back its gone, can you help me with my question? Please and thank you On Apr 16, 11:48 pm, Joanne Culligan wrote: > ok but now i am get

How to set the size for Inline Dropdown lists

2010-04-18 Thread Asim Yuksel
Hi I have an inline model. It lists the foreign keys in a dropdown list. It adjusts its size according to the largest text in it. How can I have a small dropdown list? It is too big. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

why am i getting this error?

2010-04-18 Thread JoJo
I have a page set up where a user can submit data, they write the data into the text field and press submit but i keep getting this error Traceback: File "c:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response 92. response = callback(request, *callback_args,

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
I got it working, thanks to your suggestion. Here is what I did: # in forms.py class SiteForm(forms.ModelForm): class Meta: model = Site exclude = ('user',) def __init__(self, user, *args, **kwargs): self.user = user super(SiteForm, self).__init__(*args, *

Re: I need django open-source project to newspaper

2010-04-18 Thread Shawn Milochik
Try Google. -- 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...@googlegroups.com. For more options, visit th

Multiple instance of the same app

2010-04-18 Thread Kepioo
Hi All, I am trying to come up with a climbing guide website. My original design was to have : a guide app that defines the abstract models, the views and urls n climbing sites that extend the climbing app mysite/ guide climbingsite1 climbingsite2 climbingsite3 ... The m

I need django open-source project to newspaper

2010-04-18 Thread Hussain Deikna
Hi for all, please I need an open source newspaper web side . thank you bye -- 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 djan

Re: select_related() and primary-keys

2010-04-18 Thread Daishy
Hi, Thanks for the answer. My problem was, the id/pks werent populated, they were just None. But it seems that problem is related to some other problem in my models, which i have to fix first. Maybe that will fix my problems :) On 18 Apr., 19:32, Daniel Roseman wrote: > On Apr 18, 5:32 pm, Daishy

Re: select_related() and primary-keys

2010-04-18 Thread Daniel Roseman
On Apr 18, 5:32 pm, Daishy wrote: > Hi together, > > I'm trying to use select_related in a query, but it seems i'm doing > something wrong. I have googled, but not really found anything (Maybee > used the wrong keywords :/) > > I've got a model that is related to another model, roughly like that:

select_related() and primary-keys

2010-04-18 Thread Daishy
Hi together, I'm trying to use select_related in a query, but it seems i'm doing something wrong. I have googled, but not really found anything (Maybee used the wrong keywords :/) I've got a model that is related to another model, roughly like that: class A(models.Model): a = models.CharField(

Re: ChoiceField Being Unpatriotic

2010-04-18 Thread ge...@aquarianhouse.com
Can you provide the source code? The error doesn't make sence. On Apr 18, 6:15 pm, amyhalf wrote: > Hi, thanks for the reply! > > I changed it to what you suggested but it's mad about something else, > now: > > TemplateSyntaxError > Caught an exception while rendering: 'ModelChoiceField' object

Re: ChoiceField Being Unpatriotic

2010-04-18 Thread amyhalf
Hi, thanks for the reply! I changed it to what you suggested but it's mad about something else, now: TemplateSyntaxError Caught an exception while rendering: 'ModelChoiceField' object has no attribute 'all' It's mad about how render it: {{ form.state }} I didn't read here (http://docs.djangopr

static behaviour of multiple database functionality.

2010-04-18 Thread Harsha Reddy
Hi All, Could you please help me work around the following behaviour in Django framework Actual Behaviour: ./manage.py shell >>> from multidb.foo.models import * >>> from multidb.settings import * >>> DATABASES['secondarydb']['NAME'] = '/usr/src/multidb/secnario1.db' >>> res = Result.objects.usi

Call for discussion: Loading js assets of widgets without clashing with others?

2010-04-18 Thread Stefan Foulis
Hi I hope to start a discussion to find a consistent way to include javascript frameworks for custom widgets. It should prevent clashes between the javascript dependencies. We'll need to find a best practice that developers can follow to allow re-usable widgets to coexist site-by-side. I'm using j

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
Thanks Georg. I will give that a try. On Apr 18, 7:45 am, "ge...@aquarianhouse.com" wrote: > ok now i got it :) > > i would do this: > > class SiteForm(forms.ModelForm): > >     def __init__(user, *args, **kwargs): >        self.user = user >        super(SiteForm, self).__init__(*args, **kwargs)

Re: Saving a ModelForm for the current user?

2010-04-18 Thread ge...@aquarianhouse.com
ok now i got it :) i would do this: class SiteForm(forms.ModelForm): def __init__(user, *args, **kwargs): self.user = user super(SiteForm, self).__init__(*args, **kwargs) class Meta: model = Site exclude = ('user',) def clean_url(self): #check h

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
Thanks for the reply. The problem I have with that solution is that it occurs after form validation takes place. Notice that in my Site model the url and user fields are specified as being unique_together. If I set the user as you suggest, I still run the risk of a database error. Is there anothe

Oracle - DatabaseError: ORA-01830 with a legacy db

2010-04-18 Thread pablo
Hi, I had a Django1.1 project that use a legacy MySQL db. After importing the db to oracle 11g I'm getting: DatabaseError: ORA-01830: date format picture ends before converting entire input string I've found several posts and tickets but havn't found a fix. How can I find what is the part that c

Re: code repetition in views

2010-04-18 Thread Roald de Vries
On Apr 11, 2010, at 5:58 AM, ydjango wrote: I find all my view method have identical code in start and in end: anyway to avoid repetition...? Example: def typical_view_method(request): Check if user is authenticated. Get user and group Get some session variables try: Method s

Re: code repetition in views

2010-04-18 Thread Thierry Chich
Le 16 avr. 2010 à 20:32, Carl Zmola a écrit : 2) Rewriting your views as classes is the modular way and probably the most flexible. A nice trick with the use of inheritance is to make the class a callable def __call__(self, request, **kwargs): This method provides the view

Re: how to install django in ubuntu .........

2010-04-18 Thread Thierry Chich
What is the point ? Why aren't you using the apt-get ? Le 16 avr. 2010 à 23:38, ChrisR a écrit : Download this: http://www.djangoproject.com/download/1.1.1/tarball/ or wget http://www.djangoproject.com/download/1.1.1/tarball/ tar xzvf Django-1.1.1.tar.gz cd Django-1.1.1 sudo python setup.py

Re: Saving a ModelForm for the current user?

2010-04-18 Thread ge...@aquarianhouse.com
use commit=False m = form.save(commit=False) m.user = request.user m.save() On Apr 18, 6:06 am, David Lindquist wrote: > Greetings, > > I am trying to solve what seems like an easy problem, but the solution > eludes me even after many Google searches. > > I have a simple model: > > class Site(mo

Re: Modify Content-Type to play MP3?

2010-04-18 Thread ge...@aquarianhouse.com
something like: f = open("file.mp3", "rb") data = f.read() f.close() return HttpResponse(data, mimetype='audio/mp3') On Apr 18, 6:34 am, The Danny Bos wrote: > Heya, > > I'm trying to modify the content-type of a page to play an MP3. > > Basically, instead of pointing directly to an MP3, I'm po

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-18 Thread Michael Strickland
Temporary fix: It appears to be a result of changeset [12637] in memcached.py: http://code.djangoproject.com/changeset/12637 # memcached.py, lines 53-54 removed in def set() 53: if isinstance(value, unicode): 54:value = value.encode('utf-8') In my templates at least, this means that before