Re: dynamic mod wsgi

2008-12-09 Thread Graham Dumpleton
On Dec 9, 6:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, I'm converting to the excellent mod_wsgi and wondering if it's > possible to make a single httpd virtual host/wsgi file to manage > wildcard subdomains. > > Basically I have an app where i'm creating a new instance for each

Re: Displaying image stored in models.ImageField

2008-12-09 Thread David Christiansen
Hello Craig, Just make sure not to use this in production. For your production site, you should really conifigure Apache or lighttpd or some other dedicated web server for the static content. The Django view isn't that efficient at it. -David Christiansen On Dec 8, 10:46 pm, "Craig Spry" <[EM

Re: Please help me with static files serving

2008-12-09 Thread Oleg Oltar
That did the trick :) Works now! Thanks On Tue, Dec 9, 2008 at 9:38 AM, Jeff Anderson <[EMAIL PROTECTED]>wrote: > Oleg Oltar wrote: > > Hi! > > > > I am trying to setup django to use static files for development purposes. > > I used http://docs.djangoproject.com/en/dev/howto/static-files/ > > >

Re: Django storage method question

2008-12-09 Thread Richard Silver
This looks to have been an issue with cStringIO. If I import StringIO instead it seems to work, but only after I create the object. I'd really like to do this: test = PdfFile(business=business1, pdf = f, created = datetime.now()) test.save() however I get this traceback:http://dpaste.com/hold/9727

Django storage method question

2008-12-09 Thread Timboy
I'm having an issue passing a buffered StringIO to the FileField object. Here is my code: ##models.py from django.db import models from business.models import Business class PdfFile(models.Model): business = models.ForeignKey(Business) pdf = models.FileField(upload_to='get_pdf_path')

help needed with Lighttpd and Apache cofiguration with Django

2008-12-09 Thread AssaultedPeanut
I am using Django as web framework and then Apache and Lighttpd as web server and static media server respectively. Lighty serves all my static content well and good, but I need to configure it to serve the new files uploaded by the user. Lighttpd is running on a different machine from the Apache(

Re: Development server crash with no error message

2008-12-09 Thread Ronny Haryanto
On Tue, Dec 9, 2008 at 4:50 AM, Andrew Fong <[EMAIL PROTECTED]> wrote: > > When I'm poking around in my Django app, my development server > (manage.py runserver) will sometimes quit without raising an exception > or leaving any messages. I am not tinkering around with the code or > doing anything

Re: dynamic mod wsgi

2008-12-09 Thread Ben Eliott
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 more, otherwise i'll follow those links and your directions and hope

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

2008-12-09 Thread Darthmahon
Hi Guys, Just bumping this up as I still can't figure out why this is happening :/ On Dec 8, 9:27 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi Guys, > > I've got a model that has a Many to Many relationship on one of the > fields. This relationship is basically on itself though like this: > >

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

2008-12-09 Thread Ben Eliott
Do you want something like this? friends_new = models.ManyToManyField("self",symmetrical=False) On 9 Dec 2008, at 09:06, Darthmahon wrote: > > Hi Guys, > > Just bumping this up as I still can't figure out why this is > happening :/ > > On Dec 8, 9:27 pm, Darthmahon <[EMAIL PROTECTED]> wrote: >>

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

2008-12-09 Thread Darthmahon
Ahh yes possibly. Any downsides to using this? On Dec 9, 9:19 am, Ben Eliott <[EMAIL PROTECTED]> wrote: > Do you want something like this? > friends_new = models.ManyToManyField("self",symmetrical=False) > > On 9 Dec 2008, at 09:06, Darthmahon wrote: > > > > > Hi Guys, > > > Just bumping this up

request parsing

2008-12-09 Thread Vicky
If we send a file by post method to a django function how can we separate the file from the request? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

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 archive_art

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 > separa

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 li

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 to

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. A

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 pr

"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

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) >

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 ap

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 ManyToMa

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
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) --

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 PROTECTE

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, d

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, fooba

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', '/usr/lib/pyt

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 /foobar-

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: "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): super(CategoryChoic

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 th

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 classes.

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 = (

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 o

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: 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 mor

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: 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}) ---

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 pag

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: 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 respon

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 h

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 erro

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 coll

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 0

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

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' obj

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 __init__\n

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 im

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: > > H

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: 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

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' ob

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: 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 this

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 > desc

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: 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 vers

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 get_urls():

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 --~-

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: 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: 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

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... http://scompt.com/archives/2007/11/07/using-djangos-formpreview-with-login_require

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), >'da

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 ca

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: 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 a

'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

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? --~

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 tutori

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 Tut

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 make

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 have

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: 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: > http://www.webmonkey.com/tutoria

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 t

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" variable

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. Th

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: 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 Trace

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 fo

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: > > > He

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 xxx.re

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/ m

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 am

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: 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 > callable).

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: 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 > readin

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 ex

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: /usr/lib/python2.5/site-p

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. --~--~-~--~~~

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 re

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 fi

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 group

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 = my

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() with

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/ >> MySQL_python-1

  1   2   >