Re: Django Training

2008-12-09 Thread Skylar Saveland
+1, Perhaps building a fully-working site using all parts of Django, implementing interesting and useful features. Also setting-up with reverse proxy/static server with lean, fast networking. Depends on how long the class is I suppose. On Tue, Dec 9, 2008 at 3:32 PM, Jane <[EMAIL PROTECTED]>

Re: referencing the current instance inside limit_choices_to

2008-12-09 Thread Alex Koshelev
There is no way to have per-instance limit_choices_to. On Wed, Dec 10, 2008 at 03:56, GuyBowden <[EMAIL PROTECTED]> wrote: > > Hi, > > I've looked about but can't find the answer to this. > > I'd like to set the limit_choices_to value of a ForeignKey field based > on another selection in the

Re: request parsing

2008-12-09 Thread Vicky
hey can u plse attach and sent me a sample project that uses forms if possible. I need to knw wr anw hw to create forms, should we include anything in settings.py or urls.py? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Index page using flatpages

2008-12-09 Thread Jeff FW
Do you have CommonMiddleware enabled in your settings.py? http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.common On Dec 9, 7:29 pm, Nuno Machado <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using flatpages to display some static content in a site. The > "about" page is

Re: coercing to Unicode: need string or buffer, tuple found

2008-12-09 Thread DragonSlayre
Oh ok, thanks a lot!! Yes, I'm learning python too at the same time as django... On Dec 10, 4:35 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-12-09 at 19:23 -0800, DragonSlayre wrote: > > Hi, > > > I've just made a new 'Student' model, and was trying to create a new > >

Re: coercing to Unicode: need string or buffer, tuple found

2008-12-09 Thread Malcolm Tredinnick
On Tue, 2008-12-09 at 19:23 -0800, DragonSlayre wrote: > Hi, > > I've just made a new 'Student' model, and was trying to create a new > Student in the admin interface, and I got the following error: > > Environment: > > Request Method: POST > Request URL:

coercing to Unicode: need string or buffer, tuple found

2008-12-09 Thread DragonSlayre
Hi, I've just made a new 'Student' model, and was trying to create a new Student in the admin interface, and I got the following error: Environment: Request Method: POST Request URL: http://localhost:8000/admin/student/student/add/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed

Re: ModelForm removing blank=True

2008-12-09 Thread tenni
Brilliant. Thanks James. I went down this path of thinking but tried blank=True instead of required=False which, when it failed, confused my underslept mind :) Appreciate it. Andrew. On Dec 10, 1:03 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 7:50 PM, tenni <[EMAIL

Re: ModelForm removing blank=True

2008-12-09 Thread James Bennett
On Tue, Dec 9, 2008 at 7:50 PM, tenni <[EMAIL PROTECTED]> wrote: > "optional_field" becomes a required field in the Admin. I assume > something is overriding the model's blank=True for this field. Yes. *You* are overriding that. The moment you override a field's definition in a ModelForm is the

ModelForm removing blank=True

2008-12-09 Thread tenni
If I do this in admin.py class UnitAdminModelForm(forms.ModelForm): optional_field = forms.CharField(widget=WYMEditor()) class Meta: model = Unit "optional_field" becomes a required field in the Admin. I assume something is overriding the model's blank=True for this field. If

Re: Preserving pretty HTML output

2008-12-09 Thread Tonne
Good point, thanks very much, but I think I'll just live with the way it currently works. What I've done is to take a bit more care how and where I place template tags, and this has improved things somewhat. On Dec 4, 1:25 am, adelevie <[EMAIL PROTECTED]> wrote: > You may also want to look at

Re: Really easy DateTimeField question

2008-12-09 Thread DragonSlayre
Thanks a lot ! On Dec 10, 1:24 pm, friggstad <[EMAIL PROTECTED]> wrote: > It is the human-friendly name used in the admin. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Too Many Connections

2008-12-09 Thread Eric Abrahamsen
On Dec 10, 2008, at 1:30 AM, DULMANDAKH Sukhbaatar wrote: > >> File >> "/usr/local/python2.5/lib/python2.5/site-packages/ >> MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py", >> line 74, in Connect >> >> File >> "/usr/local/python2.5/lib/python2.5/site-packages/ >>

Re: I got 'invalid literal for int() with base 10: 'AA'' error, please help

2008-12-09 Thread Malcolm Tredinnick
On Tue, 2008-12-09 at 16:12 -0800, Chr1s wrote: > > ValueError at /vote/add/ > > invalid literal for int() with base 10: 'AA' > > Request Method: POST > Request URL: http://localhost:8000/vote/add/ > Exception Type: ValueError > Exception Value: > > invalid literal for int()

referencing the current instance inside limit_choices_to

2008-12-09 Thread GuyBowden
Hi, I've looked about but can't find the answer to this. I'd like to set the limit_choices_to value of a ForeignKey field based on another selection in the current instance. i.e. - filter the choices based on another field of the same instance. something like this: my_fk.limit_choices_to =

Re: Really easy DateTimeField question

2008-12-09 Thread friggstad
It is the human-friendly name used in the admin. --~--~-~--~~~---~--~~ 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

Index page using flatpages

2008-12-09 Thread Nuno Machado
Hi, I'm using flatpages to display some static content in a site. The "about" page is working flawlessly (URL = mysite.com/about) but now I'm trying to define the index (URL = mysite.com) using flatpages. I'm having troubles defining the URL in the administration panel: If I put / in the URL

Re: Memory Footprint

2008-12-09 Thread Malcolm Tredinnick
On Tue, 2008-12-09 at 09:10 -0700, Jeff Anderson wrote: [...] > I am running memcached, which does seem to help my sites go faster, but > it isn't helping the memory footprint go down (obviously.) Although memcached is usually "the answer" to a lot of caching issues, it does have that obvious

Really easy DateTimeField question

2008-12-09 Thread DragonSlayre
Hi, I've seen some code with the following in, but can't find what the string 'date added' is representing in the documentation. What is the string for? models.DateTimeField('date added') Thank you! I know it's easy, but it'd take me forever to find out.

I got 'invalid literal for int() with base 10: 'AA'' error, please help

2008-12-09 Thread Chr1s
ValueError at /vote/add/ invalid literal for int() with base 10: 'AA' Request Method: POST Request URL:http://localhost:8000/vote/add/ Exception Type: ValueError Exception Value: invalid literal for int() with base 10: 'AA' Exception Location:

Re: time it takes django to read database?

2008-12-09 Thread garagefan
haha yeah, i just submitted a ticket to godaddy. They're usually really good with getting back. On Dec 9, 6:31 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote: > > > ok, server time is 2 hours and 11 minutes behind... this could

Re: time it takes django to read database?

2008-12-09 Thread Colin Bean
On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote: > > ok, server time is 2 hours and 11 minutes behind... this could explain > the issue then. The admin section, when creating a new entry takes the > time current actual time. So it makes 100% sense that django/python is >

Re: time it takes django to read database?

2008-12-09 Thread garagefan
ok, server time is 2 hours and 11 minutes behind... this could explain the issue then. The admin section, when creating a new entry takes the time current actual time. So it makes 100% sense that django/python is reading the incorrect time. I've attempted to update the server time using the usual

Re: Using random.random() while running on server

2008-12-09 Thread Chris
Thanks Daniel Roseman That did the trick. I did not think to do a lambda > I _very_ strongly suggest you take some time learning Python. In this > case, the parens are actually the call operator. Not applying this > operator results in getting a reference to the function (or whatever >

Re: custom distinct() method

2008-12-09 Thread Russell Keith-Magee
On Tue, Dec 9, 2008 at 7:05 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > please, maybe anyone now how to perform distinct() filtering for > certain attribute(column), not the whole objects(rows)? :) First off - patience. Only 10 hours passed between your original request and your repeat.

Re: Django Training

2008-12-09 Thread Jane
I think it would be good to ask students how they plan to use django. For myself, we'd like to deploy databases on a web page, and I'm interested to learn how much of that can be done in python and django, then what do you add to make the database look pretty for outside users. On Dec 8, 11:06 

Re: time it takes django to read database?

2008-12-09 Thread garagefan
awesome, i will take a look at the server date. It is possible that it is off. On Dec 9, 3:57 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote: > > > Server is Red Hat 7, set up by godaddy, its a virtual server. Python > > 2.5 w/

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er
w00t. Thanks. After a bunch more import statements I finally got it working. Thanks again!!! On Dec 9, 4:22 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote: > > > Still no luck. I have this line added to the top of views.py. > > > from

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
Also, as an aside to all of that--what you're generating is in no way guaranteed to be unique. If you really need a unique string, use a UUID or hash of the primary key. On Dec 9, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote: > > >

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote: > Still no luck. I have this line added to the top of views.py. > > from xxx.register.forms import ContactForm > > It can't seem to find forms 'No module named forms'. > Sorry, I misread your original post. For some reason you have put your

Re: admin caching querysets

2008-12-09 Thread lingrlongr
Thanks Karen. I removed the custom form from admin.py and added a constructor to the model: def __init__(self, *args, **kwargs): super(BannerImage, self).__init__(*args, **kwargs) self._meta.get_field('url')._choices = get_urls() It seems to work now. Keith On Dec 9, 2:52 pm, "Karen

Re: Memory Footprint

2008-12-09 Thread Graham Dumpleton
On Dec 10, 3:10 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Hello, > > First, I'm gonna say that I have DEBUG turned off, and it's not Django's > fault. > > My Django sites seem to eat lots of memory. This is fine, and it isn't a > huge deal except that I am using all of my VPS's memory plus

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er
Still no luck. I have this line added to the top of views.py. from xxx.register.forms import ContactForm It can't seem to find forms 'No module named forms'. On Dec 9, 3:45 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote: > > > Thank you.

Re: time it takes django to read database?

2008-12-09 Thread Jay Parlar
On Tue, Dec 9, 2008 at 3:57 PM, Colin Bean <[EMAIL PROTECTED]> wrote: > Ah, didn't realize that it was showing one part of the page and not > another. Looks like the template tag in the "secondary" section > queries all of the blog post objects, while the main section uses the > "latest"

m2m relationship

2008-12-09 Thread Lavoie Francis
Hi, I have a question regarding m2m relationship. I've created I table that contain product and has a manytomany relationship with an other table that stores images. I would like to add the image in the product admin form. I don't want to see all the images in the product table, but just

Re: time it takes django to read database?

2008-12-09 Thread Colin Bean
On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote: > > Server is Red Hat 7, set up by godaddy, its a virtual server. Python > 2.5 w/ mod_python and python-devel installed. running latest django. > > I am using webmonkey.com's tutorial for this: >

Re: Using random.random() while running on server

2008-12-09 Thread bruno desthuilliers
On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote: > Hello, > when django is running on a server, I want to make a call to: > random.random(). When I make a call to this again, I can't. I think > this related to a similar issue datetime.datetime.now() where you > leave off the () to get a current

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote: > Thank you. That cleared that up. Now getting the error. "global name > 'ContactForm' is not defined" in my 'views.py' file.  Any ideas? > Well, as with all Python code, if you define an object in one file and refer to it in another, you

Re: Using random.random() while running on server

2008-12-09 Thread Daniel Roseman
On Dec 9, 7:34 pm, Chris <[EMAIL PROTECTED]> wrote: > Here is a code snippet:http://dpaste.com/97475/so basically when I > login to the backend and try to add a couple rows. I get the same > random id each time. As you might realise, what's happening is that Django is evaluating your call to

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er
Thank you. That cleared that up. Now getting the error. "global name 'ContactForm' is not defined" in my 'views.py' file. Any ideas? On Dec 9, 3:35 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote: > > > Trying to follow along with the Form

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote: > Trying to follow along with the Form Tutorial on the Django site and > I'm running into a problem.  I keep getting the error page 'module' > object has not attribute 'ContactForm', when I just simply copy and > pasted the code from the

Django developers in Johannesburg/Pretoria, South Africa for collaboration

2008-12-09 Thread eldonp2
I'm looking for someone in the Johannesburg/Pretoria area who is willing to collaborate with me on some aspects of a Django app. I have done quite alot of work on getting the business logic right, but need some guidance on many of the technical aspects. Anyone available, and willing to assist?

'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er
Trying to follow along with the Form Tutorial on the Django site and I'm running into a problem. I keep getting the error page 'module' object has not attribute 'ContactForm', when I just simply copy and pasted the code from the tutorial into my models.py. Here is my source. I feel like it has

Re: time it takes django to read database?

2008-12-09 Thread garagefan
Server is Red Hat 7, set up by godaddy, its a virtual server. Python 2.5 w/ mod_python and python-devel installed. running latest django. I am using webmonkey.com's tutorial for this: http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First_App so you can find the blog app as well

Re: time it takes django to read database?

2008-12-09 Thread Colin Bean
On Sun, Dec 7, 2008 at 7:32 PM, garagefan <[EMAIL PROTECTED]> wrote: > > following another tutorial to build a blog (webmonkey.com's) at it was > rather frustrating to see nothing show up after creating a new blog... > > the admin section seems to see these right away, as they are there as > soon

Re: admin caching querysets

2008-12-09 Thread Karen Tracey
On Tue, Dec 9, 2008 at 1:58 PM, lingrlongr <[EMAIL PROTECTED]> wrote: > > I have a function called get_urls that returns a list of absolute_urls > for various models in the same project. This function is used for > another model in a way so that when a particular model appears on the > site, I

Re: time it takes django to read database?

2008-12-09 Thread Jay Parlar
On Tue, Dec 9, 2008 at 9:33 AM, garagefan <[EMAIL PROTECTED]> wrote: > > sure thing: > > from django.conf.urls.defaults import * > from mysite.blog.models import Entry > from tagging.views import tagged_object_list > > info_dict = { >'queryset': Entry.objects.filter(status=1), >

Using decorators like login_required with FormPreview

2008-12-09 Thread jb0t
Recently, I tried to add multiple decorators to FormPreview http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-preview/ The only documented examples of how to accomplish this I could find were here...

Re: Using random.random() while running on server

2008-12-09 Thread Chris
Here is a code snippet: http://dpaste.com/97475/ so basically when I login to the backend and try to add a couple rows. I get the same random id each time. On Dec 9, 10:27 am, Jeff FW <[EMAIL PROTECTED]> wrote: > Can you show me exactly what you're trying to do?  That would make it > much easier

Re: Excel Generating Report

2008-12-09 Thread garces.85
Hello, Sorry thats not the real template, it's this one: {% for d in data %} {{ d.pregunta.id }} {{ d.pregunta.descripcion_pregunta}} {{ d.respuesta }} {{ d.pregunta.tipo_pregunta.nombre_tipo }}

Re: Excel Generating Report

2008-12-09 Thread garces.85
Hello, This is my template(actually is only the part where the for cycle returns the results i need): {% for r in rendicion %} {{forloop.counter}} {{r.comuna.nom_comuna|upper}} {{r.comuna.region.nom_region}}

Re: missing admin documentation

2008-12-09 Thread aparajita
> Right in your urls.py there should be commented out lines that's > specifically tells you what to do to get the docs working. Once you do > that then you will see the link. Doh! I had deleted all that. Thanks, that did the trick (along with adding admindocs to INSTALLED_APPS). - Aparajita

admin caching querysets

2008-12-09 Thread lingrlongr
I have a function called get_urls that returns a list of absolute_urls for various models in the same project. This function is used for another model in a way so that when a particular model appears on the site, I can choose which part of the site this model links to. # utils.py def

Re: OperationalError -- Table has no column named ..

2008-12-09 Thread djan
Thanks so much for the help! I deleted the database, made the changes you suggested and ran syncdb again. I have two lingering issues. 1) At the django admin interface, I still only see a place to enter data for 'Artist', and none of the tables that follow it in models.py appear (the updated

Re: Memory Footprint

2008-12-09 Thread Rajesh Dhawan
> First, I'm gonna say that I have DEBUG turned off, and it's not Django's > fault. > > My Django sites seem to eat lots of memory. This is fine, and it isn't a > huge deal except that I am using all of my VPS's memory plus swap. The > real solution is to upgrade memory on the VPS, but I'm a poor

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
Can you show me exactly what you're trying to do? That would make it much easier to help you. -Jeff On Dec 9, 1:19 pm, Chris <[EMAIL PROTECTED]> wrote: > I found this snippet:http://www.djangosnippets.org/snippets/814/and > noticed that it does not work as intended do to the issue that I >

Re: Using random.random() while running on server

2008-12-09 Thread Chris
I found this snippet: http://www.djangosnippets.org/snippets/814/ and noticed that it does not work as intended do to the issue that I described. I tried passing it as default instead of using the save method but does not work and since I am not passing random to default directly, I cannot do

Re: missing admin documentation

2008-12-09 Thread Ronny Haryanto
On Wed, Dec 10, 2008 at 12:50 AM, aparajita <[EMAIL PROTECTED]> wrote: > I am using django release 1.0.2, nothing modified. My admin interface > works fine, but the documentation link never appears. I have > 'django.middleware.doc.XViewMiddleware' in the list of middleware, I > have my IP address

Re: problems with 'formset.__name__' in save_formset()

2008-12-09 Thread Rajesh Dhawan
> im a bloody django and python beginner and right now playing arround > with the code provided > onhttp://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser > > on storing the entry in the admin following error occur: > > AttributeError at /admin/news/post/add/ > > 'CommentFormFormSet'

Re: missing admin documentation

2008-12-09 Thread Steve Phillips
Right in your urls.py there should be commented out lines that's specifically tells you what to do to get the docs working. Once you do that then you will see the link. Steve On 12/9/08, aparajita <[EMAIL PROTECTED]> wrote: > > Hi, > > I am using django release 1.0.2, nothing modified. My admin

missing admin documentation

2008-12-09 Thread aparajita
Hi, I am using django release 1.0.2, nothing modified. My admin interface works fine, but the documentation link never appears. I have 'django.middleware.doc.XViewMiddleware' in the list of middleware, I have my IP address listed in INTERNAL_IPS. Any ideas? - Aparajiita

Re: How do wire Userprofile to UserAdmin ?

2008-12-09 Thread Timboy
The problem with this solution is that you are unable to sort and/or filter by anything you "wire" to the User admin page. #9463 is one I have posted a bit ago. On Dec 9, 9:43 am, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote: > >

Re: How do wire Userprofile to UserAdmin ?

2008-12-09 Thread Ronny Haryanto
On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote: > How do wire Userprofile to UserAdmin ? Here's one way to do it: # admin.py from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from myproj.myapp.models

Re: Too Many Connections

2008-12-09 Thread DULMANDAKH Sukhbaatar
> File > "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py", > line 74, in Connect > > File > "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/connections.py", > line 170, in

problems with 'formset.__name__' in save_formset()

2008-12-09 Thread hhanse
hello group, im a bloody django and python beginner and right now playing arround with the code provided on http://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser on storing the entry in the admin following error occur: AttributeError at /admin/news/post/add/ 'CommentFormFormSet'

Too Many Connections

2008-12-09 Thread Trivedi, Apaar
This may not even be a Django problem, but I saw this on two of my dev sites today, both running the same code base, our version of django is from the trunk, and maybe a week or so old. One site was running the light weight server, the other site was running apache/mod_python. Both are connected

Re: issue with django tagging

2008-12-09 Thread garagefan
I had the same issue... you need to do two things... copy this into the setup.py from django.conf import settings settings.configure() and make sure you have python-devel installed On Dec 9, 8:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi > I got it from trunk,and the version is

Memory Footprint

2008-12-09 Thread Jeff Anderson
Hello, First, I'm gonna say that I have DEBUG turned off, and it's not Django's fault. My Django sites seem to eat lots of memory. This is fine, and it isn't a huge deal except that I am using all of my VPS's memory plus swap. The real solution is to upgrade memory on the VPS, but I'm a poor

Re: issue with django tagging

2008-12-09 Thread Mario
Try typing the following: python manage.py shell from the python shell, type: import tagging tagging.VERSION Regards On Dec 9, 8:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi > I got it from trunk,and the version is 0.3. After I installed > tagging , I cannot import it. The

Re: unique_together question

2008-12-09 Thread bruno desthuilliers
On 9 déc, 13:20, Alex Jonsson <[EMAIL PROTECTED]> wrote: > Hey everyone, > > My model looks like the following: > > http://dpaste.com/97293/ > > An album has a release date for every format, and one format can only > have one release date per album. Hopefully you get what I'm trying to > achieve

Re: Excel Generating Report

2008-12-09 Thread Elvis Stansvik
Hello Kian, Could you show us your template too? And why are you importing the csv module when you're not using it? I would use the csv module to generate the CSV completely in the view, but that's me. 2008/12/9, garces.85 <[EMAIL PROTECTED]>: > > Hello Kian, > > I have already tried this

Re: time it takes django to read database?

2008-12-09 Thread garagefan
sure thing: from django.conf.urls.defaults import * from mysite.blog.models import Entry from tagging.views import tagged_object_list info_dict = { 'queryset': Entry.objects.filter(status=1), 'date_field': 'pub_date', } urlpatterns = patterns('django.views.generic.date_based',

Re: how to do redirects with django?

2008-12-09 Thread Thomas Guettler
Hi, def foo(request): return django.http.HttpResponseRedirect(newlocation) newlocation can be an URL. I create them with django.core.urlresolvers.reverse(). Thomas nbv4 schrieb: > If the user goes to /foobar, I want it to redirect him to /foobar-page- > XX, XX being the last

issue with django tagging

2008-12-09 Thread [EMAIL PROTECTED]
hi I got it from trunk,and the version is 0.3. After I installed tagging , I cannot import it. The error information is following: Thank you very much --- IDLE 1.2.2 >>> import tagging Traceback (most recent call last): File

Re: dynamic mod wsgi

2008-12-09 Thread Ben Eliott
Understood. Thanks. On 9 Dec 2008, at 10:18, Graham Dumpleton wrote: > > > > On Dec 9, 8:05 pm, Ben Eliott <[EMAIL PROTECTED]> wrote: >> Graham, >> Thank you for coming back personally to such a lowly wsgi question! I >> started reading your email and thinking the answer was 'no', then >> ended

Re: Using random.random() while running on server

2008-12-09 Thread Jeff FW
Chris, It depends on where you're calling random.random(). If you're trying to do it in a model definition, then you're always going to have the value it chose when it first executed the model's class definition-- when the server starts up. In that case, you should be able to pass an argument

How do wire Userprofile to UserAdmin ?

2008-12-09 Thread mahesh
UserProfile How do wire Userprofile to UserAdmin ? I want to add some more fields to user class. I have added one class in polls/admin.py (polls being my app) and added following attribute in settings.py >> code snippet << AUTH_PROFILE_MODULE='polls.MySiteProfile' model.py gender = (

Adding costum css classes to form labels based on validation rules outside the admin

2008-12-09 Thread Marco Louro
Hi, I guess the subject sums it up.. Basicly, in the admin we have: City: But oustide there is no 'class="required"'. Is there a way to define this so that it shows up? That would make my life much easier since I could just code some javascript to do client side validation based on css

Re: "Legal" way to have foreign key field in the custom form

2008-12-09 Thread Jeff FW
To get the plus icon back, you need to wrap the field in a RelatedFieldWidgetWrapper. Here's an example from my code--obviously, you'll have to adapt it to fit your situation. class CategoryChoiceField(forms.ModelChoiceField): def __init__(self, *args, **kwargs):

Re: Excel Generating Report

2008-12-09 Thread garces.85
Hello Kian, I have already tried this response, the problem is that in my excel output i get this strange characters. For example all my grammar words return like weird characters. Example : If i have this word : ( Módulo) It becomes something like this : (MA3- dulo). I am working with a latin

Re: how to do redirects with django?

2008-12-09 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses http://docs.djangoproject.com/en/dev/ref/contrib/redirects/#ref-contrib-redirects On Tue, Dec 9, 2008 at 16:25, nbv4 <[EMAIL PROTECTED]> wrote: > > If the user goes to /foobar, I want it to redirect him to

how to do redirects with django?

2008-12-09 Thread nbv4
If the user goes to /foobar, I want it to redirect him to /foobar-page- XX, XX being the last page. I have a this in my urlconf" (r'^foobar/ $', 'project.main.views.foobar_no_page', ), (r'^foobar-page-(?P\d{1,4})/$', 'project.main.views.foobar', ), foobar() in my views in my main function,

Re: selected ModelMultipleChoiceField

2008-12-09 Thread Abdel Bolanos Martinez
That's rigth you hit the point followed your advice and with these lines i resolved my problem, got modelform filtered by a custom query yaho the model (part of it) class Indicacion(models.Model): ''' @author: Abel Bolaños Martínez @contact: [EMAIL

Re: python path

2008-12-09 Thread mangamonk
ok, I've added coltrane!..rock on! I added an admin.py file to the coltrane folder.. --- #admin.py from django.contrib import admin from coltrane.models import Category admin.site.register(Category)

problem with paginated page having checkbox

2008-12-09 Thread laspal
hi, I am trying to get list of selected checkbox from the listing. here is my code: html {% for companies in companylist.object_list %} {% endfor %} {% if is_paginated %} Prev | Page {{cur_page}} of {{paginator_company_list.num_pages}} | Next {% endif %} and

Re: python path

2008-12-09 Thread mangamonk
>>>import sys; sys.path ['', '/home/mark/django_projects', '/home/mark/django_projects/coltrane', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages',

unique_together question

2008-12-09 Thread Alex Jonsson
Hey everyone, My model looks like the following: http://dpaste.com/97293/ An album has a release date for every format, and one format can only have one release date per album. Hopefully you get what I'm trying to achieve here ;) The thing is though, that in my Album model I specify a

Re: How to import DoesNotExist exception ???

2008-12-09 Thread Sérgio Durand
from tutorial part 03: from django.http import Http404 # ... def detail(request, poll_id): try: p = Poll.objects.get(pk=poll_id) except Poll.DoesNotExist: raise Http404 return render_to_response('polls/detail.html', {'poll': p})

python path

2008-12-09 Thread mangamonk
I'm working through 'practical django projects' on page 46, in order to develop stanalone application, I need to add my django 'project' to the python path. therefore.. export PYTHONPATH=/home/mark/django_projects/:$PYTHONPATH then a little later in the tutorial after setting up the 'coltrane

Re: "Legal" way to have foreign key field in the custom form

2008-12-09 Thread Eugene Mirotin
Well, looks that the ModelChoiceField solves the problem except of the plus icon On Dec 9, 12:34 pm, Eugene Mirotin <[EMAIL PROTECTED]> wrote: > Hello. I'm working on the custom admin page  that will serve batch > items creation based on the uploaded file. > All these items should be linked to

Re: Problem with django tagging: how to add tags??

2008-12-09 Thread Andrew Davison
> I am using django tagging and have problems adding tags to an object. > > There are 2 methods that enable adding a tag: > - add_tag() > - update_tags() > > -- > for tag in parse_inputs(form.cleaned_data['tags']): > Tag.objects.add_tag(tag) >

"Legal" way to have foreign key field in the custom form

2008-12-09 Thread Eugene Mirotin
Hello. I'm working on the custom admin page that will serve batch items creation based on the uploaded file. All these items should be linked to the single foreign key item. This item should be selected on the form. Of course, I can investigate the inner structure of the rendered admin pages and

Using random.random() while running on server

2008-12-09 Thread Chris
Hello, when django is running on a server, I want to make a call to: random.random(). When I make a call to this again, I can't. I think this related to a similar issue datetime.datetime.now() where you leave off the () to get a current date each time each time you call it. If you dont do that,

Re: dynamic mod wsgi

2008-12-09 Thread Graham Dumpleton
On Dec 9, 8:05 pm, Ben Eliott <[EMAIL PROTECTED]> wrote: > Graham, > Thank you for coming back personally to such a lowly wsgi question! I   > started reading your email and thinking the answer was 'no', then   > ended up thinking 'definitely maybe'. I'll keep an eye out in case you   > post

Re: custom distinct() method

2008-12-09 Thread jamesjacksonn...@gmail.com
please, maybe anyone now how to perform distinct() filtering for certain attribute(column), not the whole objects(rows)? :) In case not - please tell me what's the best practice when coming to a situation when django orm is not powerfull enough. Can writting custom sql queries become a serious

Re: Many to Many entries being duplicated, any ideas?

2008-12-09 Thread Darthmahon
I'll give it a go :) Thanks for your help Ben. On Dec 9, 9:50 am, Ben Eliott <[EMAIL PROTECTED]> wrote: > hmm, don't know. that's the documented approach. you might want to   > investigate intermediary tables/models etc. > > On 9 Dec 2008, at 09:24, Darthmahon wrote: > > > > > Ahh yes possibly.

Re: request parsing

2008-12-09 Thread Polat Tuzla
File uploading is explained in detail at http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ In short you create a form consisting of a file field: class UploadFileForm(forms.Form): title = forms.CharField(max_length=50) file = forms.FileField() then write a view function

Re: Many to Many entries being duplicated, any ideas?

2008-12-09 Thread Ben Eliott
hmm, don't know. that's the documented approach. you might want to investigate intermediary tables/models etc. On 9 Dec 2008, at 09:24, Darthmahon wrote: > > Ahh yes possibly. Any downsides to using this? > > On Dec 9, 9:19 am, Ben Eliott <[EMAIL PROTECTED]> wrote: >> Do you want something

Re: request parsing

2008-12-09 Thread Ben Eliott
request.FILES If this is what you mean, I think this is kind of django 101, i'd recommend having a solid read through the docs which cover all these kind of bases really well. On 9 Dec 2008, at 09:30, Vicky wrote: > > If we send a file by post method to a django function how can we >

Re: OperationalError -- Table has no column named ..

2008-12-09 Thread Daniel Roseman
On Dec 9, 5:02 am, djan <[EMAIL PROTECTED]> wrote: > Hello, > > I'm running OpenSuSE-11.0 with the lastest version of django and > sqlite3. > When I enter the admin interface to enter data into my database, I got > the error: > > OperationalError at /admin/archive/artist/add/ > > table

  1   2   >