HTTP_REFERER

2007-02-17 Thread Pythoni
I would like to use HTTP_REFERER in my Django project to find out from where users came to my website. So, my first page is INDEX.HTML that uses def Index(request) procedure. In this def Index(request) I use request.META['REMOTE_ADDR'] but I found out that Referer does not work. HTTP_REFERER is e

Help about saving two linked instances...

2007-02-17 Thread Giuseppe Franchi
Hello everyone! I've approached Django and Python from a few time and i love them both. As i am newbie i have a noobish question. My problem is: i have to store a Resource object splitted in two tables as following: class Resource(models.Model): title = models.CharField(maxlength=100)

Re: Django over modpython

2007-02-17 Thread ashwoods
i've been checking out hosts for myself, and the already mentioned www.webfaction.com seems to be very good. i haven't chosen yet, but their team seems to be very friendly and I have had some _weird_ requests myself and they were very helpfull. but most hosting do have fastCGI, and that works. O

Re: Help about saving two linked instances...

2007-02-17 Thread Pythoni
I think you need some relations. You can have a look at http://www.djangoproject.com/documentation/models/ and choose the best model for your problem L. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: HTTP_REFERER

2007-02-17 Thread [EMAIL PROTECTED]
Pythoni napisał(a): > I would like to use HTTP_REFERER in my Django project to find out from > where users came to my website. So, my first page is INDEX.HTML that > uses > def Index(request) procedure. > In this def Index(request) I use > request.META['REMOTE_ADDR'] > but I found out that Refere

Reuse inclusion template tag in admin textarea?

2007-02-17 Thread Dirk Eschler
Hi, i'm using the following template tag in my application: @register.inclusion_tag('gallery/flv.html') def flv(movie, width=320, height=160): """ """ fl = FlashMovie() return { 'flv_player': fl.get_flvplayer(), 'movie': '%s/%s' % (fl.get_upload_url(), movie),

Custom model initializers - getting logged in user in django models

2007-02-17 Thread kahless
hi, i am creating a very simple board and wanted to add a method to my models which would check if there are any new posts in a thread / forum for a given user.. for this to work .. i obviously need the currently logged in user in my models .. but i didn't want to iterate through all my models i

Re: Django over modpython

2007-02-17 Thread aribao
Yes, most of the hostings have fastCGI, but not flup. I know the best is to have VPS hosting, but they are very expensive, and I think I can manage with a shared hosting. I think Blouehost looks good. On 17 feb, 11:32, "ashwoods" <[EMAIL PROTECTED]> wrote: > i've been checking out hosts for mysel

Re: rendering dynamic fields in newforms

2007-02-17 Thread Honza Král
for rendering you should use BoundField... I use something like this... for s in : name = 'stay_' + str( s.id ) bf = BoundField( self, self.fields[name], name ) output.append( u'%s' % bf ) On 2/17/07, Rubic <[EMAIL PROTECTED]> wrote: > > Hi, I'm th

Re: Custom model initializers - getting logged in user in django models

2007-02-17 Thread Honza Král
This doesn't seem very clean to me... I also need to have logged-in user available in my models, so I have written a custom middleware that stores the user in thread_locals: import threading _thread_locals = threading.local() def get_current_user(): return getattr( _thread_locals, 'user', No

Re: Help about saving two linked instances...

2007-02-17 Thread Honza Král
Hi Giuseppe, On 2/17/07, Giuseppe Franchi <[EMAIL PROTECTED]> wrote: > > Hello everyone! > I've approached Django and Python from a few time and i love them > both. > As i am newbie i have a noobish question. My problem is: i have to > store a Resource object splitted in two tables as following: >

Re: error pages ?

2007-02-17 Thread Honza Král
On 2/17/07, akonsu <[EMAIL PROTECTED]> wrote: > > hello, > > the tutorial on djangoproject.com explains how to set up views > generating error pages for responses such as 404 or 500. is there a > way to use mod_python functionality and make apache serve its own > error pages? in case when it is run

Re: Custom model initializers - getting logged in user in django models

2007-02-17 Thread kahless
altough i'm not sure if thread locals are that clean .. i guess it's a better way .. thanks .. i was searching for something like that .. i wonder why i haven't found that site :( it seems there are tons more documentation in the wiki as i've thought ;) cu, herbert On Feb 17, 3:22 pm, "Honza K

Free Pc To Phone Calling

2007-02-17 Thread coolguy17111987
Now you can call anywhere in world for free ...hurry up...Its Globe 7.. you are paid to watch free videos(of your choice)... Now its no. 1 VOIP service in the worldClick on the link below...download the software, register for free and start calling What are you waiting for now Call any

Re: Django over modpython

2007-02-17 Thread akonsu
www.prgmr.com seem to have affordable VPS hosting. but i agree, they still offer less space and bandwidth than shared hosting. konstantin On Feb 17, 8:03 am, [EMAIL PROTECTED] wrote: > Yes, most of the hostings have fastCGI, but not flup. > I know the best is to have VPS hosting, but they are ve

passing parameters to a method from a template

2007-02-17 Thread omat * gezgin.com
I couldn't find any reference on passing parameters to a view method from within a template. All I could find are some examples of passing a single parameter to filter functions like: {{ pub_date|date:"F j, Y" }} Is there a way of doing this? --~--~-~--~~~---~--~--

newforms select field

2007-02-17 Thread paulh
I feel the following should work: class Myform(forms.Form): ...publ = forms.ChoiceField(label='Publisher', required=False) and then in handler I should be able to set the choices dynamically by: def meth(request): ...frm=Myform(initial={'publ':((1,2),(2,3),(3,4)))}) #even if the brackets are wro

Re: newforms select field

2007-02-17 Thread Honza Král
On 2/17/07, paulh <[EMAIL PROTECTED]> wrote: > > I feel the following should work: > class Myform(forms.Form): > ...publ = forms.ChoiceField(label='Publisher', required=False) > > and then in handler I should be able to set the choices dynamically > by: > > def meth(request): > ...frm=Myform(initia

Re: ValueError: Empty module name

2007-02-17 Thread cory
Ah-ha! I think I've found the issue. The problem was coming from the template context loader I was using. Or rather, how that was set in the settings.py file. I only had one template context loader set, and forgot to include a trailing comma so that it could be processed as a tuple instead of a s

Re: newforms select field

2007-02-17 Thread Arnaud Delobelle
On Feb 17, 7:05 pm, "paulh" <[EMAIL PROTECTED]> wrote: > I feel the following should work: > class Myform(forms.Form): > ...publ = forms.ChoiceField(label='Publisher', required=False) > > and then in handler I should be able to set the choices dynamically > by: > > def meth(request): > ...frm=My

ManyToManyField does not allow empty relations

2007-02-17 Thread akonsu
Hello, i have set A that has many-to-many relationship with set B currently admin interface (at least) forces me to select at least one object from B if i add an object to A and the other way around. i do not want that. i want to add an object to A which has no related objects in B. i need to h

Re: ManyToManyField does not allow empty relations

2007-02-17 Thread Malcolm Tredinnick
On Sun, 2007-02-18 at 01:09 +, akonsu wrote: > Hello, > > i have set A that has many-to-many relationship with set B > > currently admin interface (at least) forces me to select at least one > object from B if i add an object to A and the other way around. i do > not want that. i want to add

Re: "Best" way of using templates

2007-02-17 Thread Lachlan Cannon
Jonathan Ballet wrote: > I think, we might use the __str__() method, since it seems the > simplest and cleanest way of doing this (a title is a sort of > presentation in fact). Or maybe, we will stick with the get_title() > method (or something like that ...) Don't forget, either, that you can us

syncdb on linux problem

2007-02-17 Thread johnny
I have moved my folder from Windows to Linux. It works fine when I try "python manage.py syncdb" on windows, exact same project code, in linux is not working, when I do "python manage.py syncdb". This is driving me crazy. I am getting following errors: Error: Couldn't install apps, because the

Re: syncdb on linux problem

2007-02-17 Thread Todd O'Bryan
It could be as simple as a PythonPath problem. Have you tried running the offending code in the Python shell by using python manage.py shell to see if you can figure out what's going wrong? On Sat, 2007-02-17 at 19:24 -0800, johnny wrote: > I have moved my folder from Windows to Linux. It work

Re: Django over modpython

2007-02-17 Thread Scott Paul Robertson
On Sat, Feb 17, 2007 at 04:41:46PM -, akonsu wrote: > > www.prgmr.com seem to have affordable VPS hosting. but i agree, they > still offer less space and bandwidth than shared hosting. > www.slicehost.com has been treating me very well for VPS hosting. $20/month for 256 MB RAM, 10 GB disk, 1

Deployed url mapping

2007-02-17 Thread kbochert
On a deployed django site, what url does Django use when scanning urls.py when user browses to www.mysite.com ? When I access my (non-django) site with www.mysite.com my host serves up the file that i see as html/index.html If the polls tutorial is deployed to my host, does the mapping in

Re: passing parameters to a method from a template

2007-02-17 Thread Russell Keith-Magee
On 2/18/07, omat * gezgin.com <[EMAIL PROTECTED]> wrote: > > I couldn't find any reference on passing parameters to a view method > from within a template. All I could find are some examples of passing > a single parameter to filter functions like: > > {{ pub_date|date:"F j, Y" }} > > > Is there a

Re: Deployed url mapping

2007-02-17 Thread Malcolm Tredinnick
On Sat, 2007-02-17 at 20:51 -0800, kbochert wrote: > On a deployed django site, what url does Django use when scanning > urls.py when user browses to www.mysite.com ? > > > When I access my (non-django) site with > www.mysite.com > my host serves up the file that i see as html/index.html On

Re: Django and Eclipse Autocomplete NOT WORKING

2007-02-17 Thread Igor Guerrero
Apparently is a random error, I use the svn version, and with one project it works and with another don't, maybe is a PyDEV bug, but I don't know. On 2/15/07, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > > > Igor Guerrero wrote: > > > You must add the app dir and django dir to the PYTHON_PATH en

Re: Deployed url mapping

2007-02-17 Thread kbochert
On Feb 17, 11:04 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-02-17 at 20:51 -0800, kbochert wrote: > > On a deployed django site, what url does Django use when scanning > > urls.py when user browses towww.mysite.com ? > > > When I access my (non-django) site with > > www.my

Re: passing parameters to a method from a template

2007-02-17 Thread omat * gezgin.com
Thanks for the clarification. I totally agree with your points on good design. I was just curios... mat On Feb 18, 8:33 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 2/18/07, omat * gezgin.com <[EMAIL PROTECTED]> wrote: > > > > > I couldn't find any reference on passing parameters t