Re: contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Karen Tracey
On Thu, Apr 29, 2010 at 11:08 PM, Russell Keith-Magee < freakboy3...@gmail.com> wrote: > On Fri, Apr 30, 2010 at 5:03 AM, Felippe Bueno > wrote: > > django-1.2 will support this. > > I'm sorry - what is this based on? There haven't been any substantive > changes to

Re: contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Russell Keith-Magee
On Fri, Apr 30, 2010 at 5:03 AM, Felippe Bueno wrote: > django-1.2 will support this. I'm sorry - what is this based on? There haven't been any substantive changes to contrib.auth in 1.2. It's not on the official "new features" list. There have been some discussions

Re: Problem logging into admin site

2010-04-29 Thread gsnyder2007
I know this is way delayed, but in the hopes it helps someone else out there... if you have, SESSION_COOKIE_SECURE = True then the browser may not be sending the cookie back to your view on an http (i.e. not https) page. The behavior is as you described. The admin login complains that the

Re: django-admin tab completion not working

2010-04-29 Thread Xavier Ordoquy
Hi, I'm on OSX (snow leopard) with default shell, python but django 1.2 beta within a virtual env. Having the django_bash_completion sourced, the django-admin.py he completes correctly to "help". Regards, Xavier. Le 29 avr. 2010 à 19:41, Martin Lundberg a écrit : > Anyone on OSX who has had

Re: Refresh django settings without restarting apache

2010-04-29 Thread Graham Dumpleton
On Apr 30, 2:57 am, "ge...@aquarianhouse.com" wrote: > Sure, with WSGI script reload In respect of what? You can't just say WSGI as a generalised concept in this case, you have to refer to the specific WSGI hosting mechanism. Many WSGI hosting mechanisms don't provide

Re: Refresh django settings without restarting apache

2010-04-29 Thread Graham Dumpleton
On Apr 30, 4:01 am, "ge...@aquarianhouse.com" wrote: > it should be already switched on > > http://www.modpython.org/live/current/doc-html/dir-other-par.html That has zero effect in the case of Django. The automatic reloading in mod_python only applies to handler code

Re: Trouble constructing raw SQL requiring multiple LIKE statements

2010-04-29 Thread Bill Freeman
I think that there's an extra "samples.description LIKE" in there (occurs twice). But, should you want to do this with the ORM, assuming that samples is a model (or could be made one, see the legacy database stuff in the docs), I think that it could be done with Q objects using

Re: Problem with letters like ÄÖÕÜ in django adm in

2010-04-29 Thread Bill Freeman
I don't have time to look in detail right now, but if you're using pages cms, try putting: PAGE_SANITIZE_USER_INPUT = False in your settings.py (after or in place of anywhere you set it True). The last time I got this it was due to a bug in the sanitize stuff in that it converted perfectly valid

Trouble constructing raw SQL requiring multiple LIKE statements

2010-04-29 Thread Daniel
Hi guys, I am having trouble getting multiple LIKE statements to work using cursor.execute(SQL, [params]). Here is my raw SQL query which I have confirmed is working directly at the mysql command line: "SELECT samples.number from samples WHERE samples.description LIKE samples.description LIKE

Re: contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Felippe Bueno
django-1.2 will support this. for now, I think the only way to do this is using some hacks like: http://www.djangosnippets.org/snippets/74/ On Thu, Apr 29, 2010 at 5:01 PM, Thomas Allen wrote: > Hi everyone, > > I am looking for a way to replace the username with the

Re: Django app svn management

2010-04-29 Thread Dexter
This was not really a feature request or how its really setup. But I wanted to know how the community thinks of this kind of development setup. I'm looking forward to your responses. Grtz, Dexter On Thu, Apr 29, 2010 at 4:10 PM, Dexter wrote: > Hi there, > > I was

[Ann] django_audit 0.0.2

2010-04-29 Thread Dj Gilcrease
https://code.google.com/p/django-audit/ This is a fairly comprehensive Audit Trail App that uses regular django models and is not tied to a "NoSQL" solution Disclaimer: The nature of Audit requirements makes it impossible for a one size fits all solution. This solution fits my requirements very

contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Thomas Allen
Hi everyone, I am looking for a way to replace the username with the email address as the unique key for user accounts. Is there a setting in contrib.auth to allow this? The solutions I've seen so far are hacks, validating email uniqueness via a form rather than as a model field, etc. In my mind

Re: Problem with letters like ÄÖÕÜ in django adm in

2010-04-29 Thread zayatzz
Buh... took me a while to get around to do it. After first installing the django trunk it revealed another problem first though. Not sure if this can be the cause or not? The problem was django tinymce import error. In django tinymce widgets line 14 there was from django.forms.util import

Re: Oracle cursor.execute problem

2010-04-29 Thread Tim Sawyer
Excellent, I'll give trunk a go. Thanks Ian. Tim. Ian wrote: On Apr 27, 2:36 pm, Tim Sawyer wrote: Hmm, nearly. That gets around the error, but the return value isn't populated. >>> import cx_Oracle >>> from django.db import connection >>> cursor =

Re: Refresh django settings without restarting apache

2010-04-29 Thread Kashif Ali
Thank you Georg i am checking into it. On Thu, Apr 29, 2010 at 11:01 PM, ge...@aquarianhouse.com < ge...@aquarianhouse.com> wrote: > it should be already switched on > > http://www.modpython.org/live/current/doc-html/dir-other-par.html > > On Apr 29, 7:14 pm, Kashif Ali

Re: Refresh django settings without restarting apache

2010-04-29 Thread ge...@aquarianhouse.com
it should be already switched on http://www.modpython.org/live/current/doc-html/dir-other-par.html On Apr 29, 7:14 pm, Kashif Ali wrote: > Thanks for your response. > > One more question: Is it possible with mod_python?. This is because i am > using mod_python currently

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
Hi Continuation, In Django, at this time, the best you can do is: class AuctionBid(models.Model): class Meta: unique_together = ( ( ' On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
In Django, the best current option I know of is: from django.db import models class AuctionBid(models.Model): On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class AuctionBid for which the > "natural"

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
Hi Continuation, In Django, at this time, the best you can do is: class AuctionBid(models.Model): class On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class AuctionBid for which the > "natural" PK is

Re: django-admin tab completion not working

2010-04-29 Thread Martin Lundberg
Anyone on OSX who has had this same problem? I'm going crazy here. Would really want it to work since it would make it much easier to use django-admin. On Thu, Apr 29, 2010 at 12:01 AM, Martin Lundberg wrote: > Hello, > > I've source the django_bash_completion script

Re: Refresh django settings without restarting apache

2010-04-29 Thread Kashif Ali
Thanks for your response. One more question: Is it possible with mod_python?. This is because i am using mod_python currently not WSGI. On Thu, Apr 29, 2010 at 9:57 PM, ge...@aquarianhouse.com < ge...@aquarianhouse.com> wrote: > Sure, with WSGI script reload > > On Apr 29, 6:51 pm, Kashif Ali

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread xRobot
thanks but now I prefer to tweak sorl-thumbnail ;) --- On 29 Apr, 18:51, "ge...@aquarianhouse.com" wrote: > http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ > > On Apr 29, 6:48 pm, xRobot wrote: > > > > > > > No I

Re: Refresh django settings without restarting apache

2010-04-29 Thread ge...@aquarianhouse.com
Sure, with WSGI script reload On Apr 29, 6:51 pm, Kashif Ali wrote: > Hi, > > Is it possible to refresh changes to apache (webserver) without restart it? > Actually i have multiple databases that i need to change while the webserver > is running. Is it possible? > > Or any

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread ge...@aquarianhouse.com
http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ On Apr 29, 6:48 pm, xRobot wrote: > No I am newbie and I don't know how to overwrite storage... could you > help me  ^_^ ? > > > > On 29 Apr, 12:46, "ge...@aquarianhouse.com"

Refresh django settings without restarting apache

2010-04-29 Thread Kashif Ali
Hi, Is it possible to refresh changes to apache (webserver) without restart it? Actually i have multiple databases that i need to change while the webserver is running. Is it possible? Or any other way to accomplish this task? i.e. use multiple databases for django application. Regards, Kashif

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread xRobot
No I am newbie and I don't know how to overwrite storage... could you help me ^_^ ? On 29 Apr, 12:46, "ge...@aquarianhouse.com" wrote: > Did you try to overwrite the storage? > > On Apr 29, 6:16 pm, xRobot wrote: > > > > > > > I

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread ge...@aquarianhouse.com
Did you try to overwrite the storage? On Apr 29, 6:16 pm, xRobot wrote: > I want to use str(uuid.uuid4()) instead of the name uploaded. > > For instance: I have this model: > > class foo(models.Model): >    pic  = ThumbnailField(upload_to='pics', size=(200, 200)) > > I

sorl-thumbnail: random name in Thumbnail field

2010-04-29 Thread xRobot
I want to use str(uuid.uuid4()) instead of the name uploaded. For instance: I have this model: class foo(models.Model): pic = ThumbnailField(upload_to='pics', size=(200, 200)) I am uploading hello_world.jpg and I should save these named versions should be saved for example in:

Re: Setting readonly_fields dynamically

2010-04-29 Thread Nick
Yes that works, totally missed the get_readonly_fields method - thanks! Nick On Apr 29, 4:40 pm, Daniel Roseman wrote: > On Apr 29, 3:43 pm, Nick wrote: > > > > > > > Hi, > > > I would like to set some fields to be readonly in the Admin app based > > on

Re: Saving the query object for later

2010-04-29 Thread Bill Freeman
cleaned_data is just a dictionary. Every time you accept a form in order to do a search, you write code to take the form data from cleaned_data, plus, perhaps, request.user and/or things you can pull from request.user, and build a queryset. That code can clearly be refactored into a separate

ANN: django-currencies 0.2.1

2010-04-29 Thread Panos Laganakos
Description: django-currencies allows you to define different currencies, and includes template tags/filters to allow easy conversion between them. Download: http://pypi.python.org/pypi/django-currencies/0.2.1 Documentation: http://packages.python.org/django-currencies/ Source Code:

Re: Setting readonly_fields dynamically

2010-04-29 Thread Daniel Roseman
On Apr 29, 3:43 pm, Nick wrote: > Hi, > > I would like to set some fields to be readonly in the Admin app based > on some logic, and would like to use the new readonly_fields attribute > of ModelAdmin if possible (rather than some other sort of hack). > > I'm trying to access

Setting readonly_fields dynamically

2010-04-29 Thread Nick
Hi, I would like to set some fields to be readonly in the Admin app based on some logic, and would like to use the new readonly_fields attribute of ModelAdmin if possible (rather than some other sort of hack). I'm trying to access readonly_fields, but get the error "'GalleryForm' object has no

Re: Saving the query object for later

2010-04-29 Thread derek
On Apr 28, 7:45 pm, Peter Landry wrote: > +1 to this. I had similar requirements, and initially went down the road of > pickling a queryset. It became clear quickly that (at least in my case) a > better solution was to have a function that translates a Form instance into > a

Re: Django Admin limits

2010-04-29 Thread derek
On Apr 29, 12:47 pm, Martin Tiršel wrote: > Hello, > > I am still a newbie exploring possibilities of Django but you learn > advanced techniques often on really big applications. I have here my two > projects I want to do in Django (1. advanced eshop system and 2. >

add custom sidebar to admin site

2010-04-29 Thread Alessandro Ronchi
I need to add some custom links to sidebar in admin section. What's the cleaner way to make that? I can only override the index.html template? -- Alessandro Ronchi http://www.soasi.com SOASI - Sviluppo Software e Sistemi Open Source Hobby & Giochi, l'e-commerce del divertimento

Django app svn management

2010-04-29 Thread Dexter
Hi there, I was wondering if there is a solution to manage a django deployment with svn like revision tool. What I would like to have my main django deployment to be a trunk like folder. When I want to test something, or make a new app, I want to make a branch oid. which should be visible under

Re: Distributing application

2010-04-29 Thread Baurzhan Ismagulov
On Thu, Apr 29, 2010 at 04:37:09AM -0700, Mag wrote: > I was wondering what is the best way to distribute my application? IMHO, the best way is the native way of your target platform. I.e., MSI for Windows, rpm for RedHat, etc. I'd also bundle dependencies together with the app. With kind

Re: Distributing application

2010-04-29 Thread Dexter
What do you mean by distributing your app? getting people to view it?, or having your clients running their own server. If you want people to view it, you have to deploy a django installation somewhere with your app. Else, if you want you clients to have each their own app, theyll have to have

Distributing application

2010-04-29 Thread Mag
I have been using Django and I like it a lot. I was wondering what is the best way to distribute my application? Previously, with Apache tomcat it was very easy to distribute it. I provided the tomcat server and the war file and everything was done. Is there a tool or a preferred way to do this?

Re: Django Admin limits

2010-04-29 Thread Joao Silva
Hello Martin, Django admin has its limitations and this quote from djangobook.com http://djangobook.com/en/2.0/chapter06/ will clarify your comment. "One final point we want to make clear is: the admin site is not an end-all-be-all. Over the years, we’ve seen it hacked and chopped up to serve a

Django Admin limits

2010-04-29 Thread Martin Tiršel
Hello, I am still a newbie exploring possibilities of Django but you learn advanced techniques often on really big applications. I have here my two projects I want to do in Django (1. advanced eshop system and 2. webhosting management [customer database, invoicing, webhosting settings, trouble

Re: Saving Child Records via ForeignKeyField

2010-04-29 Thread Atamert Ölçgen
You initialize (__init__) your ZoneType model instead of create()'ing. When you save an initialized it doesn't get an id magically. I suggest you to use ZoneType.objects.create() whenever possible. But if you must init your model first; make sure you get() it again to retrieve its id. Remember

Re: Saving Child Records via ForeignKeyField

2010-04-29 Thread bheathr
Here are the models: class ZoneType(models.Model): name = models.CharField(max_length=50) color = models.CharField(max_length=7) class Meta: app_label = 'maps' class Zone(models.Model): name = models.CharField(max_length=50) type = models.ForeignKey(ZoneType) code

Re: Deleting parent object when many related objects exist is to slow

2010-04-29 Thread dzida
I found this quite interestine discussion: http://groups.google.com/group/django-developers/browse_thread/thread/166752daf5c96499/007ff42d83ac60c0 my opinion is close to Russell Keith-Magee opinion there. It looks like a lot of effort was done just to conform django with small number of

Re: "dynamically" setting ModelAdmin properties?

2010-04-29 Thread Daniel Roseman
On Apr 29, 6:10 am, akonsu wrote: > hello, > > in my custom admin class that inherits ModelAdmin i need to set > ModelAdmin.exclude, ModelAdmin.list_display, etc based on whether the > logged in user is a superuser or not. > > is this possible? > > thanks > konstantin >

Re: Transaction commit with cursor.execute

2010-04-29 Thread idle sign
> When line 7 is uncommented, transaction management is > enabled, and the view works as I would expect. So it is, my bad, thank you againg. You see, it seemed a little weird, that first (with the decorator) we force transaction to commit manually to use 'test' for all that would happen in our

Re: Transaction commit with cursor.execute

2010-04-29 Thread idle sign
> When line 7 is uncommented, transaction management is > enabled, and the view works as I would expect. So it is, my bad, thank you againg. You see, it seemed a little weird, that first (with the decorator) we force transaction to commit manually to 'test' all that would happen in our view

Re: Transaction commit with cursor.execute

2010-04-29 Thread idle sign
> When line 7 is uncommented, transaction management is > enabled, and the view works as I would expect. So it is, my bad, Russ, thank you againg. You see, it seemed a little weird, that first (with the decorator) we force transaction to commit manually to 'test' all that would happen in our

Re: Saving Child Records via ForeignKeyField

2010-04-29 Thread akonsu
hello, it would be easier to help if you provided your modes. are you missing this: http://docs.djangoproject.com/en/dev/ref/models/relations/#ref-models-relations for example: >>> b = Blog.objects.get(id=1) >>> e = b.entry_set.create( ... headline='Hello', ... body_text='Hi', ...

Saving Child Records via ForeignKeyField

2010-04-29 Thread Robinson B. Heath
I believe I have done my due diligence, but point me in the right direction if I am missing something. I am working on a generic importing engine to import various file formats(csv, fixed length, etc) into django models based on json formatted file definitions. It needs to do something like

Re: Transaction commit with cursor.execute

2010-04-29 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 12:20 PM, idle sign wrote: > I'm using the latest trunk from http://github.com/django/django. > A complete test project you can grab at > http://idlesign.narod.ru/django/django-tests.tar.gz > There is a little bootstrap.sh to run to create DBs. > >