Re: File Browser App

2009-02-17 Thread patrickk
of course you can install the django-filebrowser outside of the admin ... it´s basically a standalone-app with the look and feel of the admin-interface. so, you just have to change the templates and maybe the permissions. patrick. On Feb 3, 1:38 pm, cootetom wrote: > Hi all, > > I'm looking for

Re: 1.0 branch?

2009-02-17 Thread James Bennett
On Tue, Feb 17, 2009 at 11:54 PM, Lloyd Budd wrote: > Super minor suggestion, it looks like trunk is where 1.1 work is > happening, for maintaining my own project using 1.0 it might be handy > if there was django/branches/1.0/ . That way I could just do a check > out there and svn up if/when nece

Re: 1.0 branch?

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 11:54 PM, Lloyd Budd wrote: > > Hi, > > I'm just getting started with django, and really enjoying it. > > Super minor suggestion, it looks like trunk is where 1.1 work is > happening, for maintaining my own project using 1.0 it might be handy > if there was django/branches

1.0 branch?

2009-02-17 Thread Lloyd Budd
Hi, I'm just getting started with django, and really enjoying it. Super minor suggestion, it looks like trunk is where 1.1 work is happening, for maintaining my own project using 1.0 it might be handy if there was django/branches/1.0/ . That way I could just do a check out there and svn up if/wh

Re: Translation of type from urls to view

2009-02-17 Thread Kegan
Thanks! On Feb 18, 12:28 pm, Malcolm Tredinnick wrote: > On Tue, 2009-02-17 at 20:06 -0800, Kegan wrote: > > I have the following urls: > > >      url(r'/id/(?P\d+)/$', process_view) > > > and view: > > >      def process_view(request, id): > > > Does the "id" in the view is automatic translated

Re: Translation of type from urls to view

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 20:06 -0800, Kegan wrote: > I have the following urls: > > url(r'/id/(?P\d+)/$', process_view) > > and view: > > def process_view(request, id): > > Does the "id" in the view is automatic translated to int type? > > I seems to recall that was the case, with olde

Re: Translation of type from urls to view

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 11:06 PM, Kegan wrote: > > I have the following urls: > > url(r'/id/(?P\d+)/$', process_view) > > and view: > > def process_view(request, id): > > Does the "id" in the view is automatic translated to int type? > > I seems to recall that was the case, with older ver

Translation of type from urls to view

2009-02-17 Thread Kegan
I have the following urls: url(r'/id/(?P\d+)/$', process_view) and view: def process_view(request, id): Does the "id" in the view is automatic translated to int type? I seems to recall that was the case, with older version of Django (maybe I recall wrongly??). But not so with the tr

Re: Customizing Admin to display non-editable fields

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 20:25 -0500, Alex Gaynor wrote: [...] > Writing a custom widget to do it isn't especially easy because the > render method on widgets doesn't get the initial value, however you > can do it: > http://lazypython.blogspot.com/2008/12/building-read-only-field-in-django.html Yea

Re: Customizing Admin to display non-editable fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 8:23 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Tue, 2009-02-17 at 17:19 -0800, mermer wrote: > > Is there a way to display only the values of certain fields in the > > Admin, so that it is clear that those fields are non-editable? > > You would have t

Re: Customizing Admin to display non-editable fields

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 17:19 -0800, mermer wrote: > Is there a way to display only the values of certain fields in the > Admin, so that it is clear that those fields are non-editable? You would have to write a custom form widget to do so. There's nothing out-of-the-box yet. We'll get to it one day

Customizing Admin to display non-editable fields

2009-02-17 Thread mermer
Is there a way to display only the values of certain fields in the Admin, so that it is clear that those fields are non-editable? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Strange bug when Debug = False

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 15:34 -0800, Yanik wrote: > I've been having this problem for a few weeks and I can't, for the > life of me, figure it out. > > I have 2 types of environments: my local dev server, running Ubuntu, > and the live server, running Fedora 9. The problem only occurs on on > the F

Re: Date and Times

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 07:28 -0800, ReneMarxis wrote: > Very sorry to bug you againe, but this is getting very critical > > Please can someone tell me how to format output of one DateField in a > way that form.is_valid() is not breaking? What do you mean by breaking? When I use the example c

Re: idea on how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 03:55 -0800, alan wrote: > Following up on this discussion: > http://groups.google.com/group/django-users/browse_thread/thread/83f7b9b93973671f/e4b40ec5a482d155?hl=fr&lnk=gst&q=jsi18n+cache#e4b40ec5a482d155 > > How about a solution where the js i18n file would contain all th

Re: Multiple Databases Revisited (Interim)

2009-02-17 Thread Malcolm Tredinnick
On Tue, 2009-02-17 at 03:26 -0800, proteus...@gmail.com wrote: > I've been following the discussion about supporting multiple > databases within one project (primarily on a per-app or per-model > basis) with interest and look forward to the feature getting > solidified and implemented into the tr

Strange bug when Debug = False

2009-02-17 Thread Yanik
I've been having this problem for a few weeks and I can't, for the life of me, figure it out. I have 2 types of environments: my local dev server, running Ubuntu, and the live server, running Fedora 9. The problem only occurs on on the Fedora server and only when Debug = False. The tricky par is,

Re: You don't have permission to edit anything - new forms admin

2009-02-17 Thread Russell Keith-Magee
On Wed, Feb 18, 2009 at 2:17 AM, Rajesh Dhawan wrote: > > >> >> # Admin: >> ('^hiveadmin/(.*)', admin.site.root), > > > That's no longer the right way to hook the admin into your URL conf. > See here: > > http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-adminsite-instance

Re: Django and php can they mix?

2009-02-17 Thread Nick Lo
> I'm looking into using Django to redevelop a website to handle dynamic > content and some social app functions. I am interested in knowing > whether django can work alongside php, we built a modest database to > work on news articles in php and are considering using facebook's api > for an appli

Re: uploading files

2009-02-17 Thread Tonu Mikk
Karen Tracey wrote: > On Tue, Feb 17, 2009 at 11:50 AM, Tonu Mikk > wrote: > > Alex Gaynor wrote: > > > Uploaded files have a name attribute that contains their name. > Yes, but how does one take advantage of that in this code? > > > You simply use the name attri

Re: linking to files from database

2009-02-17 Thread Tonu Mikk
Jacob Kaplan-Moss wrote: > On Tue, Feb 17, 2009 at 1:15 PM, Tonu Mikk wrote: > >> Looking at the database, I see a photo and thumbnail columns, but there >> is no data. Do I need to write code to store a link to images in the >> photo and thumbnail columns? >> > > Yes, that's it. Read th

Re: seg fault with LDAP authentication

2009-02-17 Thread Jeff Anderson
molhacker wrote: I've been running into a very frustrating situation with a seg fault in Apache when authenticating Django using LDAP. The problem is intermittent, probably one out of every 5 logins causes the seg fault. The code I'm using for LDAP (borrowed from the web, thanks Mick) Have y

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 4:50 PM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > On Tue, Feb 17, 2009 at 5:15 PM, Alex Gaynor wrote: > >> Sure, what you're doing will be similar to the way it works for a foreign >> key, but you're dealing with multiple values, so it'll be something

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread João Olavo Baião de Vasconcelos
On Tue, Feb 17, 2009 at 5:15 PM, Alex Gaynor wrote: > Sure, what you're doing will be similar to the way it works for a foreign > key, but you're dealing with multiple values, so it'll be something like > this: > http://dpaste.com/121833/ > You'll need to test this out to make sure it works, but

Re: seg fault with LDAP authentication

2009-02-17 Thread Graham Dumpleton
Does it happen for mod_wsgi daemon mode as well as embedded mode? If happens for daemon mode, create a single daemon process and then use method described in: http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_Crashes_With_GDB to try and capture a stack trace for where it cr

Re: seg fault with LDAP authentication

2009-02-17 Thread molhacker
Hi Bruno, Not sure what you mean by a "a log for this error" Here's what I see in the Apache error log Tue Feb 17 15:10:03 2009] [notice] child pid 16071 exit signal Segmentation fault (11) I tried using ldap.initialize rather than ldap.open, but I'm getting the same error. Any other ideas on

Re: seg fault with LDAP authentication

2009-02-17 Thread Bruno Tikami
On Tue, Feb 17, 2009 at 5:42 PM, molhacker wrote: > > I've been running into a very frustrating situation with a seg fault > in Apache when authenticating Django using LDAP. The problem is > intermittent, probably one out of every 5 logins causes the seg fault. > > The code I'm using for LDAP (b

seg fault with LDAP authentication

2009-02-17 Thread molhacker
I've been running into a very frustrating situation with a seg fault in Apache when authenticating Django using LDAP. The problem is intermittent, probably one out of every 5 logins causes the seg fault. The code I'm using for LDAP (borrowed from the web, thanks Mick) authentication is shown bel

Re: linking to files from database

2009-02-17 Thread Jacob Kaplan-Moss
On Tue, Feb 17, 2009 at 1:15 PM, Tonu Mikk wrote: > Looking at the database, I see a photo and thumbnail columns, but there > is no data. Do I need to write code to store a link to images in the > photo and thumbnail columns? Yes, that's it. Read the section of the file reference titled "Additi

Re: Customizing Admin for Large Data Sets

2009-02-17 Thread Jacob Kaplan-Moss
On Tue, Feb 17, 2009 at 12:15 PM, mermer wrote: > Does anybody have any advise on how best to customize the Admin to > cope with large data sets. > > We need to deal with 500K plus records - and the loading times are > just too slow. You might want to clarify a bit more what you're doing -- what

Re: Making model methods available to templates

2009-02-17 Thread wotaskd
Awesome, it worked. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to djang

Re: Making model methods available to templates

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 2:32 PM, Tim wrote: > > That's exactly how you would do it: {{ item.cost }} > No extra code is required in your model. > > This of course requires that you have an item instance in your view > and pass it to the template. > > For example... > > def view_example(request): >

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 1:54 PM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > On Tue, Feb 17, 2009 at 11:47 AM, Alex Gaynor wrote: > >> I think value is a list in that case, of the primary keys, but the best >> way to find out is through expirementation, have that method return

Re: uploading files

2009-02-17 Thread Karen Tracey
On Tue, Feb 17, 2009 at 11:50 AM, Tonu Mikk wrote: > Alex Gaynor wrote: > > Uploaded files have a name attribute that contains their name. > Yes, but how does one take advantage of that in this code? > You simply use the name attribute of the UploadedFile instance you are working with. For exam

Re: Making model methods available to templates

2009-02-17 Thread Tim
That's exactly how you would do it: {{ item.cost }} No extra code is required in your model. This of course requires that you have an item instance in your view and pass it to the template. For example... def view_example(request): item = Item.objects.get(pk=1) render_to_response('templ

linking to files from database

2009-02-17 Thread Tonu Mikk
Hi, I have a model like this: class Bookmark(models.Model): title = models.CharField(max_length=200) user = models.ForeignKey(User) link = models.ForeignKey(Link) desc = models.CharField(max_length=500) photo = models.ImageField(upload_to="photos/") thumbnail = models.ImageField(uploa

Re: Access extra parameters in forms.py

2009-02-17 Thread Kevin Audleman
You should probably change the order of operations in the __init__function to call the super classes __init__ function first. Kevin On Feb 16, 8:49 am, peterandall wrote: > Hi all, > > I'm trying to access a list of users in forms.py I'm creating two > lists and merging them in my view (new_bug

Re: Can I overwrite the ModelAdmin for User

2009-02-17 Thread Kevin Audleman
Hey, that's great! I did indeed discover that the change password page didn't work but didn't know what to do about it. Thanks for your excellent and thorough help =) Kevin On Feb 16, 6:30 pm, Karen Tracey wrote: > On Mon, Feb 16, 2009 at 8:19 PM, Kevin Audleman > wrote: > > > > > Alex, > > >

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread João Olavo Baião de Vasconcelos
On Tue, Feb 17, 2009 at 11:47 AM, Alex Gaynor wrote: > I think value is a list in that case, of the primary keys, but the best way > to find out is through expirementation, have that method return nothing but > a string representation of value and look at that page, or use some other > form of lo

Re: Django and php can they mix?

2009-02-17 Thread felix
if you don't have extensive pre-existing php (legacy) code I would say do it all in django. even if you wrote some already in php you will save more time by throwing it away and reimplementing in django then you will trying to make them co-exist or by trying to use a legacy db schema. if you have

Making model methods available to templates

2009-02-17 Thread wotaskd
Howdy, I have a model where one of the fields shouldn't be persistent. Instead, I'd like to add a method that always returns a calculation in the form of an integer value. Ex: http://dpaste.com/hold/121785/ The question is... can I make the method - in the example, cost() - available to a web t

Re: HttpResponse post

2009-02-17 Thread Antoni Aloy
2009/2/17 Miguel : > thanks karen, that is what I meant. > So there is no way to return in my views.py an external web html with post > parameters ... it must be a way to do that, dont think so? > Yes, but you can't do it this way. Just check for httplib and httplib2. http://code.activestate.com

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread João Olavo Baião de Vasconcelos
On Tue, Feb 17, 2009 at 11:47 AM, Alex Gaynor wrote: > I think value is a list in that case, of the primary keys, but the best way > to find out is through expirementation, have that method return nothing but > a string representation of value and look at that page, or use some other > form of lo

Customizing Admin for Large Data Sets

2009-02-17 Thread mermer
Does anybody have any advise on how best to customize the Admin to cope with large data sets. We need to deal with 500K plus records - and the loading times are just too slow. Is it possible to show a limited number of recently added records ffor a model, but then use the search facility in athe

Re: You don't have permission to edit anything - new forms admin

2009-02-17 Thread Tipan
> >     # Admin: > >     ('^hiveadmin/(.*)', admin.site.root), > > That's no longer the right way to hook the admin into your URL conf. > See here: > > http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-admi... > > -RD Hi Rajesh, I've been through the documentation you suggested a

Re: HttpResponse post

2009-02-17 Thread Miguel
thanks karen, that is what I meant. So there is no way to return in my views.py an external web html with post parameters ... it must be a way to do that, dont think so? Karen, if I try your example return HttpResponseRedirect("?".join((" https://sis.sermepa.es/sis/realizarPago",params))), the web

parsing questions

2009-02-17 Thread arbi
Hi everyone, I am using geopy for... 1 day and I have some questions : - Is it outdated? - I want to use the def "parse_xml(self, page, exactly_one=true)" But what is "page" in the arguments? Should I replace "page" by my path to media like "/media/xml/doc.xml" in my view? How can I use this

Re: Form wizard back button

2009-02-17 Thread join.toget...@gmail.com
There's a ticket for a formwizard that will rely on sessions rather than POST data (http://code.djangoproject.com/ticket/9200) but it doesn't appear that anyone's working on it at the moment. If you really want to see this happen, your best bet is to read through the ticket and pick up work where

Re: Django Template Hyphenated Keys

2009-02-17 Thread bfrederi
I decided to write a template tag for my purposes. It's kind of specific to a dictionary within a dictionary, but here is what I created: from django import template register = template.Library() def get_term_value(parser, token): try: # split_contents() knows not to split quoted st

Re: collapsible form

2009-02-17 Thread Alan
Hi, I got it working. I found the missing pieces in /sw/lib/python2.5/site-packages/django/views/i18n.py. Cheers, Alan On Tue, Feb 17, 2009 at 15:36, Alan wrote: > Hi There, > I am still working on CollapsedFieldsets.js and with help of Safari for > developer I got this error for the javascript:

Re: You don't have permission to edit anything - new forms admin

2009-02-17 Thread Rajesh Dhawan
> >     # Admin: >     ('^hiveadmin/(.*)', admin.site.root), That's no longer the right way to hook the admin into your URL conf. See here: http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf -RD --~--~-~--~~~---~

Re: uploading files

2009-02-17 Thread Tonu Mikk
Alex Gaynor wrote: > > > On Tue, Feb 17, 2009 at 11:18 AM, Tonu Mikk > wrote: > > > Hi Django community, > > I have a question regarding uploading files. In this page in Django > documentation > > http://docs.djangoproject.com/en/dev/topics/http/file-upload

Re: uploading files

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 11:18 AM, Tonu Mikk wrote: > > Hi Django community, > > I have a question regarding uploading files. In this page in Django > documentation > > http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#topics-http-file-uploads > , > there is an example of handling an

uploading files

2009-02-17 Thread Tonu Mikk
Hi Django community, I have a question regarding uploading files. In this page in Django documentation http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#topics-http-file-uploads, there is an example of handling an uploaded file like so: def handle_uploaded_file(f): destinat

Re: bookmarks app with images

2009-02-17 Thread Tonu Mikk
Thanks Louis, It has taken me a while to get my head wrapped around this. Your suggestions helped and I am now moving along. Tonu Louis Sayers wrote: > Firstly, make sure that you have the enctype="multipart/form-data" > attribute on your form in your template. > > You can create an object o

Re: Django and php can they mix?

2009-02-17 Thread vevmesteren
check out www.codeigniter.com, excellent PHP framework V On Feb 17, 10:14 am, garagefan wrote: > The easiest solution i can consider is having php request a url from > the django project that would return a dynamically created xml file > that you could then parse via php, set variables from, dis

Re: Date and Times

2009-02-17 Thread ReneMarxis
What i basicly need: Have one imput format and the same output format for modeled and nonmodeld forms and all other functionalities should be present as default (e.g. is.valid()) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: collapsible form

2009-02-17 Thread Alan
Hi There, I am still working on CollapsedFieldsets.js and with help of Safari for developer I got this error for the javascript: Can't find variable: gettext file:///Users/alan/Desktop/CollapsedFieldsets.js (line 34) Line 34: collapse_link.innerHTML = gettext('Show'); I don't know javascript eno

Date and Times

2009-02-17 Thread ReneMarxis
Very sorry to bug you againe, but this is getting very critical Please can someone tell me how to format output of one DateField in a way that form.is_valid() is not breaking? I allready posted this question some time before under http://groups.google.com/group/django-users/browse_thread/th

Re: reuse FilteredSelectMultiple

2009-02-17 Thread natxooy
Thanks!! that works!! On 17 feb, 15:31, Alex Gaynor wrote: > On Tue, Feb 17, 2009 at 7:27 AM, wrote: > > > I'm trying to reuse FilteredSelectMultiple from admin.widgets in my > > forms (two select-widgets to choose from one to other like 'user > > permisions' in admin interface), but didn't fin

Re: reuse FilteredSelectMultiple

2009-02-17 Thread natxooy
Thaks!! that works!! On 17 feb, 15:31, Alex Gaynor wrote: > On Tue, Feb 17, 2009 at 7:27 AM, wrote: > > > I'm trying to reuse FilteredSelectMultiple from admin.widgets in my > > forms (two select-widgets to choose from one to other like 'user > > permisions' in admin interface), but didn't find

Re: HttpResponse post

2009-02-17 Thread Karen Tracey
On Tue, Feb 17, 2009 at 3:04 AM, Miguel wrote: > [snip] > params = urllib.urlencode({"Ds_Merchant_Titular": > Ds_Merchant_Titular, "Ds_Merchant_MerchantCode": Ds_Merchant_MerchantCode}) > #f= urllib2.urlopen("https://sis.sermepa.es/sis/realizarPago > ",params) > >return f ->

Re: Django Template Hyphenated Keys

2009-02-17 Thread Daniel Roseman
On Feb 17, 2:01 pm, "euan.godd...@googlemail.com" wrote: > Why can't you change the dictionary? Can't you just create a copy of > the dict and rename the keys in your copy using _ rather than -  like > so: > > >>> bad = {'var-1':'Apples', 'var-2':'Pears'} > >>> good = dict() > >>> for k,v in bad.

Re: Django and php can they mix?

2009-02-17 Thread garagefan
The easiest solution i can consider is having php request a url from the django project that would return a dynamically created xml file that you could then parse via php, set variables from, display, etc. You could theoretically run the site in django, and the admin and all that goodness, but co

Re: Equivalent of find_or_create_by in Django

2009-02-17 Thread Anders
Great! Thanks. I should have known that Django of course had a function like this. Who needs Rails... A On 17 Feb, 15:11, Tim wrote: > Actually, your User example is probably more like this: > > User.objects.get_or_create(name="Bob", age=40, defaults= > {'admin'=True}) > > This tries to find a

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 9:44 AM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > Hello all, > > when I save an object that has a ForeignKey raw_id_field, it shows the > label (Unicode representation) of the related object next to the field, > instead of just the field with object's

Re: Mutli-Assignable Models

2009-02-17 Thread Peter Herndon
On Mon, Feb 16, 2009 at 1:20 PM, Justin Lilly wrote: > > Hi Peter, > > While your proposed solution would work for the prototyping example > I've given, I have 3 more arching themes like Show and probably > another 4-5 content types like photo and articles. The main idea here > is to be able to

Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread João Olavo Baião de Vasconcelos
Hello all, when I save an object that has a ForeignKey raw_id_field, it shows the label (Unicode representation) of the related object next to the field, instead of just the field with object's PK. I'd like to do the same thing with a ManyToMany raw_id_field (for now, just the objects' PK appear)

Re: reuse FilteredSelectMultiple

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 7:27 AM, wrote: > > I'm trying to reuse FilteredSelectMultiple from admin.widgets in my > forms (two select-widgets to choose from one to other like 'user > permisions' in admin interface), but didn't find how. The closest I've > done was with this code: > > class PersonaF

Re: Multiple Databases Revisited (Interim)

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 6:26 AM, proteus...@gmail.com wrote: > >I've been following the discussion about supporting multiple > databases within one project (primarily on a per-app or per-model > basis) with interest and look forward to the feature getting > solidified and implemented into the

Re: Equivalent of find_or_create_by in Django

2009-02-17 Thread Tim
Actually, your User example is probably more like this: User.objects.get_or_create(name="Bob", age=40, defaults= {'admin'=True}) This tries to find a user by name and age, then uses a default value for the admin field, but does not look up or create the user by the admin field. On Feb 17, 9:08

Re: Equivalent of find_or_create_by in Django

2009-02-17 Thread Tim
It's just as easy in Django. Tag.objects.get_or_create(name="Summer") User.objects.get_or_create(name="Bob", age=40, admin=True) On Feb 17, 8:33 am, Anders wrote: > Hi. > > I do a lot of csv-import of data and have previously been using Ruby > on Rails. And the only thing I miss about Rails (

Re: Django Template Hyphenated Keys

2009-02-17 Thread euan.godd...@googlemail.com
Why can't you change the dictionary? Can't you just create a copy of the dict and rename the keys in your copy using _ rather than - like so: >>> bad = {'var-1':'Apples', 'var-2':'Pears'} >>> good = dict() >>> for k,v in bad.items(): >>>good[k.replace('-','_')] = v >>> good {'var_1': 'Apples

Re: Equivalent of find_or_create_by in Django

2009-02-17 Thread Matthias Kestenholz
Hey, On Tue, Feb 17, 2009 at 2:33 PM, Anders wrote: > > Hi. > > I do a lot of csv-import of data and have previously been using Ruby > on Rails. And the only thing I miss about Rails (apart from database > migration) is the find_or_create_by methods. > > Are there any similar methods in Django?

Equivalent of find_or_create_by in Django

2009-02-17 Thread Anders
Hi. I do a lot of csv-import of data and have previously been using Ruby on Rails. And the only thing I miss about Rails (apart from database migration) is the find_or_create_by methods. Are there any similar methods in Django? My use is like this: I import a CSV file, and in one column there

reuse FilteredSelectMultiple

2009-02-17 Thread natxooy
I'm trying to reuse FilteredSelectMultiple from admin.widgets in my forms (two select-widgets to choose from one to other like 'user permisions' in admin interface), but didn't find how. The closest I've done was with this code: class PersonaForm(ModelForm): def __init__(self, *args, **kwargs

You don't have permission to edit anything - new forms admin

2009-02-17 Thread Tipan
I'm having some problems with the New Forms Admin that are giving me the error message " You don't have permission to edit anything." when I log into the Admin. I also lose the admin-media so that the page displays on a plain white background. I'm using the latest django release from the trunk r9

idea on how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2009-02-17 Thread alan
Following up on this discussion: http://groups.google.com/group/django-users/browse_thread/thread/83f7b9b93973671f/e4b40ec5a482d155?hl=fr&lnk=gst&q=jsi18n+cache#e4b40ec5a482d155 How about a solution where the js i18n file would contain all the translations for all the languages (in a dictionary i

Multiple Databases Revisited (Interim)

2009-02-17 Thread proteus...@gmail.com
I've been following the discussion about supporting multiple databases within one project (primarily on a per-app or per-model basis) with interest and look forward to the feature getting solidified and implemented into the trunk one day. That doesn't appear to be a near term event, however, s

Re: collapsible form

2009-02-17 Thread Alan
So, I tried a lot and narrowed as much as I could from the django admin pages and got almost all from CollapsedFieldsets.js except one thing: - If CollapsedFieldsets.js is generating " (Show)" then it's not showing in my browser, i.e., I don't the (Hide) or (Show) link. I know the javascript is wo

Re: mod_wsgi+apache2.2+django1+WindowsXP: can't serve images

2009-02-17 Thread Graham Dumpleton
On Feb 17, 5:20 am, Angel Cruz wrote: > Thank you Graham!  All of my reference materials, including the Django book > I am currently reading (mod_wsgi was toward the end of the book and I should > have looked there first :>) ), has the "Alias" directive.  Why I typed Match > in there, I am now

Re: Differen unicode behaviour between mac os x and linux

2009-02-17 Thread Graham Dumpleton
On Feb 17, 3:01 pm, Malcolm Tredinnick wrote: > > I think I should have clarified some more facts about my setup. > > 1- On mac, django is running on dev mode, so stdout is the console. On > > linux, it'smod_wsgi, so stdout is redirected to apache error log > > files, on which I'm issuing a "tail

Re: how to write templatetags

2009-02-17 Thread fuceck
thanks,I do,i just forget restart the web server, - Original Message - From: "Daniel Roseman" To: "Django users" Sent: Tuesday, February 17, 2009 5:37 PM Subject: Re: how to write templatetags On Feb 17, 9:16 am, "fuceck" wrote: > hello,everybody, > i have a problem with templatetags

Re: how to write templatetags

2009-02-17 Thread fuceck
i did not reboot the server ,i have solve the problem.thanks. - Original Message - From: fuceck Cc: django-users@googlegroups.com Sent: Tuesday, February 17, 2009 5:16 PM Subject: how to write templatetags hello,everybody, i have a problem with templatetags,I difine a tem

Re: Settings for an application - define as a model?

2009-02-17 Thread Rob
OK, thanks a lot for that. I have only just started using Django and, for that matter, Python. It's really valuable to gain a bit of insight into how the more experienced might tackle the issues I am facing. Thanks again for the suggestions, Rob On Feb 16, 11:47 pm, Alex Gaynor wrote: > On Mon

Re: how to write templatetags

2009-02-17 Thread Daniel Roseman
On Feb 17, 9:16 am, "fuceck" wrote: > hello,everybody, > i have a problem with templatetags,I difine a template change_gender.py in my > address app, > but i meet with with problem: > >  Could not load template library from django.templatetags.change_gender, No > module named change_gender > >

Re: how to use post_save signals

2009-02-17 Thread guptha
hi, thanks a lot for your clarification i have tried it in models.py ,overriding parent save method and everything works fine On Feb 17, 11:56 am, Malcolm Tredinnick wrote: > On Mon, 2009-02-16 at 22:38 -0800, gganesh wrote: > > hi, > > i wrote > > def after_save(sender,instance,created,**kaw

Rename Products image as products slug

2009-02-17 Thread Mirat Can Bayrak
I have a model called product, it has slug and image fields. When it saved i want to rename image file as slugfield. for example if i save a product that called "Sony Laptop", i want to store its image as sony-laptop.jpg. How can i do it? i am stuck for hours. -- Mirat Can Bayrak --~--~

Re: how to make a field uneditable in admin site

2009-02-17 Thread bruno desthuilliers
On 17 fév, 08:22, guptha wrote: > hi , > i need to know how to create a non editable field in admin site .I > tried , one like  below > > acct_number=models.CharField(max_lenght=100,editable=False) > > but it doesn't work According to both the documentation and my own experience, it should. At

Re: HttpResponse post

2009-02-17 Thread Miguel
The problem is that I need to redirect the request to an url and post to this url the parameters I got from the initial request and display the post url. Here is my views.py: def prueba(request, seccion): if request.POST: new_data = request.POST.copy() Ds_Merchant_Titular = n