Re: override save()

2009-08-09 Thread Léon Dignòn
That kind of surprises me. I thought that the whole code will be parsed before actually doing something. Like C# :) But save() is not overridden! If I comment out super() it still saves the form. - class ProfileFormExtended(UserProfile): def save(self, force_insert=False,

how django admin display fetch data

2009-08-09 Thread Hellnar
Hello I am trying to understand how django admin panel fetch and list the data instaces of models. I need this because I will be implementing a javascript graph to the listing view of a model (at the listing view of these datas) Cheers --~--~-~--~~~---~--~~ You

Re: overriding save()

2009-08-09 Thread Karen Tracey
On Sun, Aug 9, 2009 at 10:23 PM, neridaj wrote: > > It was suggested to me in an earlier post, to override save, and > though I've read the documentation for upload_to before I guess I > don't quite know how to implement it without an example. Due to my > lack of experience I

Re: select_related(field) doesn't use the default manager of the field

2009-08-09 Thread Gleber
Thanks for the reply, This is much more complex than I thought.. I will stay with the way of two queries, better than one query per object.. Gleber --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Using email instead of username in extended "User" model?

2009-08-09 Thread Saikat Chakrabarti
Just some more info on this - I use http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html for logging in using emails. There is some discussion of this topic on http://groups.google.com/group/django-users/browse_thread/thread/c943ede66e6807c/2fbf2afeade397eb?pli=1

Re: weirdist situation I have faced in 4 years of (ab)using django

2009-08-09 Thread Kenneth Gonsalves
On Sunday 09 Aug 2009 1:03:44 pm Kenneth Gonsalves wrote: > addevent works fine and so does listing of events - and so does Meeting and > Report. I have done this so many times in the last 4 years that I can do it > in my sleep. But this time eventfull does not work. It does not throw > errors.

Re: select_related(field) doesn't use the default manager of the field

2009-08-09 Thread Malcolm Tredinnick
On Sat, 2009-08-08 at 22:00 -0700, Gleber wrote: [...] > When I override the get_query_set() adding extra fields, these fields > aren't available if I execute: > ModelB.objects.all().select_related('ref') This is true. > This is a bug? Not necessarily. It's intentional behaviour at the moment

Re: override save()

2009-08-09 Thread Malcolm Tredinnick
On Sun, 2009-08-09 at 13:35 -0700, Léon Dignòn wrote: > Hi, > > I have a ModelForm of my UserProfile model with two additional fields. > I need to override save(), to save the additional fields to the > django.contrib.auth.model.User model. > I tried to do that with a subclass of my UserProfile

Re: overriding save()

2009-08-09 Thread Karen Tracey
On Sun, Aug 9, 2009 at 8:16 PM, neri...@gmail.com wrote: > > Hello, > > I'm having trouble overriding save() to change the upload_to attribute > of a FileField object. I would like the upload_to attribute to change > depending on which user is selected from the select menu

overriding save()

2009-08-09 Thread neri...@gmail.com
Hello, I'm having trouble overriding save() to change the upload_to attribute of a FileField object. I would like the upload_to attribute to change depending on which user is selected from the select menu i.e., if user testuser24 is selected the upload_to would change to

django newbie, having problems with my first app. maybe in the urls.py?

2009-08-09 Thread ezulo...@gmail.com
So i am very new to django and have a little python experience. im using webfraction to host my application and followed their instructions on starting a django webapp. i have the server up and running and im using the 1.0 documentation at djangobook.com, and running django 1.0 for my webapp. I

newbies Deployment docs

2009-08-09 Thread justin jools
I hope this helps anyone starting, cos i learnt this the hard way! --- get your python path working: (scroll down to environment variables) http://www.voidspace.org.uk/python/articles/command_line.shtml#path ---

Re: How do I minimize memory usage with WSGI and Apache?

2009-08-09 Thread Graham Dumpleton
On Aug 10, 6:07 am, Jumpfroggy wrote: > I'm hosting a bunch of django apps on a shared host with 80MB of > application memory (Webfaction in this case).  I've got a bunch of > apps that are very infrequently used, but need to be online.  I've > already changed the

Re: Apache2 permission denied problem

2009-08-09 Thread Malcolm MacKinnon
Graham, thanks for taking the time to repond. I made the changes in my views to use only absolute paths, and made the necessary changes to the file permissions. All seems to work fine now. On Sun, Aug 9, 2009 at 11:19 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > > On Aug 9,

Re: Apache2 permission denied problem

2009-08-09 Thread Graham Dumpleton
On Aug 9, 4:11 pm, Mac wrote: > Hi, > > I'm new to Django, and am trying to write a csv file and attach it to > an email that is sent upon completion of a sales order. All works fine > in the developement server, but when I switch to Apache2 I get an > error message that

Re: user online

2009-08-09 Thread Daniel Roseman
On Aug 9, 10:07 pm, "Rob B (uk)" wrote: > Im using this middleware to try and display a list of online user on > my site.http://dpaste.com/77464/ > > Im just not sure how to pass it to my view and template.  Any ideas? > > Middleware found >

user online

2009-08-09 Thread Rob B (uk)
Im using this middleware to try and display a list of online user on my site. http://dpaste.com/77464/ Im just not sure how to pass it to my view and template. Any ideas? Middleware found @ http://groups.google.com/group/django-users/browse_thread/thread/6f5f759d3fd4318a/ Thanks

Re: 2 Questions about feeds

2009-08-09 Thread Léon Dignòn
Please try to change the Sitename in the backend at /admin/sites/site/ Per default its example.com On Aug 8, 8:46 pm, When ideas fail wrote: > Hi, i'm developing a feed but i still have a couple of questionss. > > 1. I have this in my models: > > def

Re: My ModelAdmin customizations don't work

2009-08-09 Thread Chao Xu
Oh, I am so careless. Thank you very much! On Aug 8, 9:41 pm, Alex Gaynor wrote: > On Sat, Aug 8, 2009 at 8:37 PM,ChaoXu wrote: > > > I want't to add search in admin site and followed the instructions of > > official guide of The Django admin site.

MySQL server has gone away

2009-08-09 Thread akramquraishi
Hi, I'm getting a lot of "MySQL server has gone away" errors on my site. I tried increasing the connection timeout but the site is in a private beta and has very less activity. At times there aren't any requests for hours together. And when there are requests .. these errors comes up multiple

override save()

2009-08-09 Thread Léon Dignòn
Hi, I have a ModelForm of my UserProfile model with two additional fields. I need to override save(), to save the additional fields to the django.contrib.auth.model.User model. I tried to do that with a subclass of my UserProfile model class to have the code separated. But I get a NameError:

Re: Custom manager and delete()

2009-08-09 Thread Adi Andreias
Hello, Anyone can give us a hint with this? I have the same problem: with a custom manager (for a 2nd database) SELETs and INSERTs are working, but not the DELETE operation. Seems like DELETE references a global connection variable (to the main database). Thanks michael wrote: > Hi, > >

How do I minimize memory usage with WSGI and Apache?

2009-08-09 Thread Jumpfroggy
I'm hosting a bunch of django apps on a shared host with 80MB of application memory (Webfaction in this case). I've got a bunch of apps that are very infrequently used, but need to be online. I've already changed the httpd.conf: ServerLimit 1 Instead of the default "ServerLimit 2". With

Re: import problem

2009-08-09 Thread Léon Dignòn
Thank you all! :) On Aug 9, 9:35 pm, "J. Cliff Dyer" wrote: > On Sun, 2009-08-09 at 11:59 -0700, Léon Dignòn wrote: > > In my myproject/urls.py I want to pass the class to a function. > > Because my urls.py is full of imports, I do not want another import > > line for

Re: import problem

2009-08-09 Thread J. Cliff Dyer
On Sun, 2009-08-09 at 11:59 -0700, Léon Dignòn wrote: > In my myproject/urls.py I want to pass the class to a function. > Because my urls.py is full of imports, I do not want another import > line for this class I only use at one line, because it's easier to > read. > > I wonder that I have to

Re: import problem

2009-08-09 Thread Daniel Roseman
On Aug 9, 7:59 pm, Léon Dignòn wrote: > In my myproject/urls.py I want to pass the class to a function. > Because my urls.py is full of imports, I do not want another import > line for this class I only use at one line, because it's easier to > read. > > I wonder that I

Re: import problem

2009-08-09 Thread Léon Dignòn
In my myproject/urls.py I want to pass the class to a function. Because my urls.py is full of imports, I do not want another import line for this class I only use at one line, because it's easier to read. I wonder that I have to import myproject when I reference a model class in an app which

Re: import problem

2009-08-09 Thread Daniel Roseman
On Aug 9, 7:34 pm, Léon Dignòn wrote: > Hello, > > some times I'd like not to import a class but just write it down. > > Instead of > from myproject.myapp.models import MyModel > > I'd like to use > myproject.myapp.models.MyModel > > But I get a NameError: name 'myproject'

import problem

2009-08-09 Thread Léon Dignòn
Hello, some times I'd like not to import a class but just write it down. Instead of from myproject.myapp.models import MyModel I'd like to use myproject.myapp.models.MyModel But I get a NameError: name 'myproject' is not defined Also myapp.models.MyModel raises a NameError: name 'myapp' is

Re: javascript variable in url resolver template tag

2009-08-09 Thread Daniel Roseman
On Aug 9, 4:59 pm, Sven Richter wrote: > I am looking for a rating function AJAX style. > So what i am trying to do is the following: > > Click on a link register a Jquery function to call on that click with: > $('a#vote_pos').click(rate_it); > and then in rate_it call

Re: Using create_object generic view excluding

2009-08-09 Thread Darek
On Aug 9, 7:54 pm, Lacrima wrote: > Hello! > > I want to use django.views.generic.create_update.create_object to > create and save object. > But I need one field to be excluded from the form displayed. > I can do it by setting exclude = ('somefield',) in the Meta class

Re: Using create_object generic view excluding

2009-08-09 Thread Darek
Add to "quiz" field in Question model keyword blank=True (for varchar type or "blank=True, null=True" for foreign key or datetime) On Aug 9, 7:54 pm, Lacrima wrote: > Hello! > > I want to use django.views.generic.create_update.create_object to > create and save object.

Re: Using create_object generic view excluding

2009-08-09 Thread Lacrima
Sorry, I have missed some words in the topic name, but I can't change it now. ( On Aug 9, 8:54 pm, Lacrima wrote: > Hello! > > I want to use django.views.generic.create_update.create_object to > create and save object. > But I need one field to be excluded from the form

Using create_object generic view excluding

2009-08-09 Thread Lacrima
Hello! I want to use django.views.generic.create_update.create_object to create and save object. But I need one field to be excluded from the form displayed. I can do it by setting exclude = ('somefield',) in the Meta class of my ModelForm subclass. If so I can't submit this form without an

Re: how to deploy Django on the web server?

2009-08-09 Thread justin jools
o thanks for that :) as soon as my administrator finally sorts out Python script executing for me - omg! ,I'll try that On Sat, Aug 8, 2009 at 6:43 PM, Larrik Jaerico wrote: > > I'll bet a lot of the mailing list will faint when they see this, but > I've gotten it to work

Re: django-registration and RegistrationFormUniqueEmail subclass

2009-08-09 Thread Léon Dignòn
Thank you On Jul 22, 7:42 pm, Dan Harris wrote: > The stuff in the brackets are the optional arguments passed to the > "register" view. > > You can read the documentation about the view at: > > http://bitbucket.org/ubernostrum/django-registration/src/b360801eae96... > >

Re: How to change the option text in a form's select-tag?

2009-08-09 Thread Léon Dignòn
I solved it with __unicode__ in the model class. On Aug 7, 1:38 pm, Léon Dignòn wrote: > Hello, > > I installed django-profiles and added an extended UserProfile. One > template displays all fields which are necessary to edit a users > profile. Every user can choose a

Generic view 'archive_year' not working

2009-08-09 Thread Matthew
I am using Django's generic views to create a blog site. The templates I created, entry_archive_day, entry_archive_month, entry_archive, and entry_detail all work perfectly, but entry_archive_year does not. Instead, it is simply a blank page. It looks like it sees no objects in 'object_list'.

Re: Bug with model get_*_display() methods?

2009-08-09 Thread Margie
Thanks for the pointers, that all make sense now. Margie On Aug 8, 6:47 pm, Malcolm Tredinnick wrote: > On Sat, 2009-08-08 at 12:09 -0700, Margie wrote: > > [...] > > > Question: If want to use a special widget for a ChoiceField, is it > > true that I need to

Re: Bug with model get_*_display() methods?

2009-08-09 Thread Margie
Right - of course. Don't ask me why didn't realize to use IntegerField ().to_python myself ... Margie On Aug 8, 12:32 pm, Alex Gaynor wrote: > On Sat, Aug 8, 2009 at 2:09 PM, Margie wrote: > > > Ok, still slightly confused.  First - a high

Re: javascript variable in url resolver template tag

2009-08-09 Thread Sven Richter
Ok, i think i understand the problem now. So i have to hardcode the url in my javascript function? That was what i wanted to circumvent. Sven On Sun, Aug 9, 2009 at 5:57 PM, Daniel Roseman wrote: > > On Aug 9, 4:43 pm, Sven Richter wrote: > > Hi

Re: javascript variable in url resolver template tag

2009-08-09 Thread Sven Richter
I am looking for a rating function AJAX style. So what i am trying to do is the following: Click on a link wrote: > > On Sun, Aug 9, 2009 at 5:43 PM, Sven Richter > wrote: > > Hi all, > > > > i wanted to know if it is possible to pass a Javascript variable to > > the url

Re: javascript variable in url resolver template tag

2009-08-09 Thread Daniel Roseman
On Aug 9, 4:43 pm, Sven Richter wrote: > Hi all, > > i wanted to know if it is possible to pass a Javascript variable to > the url template tag? > > Like: > > ... >

Re: javascript variable in url resolver template tag

2009-08-09 Thread Matthias Kestenholz
On Sun, Aug 9, 2009 at 5:43 PM, Sven Richter wrote: > Hi all, > > i wanted to know if it is possible to pass a Javascript variable to > the url template tag? > > Like: > > ... >

javascript variable in url resolver template tag

2009-08-09 Thread Sven Richter
Hi all, i wanted to know if it is possible to pass a Javascript variable to the url template tag? Like: ...

Re: Model Methods and displaying in template?

2009-08-09 Thread rmschne
Daniel, Now we're cooking. You were quite right. A red herring that I had the wrong syntax. The function list2text was not correct. It had been correct but for whatever reason I didn't notice that I messed up a tab key (in Python) and it was not computing correctly (whereas at one point it

Re: Javascript with built-in templates tags

2009-08-09 Thread esatterwh...@wi.rr.com
On Aug 7, 9:31 pm, WilsonOfCanada wrote: > Hellos, > > I was wondering how to use {{ }} variables in javascript functions. > > ex. onchange = "changeArea({{ mooman |safe|escapejs}});" > > Thanks I had this problem too, it was pretty frustrating. I can to 2 different solutions.

implementing a javascript graph application to the existing admin panel listing view

2009-08-09 Thread Hellnar
Greetings I want to implement a javascript graph plot application (ie http://people.iola.dk/olau/flot/examples/turning-series.html) to the existing admin view, where the instances of a model at the listing view also showing charts of these items and can be filtered through by using the already

Re: Code generation

2009-08-09 Thread sjtirtha
Hi Joshua, thank you for your response. It means the statement: "With that, you've got a free, and rich, *Python API*to access your data. The API is created on the fly, no code generation" in

Re: Code generation

2009-08-09 Thread Joshua Partogi
Python Metaclass is the keyword. On Sun, Aug 9, 2009 at 10:59 PM, sjtirtha wrote: > And it is also mentioned in > http://docs.djangoproject.com/en/dev/intro/overview/ > That Django generates the Model API on the fly. How can we generate code on > the fly in python? > > steve

Re: Code generation

2009-08-09 Thread sjtirtha
And it is also mentioned in http://docs.djangoproject.com/en/dev/intro/overview/ That Django generates the Model API on the fly. How can we generate code on the fly in python? steve On Sun, Aug 9, 2009 at 2:56 PM, sjtirtha wrote: > Hi, > > does anybody now, how django

Re: My first Django project

2009-08-09 Thread Ronghui Yu
Hi, Kannan, I am very happy that you like this project. I knew nothing about Django before starting this project. I learnt a lot during this process. But for some reasons, there are still a few problems, I am doing my best to fix them. I would like to publish the code if there are many guys

Code generation

2009-08-09 Thread sjtirtha
Hi, does anybody now, how django generates the code? Is it documented some where? I read somewhere that Django uses Cheetah to generate code. But in other website, Guido compares Django template and cheetah. Regards, Steve --~--~-~--~~~---~--~~ You received this

Re: My first Django project

2009-08-09 Thread Ronghui Yu
Thanks for your advice I'll think about it. :-) Mirat Bayrak ??: > Hi, i liked you project look slike simple cv center. May be you can > think about usability. For example creating items has too much steps. > May be you can put all that forms into one page. Or may be forms can > by dynamicaly

Re: Model Methods and displaying in template?

2009-08-09 Thread Daniel Roseman
On Aug 9, 12:42 pm, rmschne wrote: > I'm looking for the right syntax for inside a template to display a > model variable that is actually not a field in the database (defined > by the mode), but a Model method. > > Class Member(model.Models): >     id =

Model Methods and displaying in template?

2009-08-09 Thread rmschne
I'm looking for the right syntax for inside a template to display a model variable that is actually not a field in the database (defined by the mode), but a Model method. Class Member(model.Models): id = models.IntegerField(primary_key=True, db_column='ID') lname =

Re: Django documentation site is SLOW

2009-08-09 Thread Denis Cheremisov
I thinkg it's firefox issue - with google chromium, midori or opera it's felt much faster. On Aug 7, 3:46 pm, Jo wrote: > Surely can't only be me that finds the main Django site painfully > slow? There is some javascript in there or something that just kills > my browser. >

Re: weirdist situation I have faced in 4 years of (ab)using django

2009-08-09 Thread prabhu S
Hi KG, Nice to meet you! How are you confirming if the data is from Meeting? Are you looking at the final rendered html? What does a print after the statement p = Event.objects.get(pk=id) tell you? Also check if you have just one view for the particular url mapping. Regards, Prabhu On Aug 9,

Re: Recursive request and page layout

2009-08-09 Thread prabhu S
It will be awesome if you can make and open source such a tag. Shouldn't be hard since templates can be evaluated independent of http. If you want something simpler, use iframe and point it to the correct url. Regards, Prabhu On Aug 8, 12:11 pm, SardarNL wrote: > I've

Re: My first Django project

2009-08-09 Thread Kannan
>The first project I do by using Django, http://www.cvcenter.cn, please take a >look, and enjoy. >Any feedback will be appreciated. Hi friend... I saw ur site.It is good. Congratulations for ur job. Just i am started learning the Django.If u don't mind will u send the project's souce code

Re: How to get rid of the 'u'? Seems to be everyhere :)

2009-08-09 Thread Dave
Hey all, thanks for your replies. I have been only using python for a little over a month and django only for a little over a week. Thanks again for your help. On Aug 9, 4:32 am, David Zhou wrote: > See: > > http://diveintopython.org/xml_processing/unicode.html > > -- dz > >

Re: Javascript with built-in templates tags

2009-08-09 Thread Daniel Roseman
On Aug 9, 6:19 am, WilsonOfCanada wrote: > I tried that before, but it only seems to work when it is used on > the .html file. > > onchange="changeArea('{{ list_areas.BC|safe|escapejs}}') > > I need it to be onchange="changeArea('{{ list_areas|safe|escapejs}}') > so the function can

weirdist situation I have faced in 4 years of (ab)using django

2009-08-09 Thread Kenneth Gonsalves
hi latest svn, apache and mod_python on fedora 11 (same problem with runserver) I have three models: Event, Report and Meeting. Outside admin I have addevent which adds and event, event, which gives a list of events and eventfull which details one event.. And the same for Report and Meeting.

Re: Continuing problems running Django when not site Root.

2009-08-09 Thread Streamweaver
Okay I am finnally getting my brain around this. Thanks so much. I tried the code out and it works great, even on the login. I appreciate everyone's help and patience. On Aug 8, 9:49 pm, Malcolm Tredinnick wrote: > On Sat, 2009-08-08 at 13:41 -0700, Streamweaver

Apache2 permission denied problem

2009-08-09 Thread Mac
Hi, I'm new to Django, and am trying to write a csv file and attach it to an email that is sent upon completion of a sales order. All works fine in the developement server, but when I switch to Apache2 I get an error message that either says' No such file or directory, ../orders1/ csv_files/ or