Re: Naive redirection programming question

2009-09-02 Thread Daniel Roseman
On Sep 3, 3:36 am, Rodney Topor wrote: > Suppose you've just processed posted form data and successfully added > a new item to the database.  Now you return HttpResponseRedirect('/ > items/') (I know, you should use a pattern name not an absolute URL > here) to display the list of items, includin

nocache on template?

2009-09-02 Thread Chichon
There is anyway to avoid some templates parts to not be cached? Something like: {% nocache %} Hello, {{username}} {% endnocache %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: How to define variables used in every page?

2009-09-02 Thread Andy McKay
Look up template context processors. -- Andy McKay www.clearwind.ca On 2009-09-02, at 7:03 PM, "richardcur...@googlemail.com" wrote: > > Hi, > > I want to use two 'global' variables in all pages. Obviously I don't > want to put the same variable in all template dictionaries. > > Is ther

Naive redirection programming question

2009-09-02 Thread Rodney Topor
Suppose you've just processed posted form data and successfully added a new item to the database. Now you return HttpResponseRedirect('/ items/') (I know, you should use a pattern name not an absolute URL here) to display the list of items, including the newly added item. But, suppose you want t

Re: How to define variables used in every page?

2009-09-02 Thread Mike Ramirez
On Wednesday 02 September 2009 07:03:04 pm richardcur...@googlemail.com wrote: > Hi, > > I want to use two 'global' variables in all pages. Obviously I don't > want to put the same variable in all template dictionaries. > > Is there a simpler way to have something like 'global' variables in > Djang

How to define variables used in every page?

2009-09-02 Thread richardcur...@googlemail.com
Hi, I want to use two 'global' variables in all pages. Obviously I don't want to put the same variable in all template dictionaries. Is there a simpler way to have something like 'global' variables in Django? Thanks. --~--~-~--~~~---~--~~ You received this messag

Re: Strange problem with QuerySet

2009-09-02 Thread Karen Tracey
On Wed, Sep 2, 2009 at 10:14 AM, Spoksss wrote: > > Hi, > > I have very strange problem with simple QuerySet. > I get error just on one of servers, and I realy don't know why. > > When I use very simple code like: > > Model.objects.filter(is_published=True) > > I get stupid error: > > "Cannot reso

Re: Having real problems with CSS

2009-09-02 Thread Karen Tracey
On Wed, Sep 2, 2009 at 7:53 AM, Ozymandias wrote: > > Karen, > > Thank you. I will give that a shot a little later this afternoon. > > The MEDIA_ROOT change really does break the sites CSS though. Not > sure why. > > Was I doing the changes correctly if I were going to be hosting this > on an a

Re: No Module named ... problem

2009-09-02 Thread Russell Keith-Magee
On Wed, Sep 2, 2009 at 11:38 PM, phoebebright wrote: > > And it's not a missing __init__.py program that I can see. > > Am trying to move a site to a new server - CentOS to Ubuntu and > version of python are changing from 2.4.3 to 2.5.2 and using wsgi now > instead of mod_python. > > I already hav

ReST and path issues

2009-09-02 Thread TiNo
Hi, I am trying to set up a sort of smal CMS where the input is RestructuredText. The restructured text is parsed by a templatetag with the following code (taken from the PyCon rst project): @register.filter def restructuredparts(value, **overrides): """return the restructured text parts"""

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
Joakim Hove wrote: > > > Hello, > > thanks for the tip: > >> It is usually not a good idea to give business meaning to a primary key >> in a relational database. The literature is full of reasons against it. > > I had a nagging feeling this might be the case. Do you have any links > to "Best

Re: file list with os.walk non unicode chars like spanish ~n

2009-09-02 Thread Juan
Hi I have the same problem. Have you found any solution? Thanks and regards. On 15 ago, 17:18, fruity wrote: > Hi everyone, > > This is not my code, but the code of washtub the liquidsoap controller > made with django so for I've mailed both ML, django and liquidsoap > > I have a directory ful

Looking for a Start-Up Co-Founder

2009-09-02 Thread Scott Fortmann-Roe
I'm looking for a passionate co-founder to help me build a novel and meaningful start-up using Django. In a nutshell, Insightica (working name) is about making scientific modeling accessible and fun. This might sound impossible, but I have the proven technology and the great new concept to make it

manytomany manager and get_query_set

2009-09-02 Thread bnl
hi Folks I have a model which has in it some stuff that looks like: class Simulation(models.Model): ... boundaryCondition=models.ManyToManyField ('SimCoupling',blank=True,null=True) ... class Coupling(models.Model): ... class SimCoupling(models.Model): ... original=model

create author before adding a book - edit form

2009-09-02 Thread Rochak Neupane
Taking the Book and Author example from http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ When creating a book, I would like to add an author if no such author exists. I believe by default class BookForm(ModelForm): class Meta: model = Book displays "Author" as a drop

Re: xgettext under osx

2009-09-02 Thread Ramiro Morales
On Wed, Sep 2, 2009 at 12:32 PM, arbi wrote: > > As for the PATH I thought it was for compilation and not for make > message. > Should I write this for make message ? > > PATH=$PATH:/Applications/Poedit.app/Contents/MacOS/ > python /Library/python/2.5/site-packages/django/bin/make-messages.py > ?

Re: phppgadmin not work if I have a project runing directly like: localhost/

2009-09-02 Thread Mike Ramirez
On Wednesday 02 September 2009 01:53:40 am NMarcu wrote: > Hello all, > >I have a project that is need to be run like: "http://localhost/";. > In this case, I can't access phppgadmin like: "localhost/phpmyadmin" > because is looking in my project files. I configure the Apache 2, > httpd.conf li

Re: Parsing / Deserializing a JSON String

2009-09-02 Thread Andrew McGregor
On Wed, Sep 2, 2009 at 6:47 PM, Eric wrote: > > Im using the Django deserialization method shown here: > > http://docs.djangoproject.com/en/dev/topics/serialization/ > ok, try pasting your json (the original, not your re-typed version) here: http://www.jsonlint.com/ -- Andrew McGregor 07940 22

Re: Is valid {% ifequal model.name "Mymodelname" %}??

2009-09-02 Thread Andrew McGregor
On Wed, Sep 2, 2009 at 4:44 PM, Sandra Django wrote: > Hi friends, Can I do a condition depending on my model name? For example, I > did that: > {% ifequal model.name "Mymodelname" %} > do something > {% endifequal %} > > But don't work. Someone could help me? As part of your select could yo

Re: Parsing / Deserializing a JSON String

2009-09-02 Thread Andrew McGregor
> I would like to parse it so that I can loop over the pairs/arrays to > access the data. When I try to deserialize the data, I get the django > error "string indices must be integers". Can anybody please help me > determine what exactly this means and how I may fix this?  Is there > another metho

Re: Parsing / Deserializing a JSON String

2009-09-02 Thread Javier Guerra
On Wed, Sep 2, 2009 at 12:37 PM, Eric wrote: >When I try to deserialize the data, I get the django > error "string indices must be integers" it's not on your example, but i guess you're missing a colon between a fieldname and an array, something like this: {"gantts"[{"rows". instead of

Re: Parsing / Deserializing a JSON String

2009-09-02 Thread Eric
Im using the Django deserialization method shown here: http://docs.djangoproject.com/en/dev/topics/serialization/ It goes something like: " ... gantt_data = request.POST.get('ganttdata') for obj in serializers.deserialize("json", gantt_data): ... " On Sep 2, 10:41 am, Andrew McGregor w

Getting logged in user in signal

2009-09-02 Thread Yanik
I want to write a signal that tracks activities on certain models, but I'd also like to keep track of who did what. Is there any way, from the signal action, to get the value of request.user? --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Parsing / Deserializing a JSON String

2009-09-02 Thread Eric
I forgot to mention that I am trying to deserialize the data as follows: " ... gantt_data = request.POST.get('ganttdata') for obj in serializers.deserialize("json", gantt_data): ... " On Sep 2, 10:37 am, Eric wrote: > Hi, > I am attempting to parse a json string passed to my view via a fo

Parsing / Deserializing a JSON String

2009-09-02 Thread Eric
Hi, I am attempting to parse a json string passed to my view via a form post. A simple example of my json structure is as follows (indented for readability): { "ganttgroups":[ { "gantts":[ { "rows":[ {"stt":1, "

Re: formfield_for_foreignkey

2009-09-02 Thread Václav Řehák
I'm not sure I understand your question. The formfield_for_foreignkey method takes the field_name as an argument so you can have different (or same) action for any of them, see http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey What ex

Looking for a Django developer

2009-09-02 Thread Adam Endicott
Storybird is adding a Python/Django developer to the team. We're a small group working on a fun, Django-backed site that's just at the initial launch stage. We have more ideas than developer time, so we're looking to expand the team. Details and contact info are at: http://blog.storybird.com/200

Re: django-tinymce problem on server

2009-09-02 Thread Sonal Breed
Hi Joost, I installed aspell and en library on web server and now spellcheker is running fine. Thanks a ton for your help and it is a great application. Thanks, Sincerely, Sonal. On Sep 1, 3:37 pm, Sonal Breed wrote: > Hello Joost, > > I came acrosshttp://code.google.com/p/django-tinymce/issu

Is valid {% ifequal model.name "Mymodelname" %}??

2009-09-02 Thread Sandra Django
Hi friends, Can I do a condition depending on my model name? For example, I did that: {% ifequal model.name "Mymodelname" %} do something {% endifequal %} But don't work. Someone could help me? --~--~-~--~~~---~--~~ You received this message because you are su

Re: xgettext under osx

2009-09-02 Thread arbi
As for the PATH I thought it was for compilation and not for make message. Should I write this for make message ? PATH=$PATH:/Applications/Poedit.app/Contents/MacOS/ python /Library/python/2.5/site-packages/django/bin/make-messages.py ? And then I do django-admin.py makemessages -l fr ? thx (I am

No Module named ... problem

2009-09-02 Thread phoebebright
And it's not a missing __init__.py program that I can see. Am trying to move a site to a new server - CentOS to Ubuntu and version of python are changing from 2.4.3 to 2.5.2 and using wsgi now instead of mod_python. I already have one django site running on the new server so the basic setup is o

Re: Is valid {% ifequal model.name "Mymodelname" %}??

2009-09-02 Thread JF Simon
Be more specific, is model in the context ? is name a property of model ? On 2 sep, 17:44, Sandra Django wrote: > Hi friends, Can I do a condition depending on my model name? For example, I > did that: > {% ifequal model.name "Mymodelname" %} >      do something > {% endifequal %} > > But don't

remove fields from django.contrib.comments

2009-09-02 Thread andreas schmid
hi list, im trying to customise the django comment form and i have no problems subclassing the Comment model and add my custom fields but i would need to remove the name, url and email fields because i will let only logged in users add and see comments in my project and the app fills the fields i

Re: download file

2009-09-02 Thread Andrew McGregor
> Hello can you tell me where i can find example how to download file > with django CURL? http://pycurl.sourceforge.net/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

cookie handling session management

2009-09-02 Thread Sven Richter
Hi everybody, i've been tinkering around with cookies scinc some days. They work so far for me, but i fear the way that i use them right now is not the django way and it isn't a DRY way. This is how i do it right now, i have some views and everytime the view is called it checks if there is a certa

Re: xgettext under osx

2009-09-02 Thread Ramiro Morales
On Wed, Sep 2, 2009 at 11:58 AM, arbi wrote: > > I have a pb when doing this (i am under osx) : > > $ django-admin.py makemessages -l fr > processing language fr > Error: errors happened while running xgettext on __init__.py > /bin/sh: xgettext: command not found > > I went there :http://www.pkshi

Re: Consuming python 2.6 /django 1.1/SOAPLIB 0.8.1 webservice with .NET ?

2009-09-02 Thread Wombatpm
I hacked my soaplib_handler.py in django to test what was missing. The following envelope works: http://www.w3.org/2001/XMLSchema- instance" xmlns:SOAP-ENV="http:// schemas.xmlsoap.org/soap/envelope/" xmlns="http:// www.donnelley

xgettext under osx

2009-09-02 Thread arbi
I have a pb when doing this (i am under osx) : $ django-admin.py makemessages -l fr processing language fr Error: errors happened while running xgettext on __init__.py /bin/sh: xgettext: command not found I went there :http://www.pkshiu.com/loft/archive/2008/01/gettext-on- leopard-for-django-int

Strange problem with QuerySet

2009-09-02 Thread Spoksss
Hi, I have very strange problem with simple QuerySet. I get error just on one of servers, and I realy don't know why. When I use very simple code like: Model.objects.filter(is_published=True) I get stupid error: "Cannot resolve keyword 'is_published' into field. Choices are: id, is_published,

download file

2009-09-02 Thread luca72
Hello can you tell me where i can find example how to download file with django Regards Luca --~--~-~--~~~---~--~~ 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@go

Re: Having real problems with CSS

2009-09-02 Thread Ozymandias
Karen, Thank you. I will give that a shot a little later this afternoon. The MEDIA_ROOT change really does break the sites CSS though. Not sure why. Was I doing the changes correctly if I were going to be hosting this on an actual server? I'd need to change the MEDIA_ROOT in order to get tha

Re: phppgadmin not work if I have a project runing directly like: localhost/

2009-09-02 Thread Joshua Partogi
This question is not django related. On Sep 2, 6:53 pm, NMarcu wrote: > Hello all, > >    I have a project that is need to be run like: "http://localhost/";. > In this case, I can't access phppgadmin like: "localhost/phpmyadmin" > because is looking in my project files. I configure the Apache 2,

formfield_for_foreignkey

2009-09-02 Thread paulh
I have used formfield_for_foreignkey in the admin and it works well. However, suppose you have two foreign keys in your model and you want to restrict the choices on both of them? Paul Hide --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Custom form validation request or user-based

2009-09-02 Thread Daniel Roseman
On Sep 2, 10:59 am, Matthias Kestenholz wrote: > On Wed, Sep 2, 2009 at 10:38 AM, Enrico > > Sartorello wrote: > >> if you need this only for the administration site you'd hvae other > >> hooks that you could override. Either take a look at the documentation > >> or at django/contrib/admin/option

Re: Custom form validation request or user-based

2009-09-02 Thread Matthias Kestenholz
On Wed, Sep 2, 2009 at 10:38 AM, Enrico Sartorello wrote: >> if you need this only for the administration site you'd hvae other >> hooks that you could override. Either take a look at the documentation >> or at django/contrib/admin/options.py >> > > If you mean overriding the ModelAdmin.form objec

Re: Showng the primary key in admin view

2009-09-02 Thread Joakim Hove
Hello, thanks for the tip: > It is usually not a good idea to give business meaning to a primary key > in a relational database. The literature is full of reasons against it. I had a nagging feeling this might be the case. Do you have any links to "Best practice" om these questions - I am a d

phppgadmin not work if I have a project runing directly like: localhost/

2009-09-02 Thread NMarcu
Hello all, I have a project that is need to be run like: "http://localhost/";. In this case, I can't access phppgadmin like: "localhost/phpmyadmin" because is looking in my project files. I configure the Apache 2, httpd.conf like: SetHandler python-program PythonHandler django.core.h

Re: Access to postgresql with Django, in Apache server not work, but in Django server work(pyton manage.py ruserver)

2009-09-02 Thread Nicu Marcu
I change the Method to trust, and it's word. Thank you for help. 2009/9/1 Karen Tracey > On Tue, Sep 1, 2009 at 10:54 AM, NMarcu wrote: > >> >> Hello all, >> >> I'm very new in python, Django... I have a Django project. If I run >> it like: python manage.py runserver, everything is OK. When I

Re: Custom form validation request or user-based

2009-09-02 Thread Enrico Sartorello
On Wed, Sep 2, 2009 at 10:25 AM, Matthias Kestenholz wrote: > > On Wed, Sep 2, 2009 at 9:15 AM, Enrico > Sartorello wrote: > > Up. > > > > Already? > > Yes, cause it seemed to me that a message buried by other 30 messages was about to be left unanswered :-) > > > > > On Tue, Sep 1, 2009 at 11:

Re: Showng the primary key in admin view

2009-09-02 Thread Joakim Hove
> and if you look up-screen at the "breadcrumbs" you should see ... > > Home >> Customers >> 2: George > > Does that do it? Well - I know (and thanks for the info) - but I would really like to get it even clearer. Joakim --~--~-~--~~~---~--~~ You received this me

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
Joakim Hove wrote: > Thank you both for answering; however I am afraid we are > misunderstanding eachother here. > > I have created a admin.py file and registered my CustomerClass with > the admin interface. That works, and I can select the CustomerClass > when logged in to the admin interface. >

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
Joakim Hove wrote: > Thank you both for answering; however I am afraid we are > misunderstanding eachother here. > > I have created a admin.py file and registered my CustomerClass with > the admin interface. That works, and I can select the CustomerClass > when logged in to the admin interface. >

Re: Custom form validation request or user-based

2009-09-02 Thread Matthias Kestenholz
On Wed, Sep 2, 2009 at 9:15 AM, Enrico Sartorello wrote: > Up. > Already? > On Tue, Sep 1, 2009 at 11:06 AM, Enrico Sartorello > wrote: >> >> Wait a moment: this solution doesn't solve my problem. >> Remember that the form I need has to be used on the admin site, so I can't >> deal with it dir

Re: how to make admin app use templates from app templates folder?

2009-09-02 Thread Aljosa Mohorovic
On Sep 1, 7:03 pm, Bill Freeman wrote: > Add the filesystem template loader, put it before app directories loader, > and put the (absolute) path to your templates directory (e.g.; > /home/moho/myapp/templates) in TEMPLATES_DIR. thanks, this actually works for me. Aljosa --~--~-~--~~

Re: Showng the primary key in admin view

2009-09-02 Thread Joakim Hove
Thank you both for answering; however I am afraid we are misunderstanding eachother here. I have created a admin.py file and registered my CustomerClass with the admin interface. That works, and I can select the CustomerClass when logged in to the admin interface. Let us say I have created three

Re: Call a custom python function during each model save

2009-09-02 Thread Andy Mikhailenko
Try signals[1], namely pre_save[2]. I would stick to this way instead of overriding model's save() method. [1] http://docs.djangoproject.com/en/dev/topics/signals/ [2] http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save On Sep 1, 4:21 pm, Harish wrote: > Hi Frie

Re: How to call random pictures thumbs in sidebar from pictures section?

2009-09-02 Thread Daniel Hilton
2009/9/2 Bins : > > On my django run website, I've this sidebar which calls 5 random > pictures from entries.. here's the code that does it :- > >                  {% for entry in thumb_entries %} >                   '110' src='{{entry.img}}' style='border:none;' / > >                   >      

Re: Custom form validation request or user-based

2009-09-02 Thread Enrico Sartorello
Up. On Tue, Sep 1, 2009 at 11:06 AM, Enrico Sartorello < enrico.sartore...@gmail.com> wrote: > Wait a moment: this solution doesn't solve my problem. > Remember that the form I need has to be used on the admin site, so I can't > deal with it directly (in fact, I can't instantiate it and provide >