Re: Context processor a bit too helpful

2008-01-07 Thread Michael Hipp
Simon Willison wrote: > On Jan 8, 6:47 am, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Learning about context processors, I have one like this: >> >> def bold_word(request): >> html = "A bold word." >> return {'bold_word': html,} >> >> I expected a *bold* word to show up in the browser, b

Re: Context processor a bit too helpful

2008-01-07 Thread Simon Willison
On Jan 8, 6:47 am, Michael Hipp <[EMAIL PROTECTED]> wrote: > Learning about context processors, I have one like this: > > def bold_word(request): > html = "A bold word." > return {'bold_word': html,} > > I expected a *bold* word to show up in the browser, but instead here's > what is sen

Context processor a bit too helpful

2008-01-07 Thread Michael Hipp
Learning about context processors, I have one like this: def bold_word(request): html = "A bold word." return {'bold_word': html,} I expected a *bold* word to show up in the browser, but instead here's what is sent: A bold word. So the angle brackets show up (literally) in

Re: using re.sub with unicode string in response middleware

2008-01-07 Thread Gary Wilson Jr.
Malcolm Tredinnick wrote: > On Mon, 2008-01-07 at 18:28 -0600, Gary Wilson Jr. wrote: >> Malcolm Tredinnick wrote: >>> On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote: It appears that at this point, response.content is a utf8-encoded bytestring. I'm playing with a response

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Michael Hipp
Michael Hipp wrote: > Hello, > > I'm hoping to rework my website into Django, but am having trouble at my > shared hosting provider (HostMonster). > > They don't support mod_python, so Hostmonster said to add this to .htaccess > for FastCGI: > >AddHandler fcgid-script .fcgi > > I did tha

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Michael Hipp
That worked! Thank you! Thank you all! Michael Muchanic wrote: > Try adding the .egg to sys.path explicitly, i.e. > > sys.path.insert(0, "/home/redmulec/python/flup-1.0-py2.4.egg") --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: CSS Issues

2008-01-07 Thread pacman
Thanks for you help everyone I finally figured it out. I created another virtual host to serve my media and it worked. Looks like this: ServerAdmin [EMAIL PROTECTED] ServerName media.abc.net DocumentRoot /srv/django_site/media/ Options None AllowOverride None

Php,Css, Html in dreamweaver

2008-01-07 Thread hari
This IS the Best EBook for learning PHP, CSS and HTML. http://www.ziddu.com/download.php?uid=ZbGclJqoZLCh4palY7KWlJWiY66bnJs%3D3 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Muchanic
Try adding the .egg to sys.path explicitly, i.e. sys.path.insert(0, "/home/redmulec/python/flup-1.0-py2.4.egg") On Jan 8, 6:51 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > On Jan 8, 2:29 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > >> Does any of that offer any clu

Re: Middleware for checking client info and many other queries

2008-01-07 Thread Kenneth Gonsalves
On 08-Jan-08, at 11:05 AM, Ravi Kumar wrote: > 3. I was reading some pros-cons about Django. I came to know Django > has a memory problem in deployment environment, leaked memory. I > also read many articles regarding how to prevent such leakage and > hogging where did you hear this? It i

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Michael Hipp
Graham Dumpleton wrote: > On Jan 8, 2:29 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: >> Does any of that offer any clues? > > Not really. You really need to do what Milan said back at the > beginning. See if you can get the actual error messages logged in the > Apache error log files for the req

Middleware for checking client info and many other queries

2008-01-07 Thread Ravi Kumar
Hi, This is my First post to the group. I started devotion to Python recently, and now I have to implement Django (which came out to be something I was needing as framework). Familiar with Django basics and some core features, I am still looking for some knwoledge base for certain issues. 1. I nee

Re: Adding a request.user to a ModelForm instance

2008-01-07 Thread Brian Rosner
On 2008-01-07 19:03:21 -0700, Car <[EMAIL PROTECTED]> said: > > Hello > > I have following code; > > class PlaceForm(ModelForm): > class Meta: > model = Place > exclude = ('useradd',) #excluded, because form shouldn't give > a way to set user manually > > Model Place has o

Re: Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread Graham Dumpleton
On Jan 8, 8:50 am, ryan k <[EMAIL PROTECTED]> wrote: > I used svn propset svn:external so my project (in transition to > another developer when I return to college) can easily use the most > recent version fo Django (and comment_utils, etc). How can I ensure > that the project uses that django mod

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Graham Dumpleton
On Jan 8, 2:29 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > >>RewriteRule ^djangosite/(.*)$ mysite.fcgi/$1 [QSA,L] > > >> would only use the fcgi stuff on the urls that resolved to the > >> djangosite directory??? > > > You cannot read the RewriteRule in isolation, t

Re: Shared hosting with FastCGI, problems

2008-01-07 Thread Michael Hipp
Graham Dumpleton wrote: >>RewriteRule ^djangosite/(.*)$ mysite.fcgi/$1 [QSA,L] >> >> would only use the fcgi stuff on the urls that resolved to the >> djangosite directory??? > > You cannot read the RewriteRule in isolation, the RewriteCond on the > line before must be taken into consideratio

Re: Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread ryan k
Ok thank you for your responses. I would try this out but not at the office now... what about __init__.py in the project's root directory? Right now I am trying this all on the Django development server. So let's say on my production server I have /home/ryan/projects/llcom/ trunk/lib (all svn:exte

Re: Adding a request.user to a ModelForm instance

2008-01-07 Thread David Grant
This might be a stupid question, but is request.user set to None? On Jan 7, 2008 6:03 PM, Car <[EMAIL PROTECTED]> wrote: > > Hello > > I have following code; > > class PlaceForm(ModelForm): >class Meta: >model = Place >exclude = ('useradd',) #excluded, because form shouldn't

Re: Adding a request.user to a ModelForm instance

2008-01-07 Thread Car
I've tried different aproach with overriding default save method - hacking shourtcuts wasn't the best idea. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: Calling a method from the base template

2008-01-07 Thread Malcolm Tredinnick
On Mon, 2008-01-07 at 20:28 -0600, Michael Hipp wrote: [...] > Is it really necessary to complicate every 'view' method by appending > 'context_instance=RequestContext(request)' to the render_to_response > call? This seems totally boilerplate and a violation of DRY. Write your own shortcut fun

Re: Django on MediaTemple (dv) howto?

2008-01-07 Thread Josh Ourisman
It's probably worth noting that when I run the site off the development server it has no problems whatsoever. It seem to me that this mean the problem _must_ be something to do with the vhosts.conf file, yes? On Jan 5, 7:01 pm, Josh Ourisman <[EMAIL PROTECTED]> wrote: > Ok, Django is installed an

Re: Calling a method from the base template

2008-01-07 Thread Michael Hipp
Peter Rowell wrote: >> There is a mechanism available >> for that -- context processors -- but people don't want to use it >> because they want *something else* that happens for every template. > > Malcolm's absolutely correct: context processors (I mis-typed when I > said content processors) is

Re: Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread Peter Rowell
On Jan 7, 4:42 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Putting that in settings.py is too late, since by the thing that reads > settings.py is Django itself, so it's already been imported. You have to > modify your Python import path *before* anything Django-related is > imported. He'

Adding a request.user to a ModelForm instance

2008-01-07 Thread Car
Hello I have following code; class PlaceForm(ModelForm): class Meta: model = Place exclude = ('useradd',) #excluded, because form shouldn't give a way to set user manually Model Place has one foreign key to django User model (useradd) Is it possible to add field formerly ex

Re: Context Processors: {{ MEDIA_URL }} not available in templates

2008-01-07 Thread Ben Stahl
UPDATE: OK, I installed the trunk version and it worked right away, so I guess 0.96 does not support the media context processor. Thanks again for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Newbie: Big problem or little problem?

2008-01-07 Thread rob_mazur
Another data point is that I still error in the interpreter (see below). Using "which python" I can see I am using the newly compiled version of python, which has the MySQLdb module installed. It appears I still have something fouled up? Rob -- [EMAIL PROTECTED]:~/home/m

Re: Newbie: Big problem or little problem?

2008-01-07 Thread rob_mazur
Thanks for your help, Gang. I have it working (though I still have a question below). I actually did see the error regarding the MySQLdb module, but I thought, "OK, I can fix that later, but what are these other errors?" I did not think they were related. So I then ran into this error: File

Re: using re.sub with unicode string in response middleware

2008-01-07 Thread Malcolm Tredinnick
On Mon, 2008-01-07 at 18:28 -0600, Gary Wilson Jr. wrote: > Malcolm Tredinnick wrote: > > On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote: > >> It appears that at this point, response.content is a utf8-encoded > >> bytestring. > >> I'm playing with a response middleware doing something

Re: Error: (1241, 'Operand should contain 1 column(s)')

2008-01-07 Thread Rodrigo Culagovski
Malcolm, you're right, of course. That did the trick! Thanks, Rodrigo On Jan 7, 9:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-01-06 at 17:24 -0800, Rodrigo Culagovski wrote: > > I am getting the following error: > > > OperationalError at /lista/ > > (1241, 'Operand shou

Re: syncdb fail. mysql.base?

2008-01-07 Thread Malcolm Tredinnick
On Mon, 2008-01-07 at 15:03 -0800, [EMAIL PROTECTED] wrote: > Grabbing the 1.2.1_p2 version of MySQLdb, these are the kinds of > errors I get in building > > # python setup.py build > > running build > running build_py > creating build > creating build/lib.linux-x86_64-2.4 > copying _mysql_

Re: Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread Malcolm Tredinnick
On Mon, 2008-01-07 at 13:50 -0800, ryan k wrote: > I used svn propset svn:external so my project (in transition to > another developer when I return to college) can easily use the most > recent version fo Django (and comment_utils, etc). How can I ensure > that the project uses that django module

Re: using re.sub with unicode string in response middleware

2008-01-07 Thread Gary Wilson Jr.
Malcolm Tredinnick wrote: > On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote: >> It appears that at this point, response.content is a utf8-encoded bytestring. >> I'm playing with a response middleware doing something like: >> >> MY_RE.sub(u'%s' % text, response.content) >> >> which raises

Re: Error: (1241, 'Operand should contain 1 column(s)')

2008-01-07 Thread Malcolm Tredinnick
On Sun, 2008-01-06 at 17:24 -0800, Rodrigo Culagovski wrote: > I am getting the following error: > > OperationalError at /lista/ > (1241, 'Operand should contain 1 column(s)') > Request Method: POST > Request URL: http://127.0.0.1:8000/lista/ > Exception Type: OperationalError > Exc

Re: Context Processors: {{ MEDIA_URL }} not available in templates

2008-01-07 Thread Ben Stahl
On Jan 4, 9:43 pm, Peter Rowell <[EMAIL PROTECTED]> wrote: > > Well, if I can't get this working I suppose I can just stuff the > > settings.MEDIA_URL variable into each template render by placing it > > into the render dictionary myself each time. > > Nah, don't do that. > > I think your probl

Re: Setup Help

2008-01-07 Thread kbochert
After much effort, things have progressed to my trying 'python load_data.py' I get an error: "Can't connect to local MySQL server through socket /var/lib/mysql/ mysql.sock" Thinking that the default setting of DATABASE_HOST = "" might be wrong, I asked the host (OCSSolutions) where their database

Re: syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
Grabbing the 1.2.1_p2 version of MySQLdb, these are the kinds of errors I get in building # python setup.py build running build running build_py creating build creating build/lib.linux-x86_64-2.4 copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.4 creating build/lib.linux-x86_64-2.4/M

Re: Query How To

2008-01-07 Thread [EMAIL PROTECTED]
Something like this should return an iterable list of UserSong records for user U >>> list = UserSong.objects.filter( user=U ) Then you can iterate over it or pass that list to a template that iterates over it >>> for song in list: >>>doSomething Look here for more http://www.djangoproject.

Query How To

2008-01-07 Thread Darthmahon
Hey, My ongoing quest to get a basic app working will hopefully be answered by this question :) I have the following model.py file: File: model.py == from django.db import models from django.contrib.auth.models import User class Song(models.Model): titl

Re: syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
To get the trunk, I ran: # svn co http://code.djangoproject.com/svn/django/trunk/ # cd trunk # python setup.py install On Jan 7, 2:43 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Its very strange if you had svn trunk version. Line that importsbackendmust > behttp://code.djangoproject.com/bro

Re: syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
That second error is from the 0.96 version. On Jan 7, 2:43 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Its very strange if you had svn trunk version. Line that importsbackendmust > behttp://code.djangoproject.com/browser/django/trunk/django/db/__init__... > but you havebackend= __import__('%s

Re: syncdb fail. mysql.base?

2008-01-07 Thread Alex Koshelev
Its very strange if you had svn trunk version. Line that imports backend must be http://code.djangoproject.com/browser/django/trunk/django/db/__init__.py#L17 but you have backend = __import__('%s.base' % settings.DATABASE_ENGINE, {}, {}, On 8 янв, 01:29, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wr

Re: syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
Uninstalled svn release, installed 0.96 from the tarball, retried the syncdb and got this error python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1672

Re: syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
I did a recent svn checkout. Perhaps I should uninstall and try a stable release On Jan 7, 2:18 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > mysql.base is internal django module that wraps work with MySQL > backend. So you have to check your django installation I think. > And that version of

Re: syncdb fail. mysql.base?

2008-01-07 Thread Alex Koshelev
mysql.base is internal django module that wraps work with MySQL backend. So you have to check your django installation I think. And that version of django do you use? On 7 янв, 23:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I think I have MySQL and MySQLdb installed properly. Both of the

Re: Passing data when using render_to_response

2008-01-07 Thread Doug B
On Jan 7, 3:05 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi Doug, > > Returning the songs function results worked a treat. I'm looking into > the generic views part of Django at the moment as it seems to be what > I want or is it ok for me to do as you suggested above? I haven't used generic vi

Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread ryan k
I used svn propset svn:external so my project (in transition to another developer when I return to college) can easily use the most recent version fo Django (and comment_utils, etc). How can I ensure that the project uses that django module instead of the one found on /.../python2.X/site-packages

Job: Django developer in central London

2008-01-07 Thread Simon Willison
Hi all, I'm consulting with GCap Media, who are looking to hire Django developers to work in central London. They've got a bunch of really interesting projects lined up and are building an excellent team. The job description is here: http://djangogigs.com/gigs/54/ If you have any questions abou

Re: Passing data when using render_to_response

2008-01-07 Thread Darthmahon
Hi Doug, Returning the songs function results worked a treat. I'm looking into the generic views part of Django at the moment as it seems to be what I want or is it ok for me to do as you suggested above? Cheers, Chris On Jan 7, 8:48 pm, Doug B <[EMAIL PROTECTED]> wrote: > Couldn't you get what

Re: Passing data when using render_to_response

2008-01-07 Thread Doug B
Couldn't you get what you are looking for by just returning the songs function results? The view are just python functions, so you can return a view from a view. If things get to0 confusing that way, making one or more helper functions shared between different views is another option. def add(r

Passing data when using render_to_response

2008-01-07 Thread Darthmahon
Hi All, Got a quick question for you. I have a page that lists songs. Each song has a link that allows a user to add it to their songs list. Here is the views.py file: def songs(request): songs_listing = [] for songs_list in Song.objects.all(): songs_dict = {}

syncdb fail. mysql.base?

2008-01-07 Thread [EMAIL PROTECTED]
I think I have MySQL and MySQLdb installed properly. Both of these imports work >>> import _mysql >>> import MySQLdb I am running on a Ubuntu 6.06 system with a svn checkout of Django from yesterday. There is a problem I don't recognize when I try to run syncdb. What is mysql.base? # python man

Re: Newbie: Big problem or little problem?

2008-01-07 Thread [EMAIL PROTECTED]
go into a python prompt and run: >>> import MySQLdb If it works, then your backend database is installed properly. If not, you need to do more to get the DB configured. http://www.djangoproject.com/documentation/install/#get-your-database-running Ivan On Jan 7, 12:02 pm, rob_mazur <[EMAIL PROT

Re: Newbie: Big problem or little problem?

2008-01-07 Thread Tim Riley
If you are going to use a mysql database you need the mysqldb python package installed. http://sourceforge.net/projects/mysql-python On Jan 7, 2008 3:02 PM, rob_mazur <[EMAIL PROTECTED]> wrote: > > I just installed Django 0.96 (Python 2.4.1) and am running through the > tutorial at Django's site

Re: Newbie: Big problem or little problem?

2008-01-07 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 7 Jan 2008 12:02:51 -0800 (PST) rob_mazur <[EMAIL PROTECTED]> wrote: > > I just installed Django 0.96 (Python 2.4.1) and am running through the > tutorial at Django's site. I can run "import django" at the > interactive interpreter. But whe

Newbie: Big problem or little problem?

2008-01-07 Thread rob_mazur
I just installed Django 0.96 (Python 2.4.1) and am running through the tutorial at Django's site. I can run "import django" at the interactive interpreter. But when launching the integrated webserver and viewing http://127.0.0.1:8000/ I get the error list below. Can someone have a quick look, j

Re: A Django Community - djangojunkies.net

2008-01-07 Thread Placid
On Jan 7, 3:58 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > My thoughts are: have you contacted the people behind either of the > sites you mentioned, to see if they have existing plans for future > expansion? I'd hate to see multiple sites go to all the trouble of > building an "all-in-one"

PostgreSQL Conference East: Call for Papers

2008-01-07 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 PostgreSQL Conference East is being held on the weekend of March 29th and 30th, 2008 in College Park, Maryland. The conference will have a series of talks, mini-tutorials and tutorials and we are now accepting submissions! If you are a third pary vend

MySQLdb issues on MediaTemple (dv) server

2008-01-07 Thread Josh Ourisman
Looks like I'm having some problems with my MySQLdb install. To install, I downloaded the tarball, &c.,and ran the installer script, but it doesn't actually seem to work. From the errors I'm getting it seems to be an issue with the way it actually installed. Here's what I get if I go into the Pyth

Re: Syndication is generating bad url

2008-01-07 Thread RevMatt
Figured it out myself. In my django admin I had not properly set the Site information when I went from the development server to the live server. On Jan 7, 10:57 am, RevMatt <[EMAIL PROTECTED]> wrote: > I'm launching my first django site and am having an odd problem with > syndication (I'm sure

Re: Passing a form via a generic view

2008-01-07 Thread Rodrigo Culagovski
Ramiro, got it, thanks! Rodrigo On Jan 7, 3:20 pm, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > Rodrigo, > > On Jan 7, 2008 4:05 PM, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > > > [...] > > > Since this parameter is not passed from the generic view, the form > > doesn't show. The form is

Re: Django Book: The Django Administration Site

2008-01-07 Thread Ramiro Morales
On Jan 7, 2008 12:40 AM, Mikey3D <[EMAIL PROTECTED]> wrote: > > Thank you so much it works. :-) One question, why is that I have Auth > and Sites are showing up when my "class Admin: pass" were wrong way of > coding still works? > Because these are different apps? and they have their Admin inner

Re: Passing a form via a generic view

2008-01-07 Thread Ramiro Morales
Rodrigo, On Jan 7, 2008 4:05 PM, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > [...] > > Since this parameter is not passed from the generic view, the form > doesn't show. The form is defined in views.py and works for my other, > non-generic views. Is there a way to pass the form via a generic

Re: CSS Issues

2008-01-07 Thread pacman
Ok I tried the sym link method and that doesn't seem to work. Grady, what are you referencing from the documentation? Are you referring to the tags? If so I have those tossed within the virtualhost tag. Should I make those global and not within a virtual host tag? On Jan 7, 4:51 am, Collin Grady

Re: Basic Form Design Question: Pulling as much as possible from models

2008-01-07 Thread Simon Willison
On Jan 7, 5:07 pm, Wes Winham <[EMAIL PROTECTED]> wrote: > http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ > > A shiny solution to the problem with code and the reasoning behind it. > Simon Willison is awesome. It's Malcolm that's awesome, I just link to his stuff! Cheers,

Passing a form via a generic view

2008-01-07 Thread Rodrigo Culagovski
I am using a generic view to view an individual item ('articulo') like so: urlpatterns = patterns('', (r'^articulos/(?P\d+)/$', list_detail.object_detail, articulo_detail_info) The 'articulo_detail.html' template imports a "base.html" template, which expects a 'form' parameter, like so:

Re: Simple architecture question

2008-01-07 Thread iamelgringo
It's not repeating yourself if the admin/auth interface isn't giving you what you need. On Jan 6, 4:30 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-01-06 at 15:51 -0800, Pete McVicar wrote: > > [...] > > > Because Django already has the concept of groups/permission my > > imme

Re: Django Book: The Django Administration Site

2008-01-07 Thread iamelgringo
The book is online if you want to copy/paste code: http://www.djangobook.com/en/1.0/chapter06/ Good luck and no problem. On Jan 6, 6:40 pm, Mikey3D <[EMAIL PROTECTED]> wrote: > Hi Elgringo, > > Thank you so much it works. :-) One question, why is that I have Auth > and Sites are showing up whe

Re: Basic Form Design Question: Pulling as much as possible from models

2008-01-07 Thread Wes Winham
http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ A shiny solution to the problem with code and the reasoning behind it. Simon Willison is awesome. On Jan 4, 1:03 pm, Wes Winham <[EMAIL PROTECTED]> wrote: > Thanks Malcom. That reassured me greatly. I didn't think of the cleve

Syndication is generating bad url

2008-01-07 Thread RevMatt
I'm launching my first django site and am having an odd problem with syndication (I'm sure there are more problems, but that's what I'm hitting right now): the rss file is spitting out the links as "http://example.com[path]"; rather than "http://mydomain.com/[path]";. Here's my model: from djan

Re: how to restrict username length must more than 5 words

2008-01-07 Thread Peter Rowell
> i user django-register in my project,it is fatastic, but how to: > 1. restrict username length must more than 5 words > 2. make sure email is unique. Good question. I don't recommend our short-term solution--modify the contrib/auth code--but it was the only way I could figure out how to do it a

Re: A Django Community - djangojunkies.net

2008-01-07 Thread Marty Alchin
On Jan 7, 2008 9:39 AM, Placid <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm a huge fan of Django. Let's face it, coding a Django site is just > plain fun. And I've only just scratched the surface of what it's > capable of. One of the things I've missed with Django is that I > doesn't seem to ha

Re: Dynamic forms fields

2008-01-07 Thread [EMAIL PROTECTED]
Thanks a lot. On Jan 7, 1:19 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > The number of features can grow or decrease depending on the user type > > so I can't create a static form class with all the features listed. > > > Can someone please help to do this. > > Sur

Re: How to refer to a class defined later in the file

2008-01-07 Thread [EMAIL PROTECTED]
On Jan 7, 2:59 pm, shabda <[EMAIL PROTECTED]> wrote: > I want to have a models.py like this, > > class PageRevision(models.Model): > """Stores a specific revision of the page""" > text = models.TextField() > revision_for = models.ForeignKey(Page, related_name = > 'revision_for') > > cl

A Django Community - djangojunkies.net

2008-01-07 Thread Placid
Hello all, I'm a huge fan of Django. Let's face it, coding a Django site is just plain fun. And I've only just scratched the surface of what it's capable of. One of the things I've missed with Django is that I doesn't seem to have much of a community past #django on irc.freenode.net and sites suc

Re: How to refer to a class defined later in the file

2008-01-07 Thread James Bennett
On Jan 7, 2008 7:59 AM, shabda <[EMAIL PROTECTED]> wrote: > This line gives me an error, > revision_for = models.ForeignKey(Page, related_name = 'revision_for') > as NameError: name 'Page' is not defined, obviously because page is > defined later in the file. I can not put PageRevision later as Pa

How to refer to a class defined later in the file

2008-01-07 Thread shabda
I want to have a models.py like this, class PageRevision(models.Model): """Stores a specific revision of the page""" text = models.TextField() revision_for = models.ForeignKey(Page, related_name = 'revision_for') class Page(models.Model): """Stores the latest page, the page which

how to restrict username length must more than 5 words

2008-01-07 Thread [EMAIL PROTECTED]
i user django-register in my project,it is fatastic, but how to: 1. restrict username length must more than 5 words 2. make sure email is unique. thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Should logic appear in views.py

2008-01-07 Thread Tim Chase
> Does the function operate on a single model? Will it be run when you > already have the instance of the model? To add to Collin's comment, it doesn't even have to operate on a single model. It simply has to be a property of the model itself. Thus, it would make sense to have something like

Re: Should logic appear in views.py

2008-01-07 Thread Darthmahon
Thanks for the replies. Makes sense. The only reason I asked was because from my PHP MVC experience, all logic went into the C which itself referenced the M when it wanted to interact with the databse (such as inserting into a table). But what appears to be the case here is that the Model should

Re: urlField Broken ever

2008-01-07 Thread zodman
im run a develop server ( python manage.py runserver ) on my deploy server and the urlfield function good .. on mod_python with apache not validate my url ? im confused. On Jan 6, 10:28 pm, zodman <[EMAIL PROTECTED]> wrote: > 0.97-pre-SVN-unknown rev 7003 > > i have a proble with de urlfield

Re: Getting specific related objects via URL variable

2008-01-07 Thread Emil
Thanks alex, I think I'll leave it as-is for now, just getting my teeth cut on writing some simple template tags of my own but I haven't quite figured it all out yet. I'm so glad this list exists though. :-) //emil On 4 Jan, 23:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How about a tem

Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Alex Koshelev
It depends on concrete design decisions. Form wide initial data have higher priority then the field's initial data. But if I don't want init some field every time at form instance creation time I can pass callable object to field declaration. On 7 янв, 12:59, Collin Grady <[EMAIL PROTECTED]> wrot

Re: Should logic appear in views.py

2008-01-07 Thread Alex Koshelev
When model method gets 'request' parameter its 99.99% ill-formed design of application. All request/response handling and most of business logic have to be in views.py or similar but not in models.py. On 7 янв, 12:38, Darthmahon <[EMAIL PROTECTED]> wrote: > Hey, > > I've just started working on m

Forms and non-editable fields

2008-01-07 Thread Matt Hoskins
I'm fairly new to django and am just starting to play with it as a framework for web-based applications. The kinds of applications I develop typically have some fields for entities that are non-editable, with some of these being non-editable only some of the time (depending on things like entity s

Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Collin Grady
It doesn't have to be a callable, you just need to use the FORM's initial arg, as Malcolm was initially referring to, not the field's initial argument. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: XML Rendering. Template issue - sub cats

2008-01-07 Thread Collin Grady
Of course it's listing the same clients, you looked up the full list, instead of, say, using the relations to category to get only those clients which belong to that category :) If a client has an fkey to category, then you need to be doing something like {% for client in category.client_set.all

Re: Getting current user id

2008-01-07 Thread Alex Koshelev
obj.user_id = request.user.id # this is too really? On 7 янв, 12:55, Collin Grady <[EMAIL PROTECTED]> wrote: > On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > > > When I used request.user, it outputs the username of the currently > > logged in user. When I try and use this as part of

Re: Getting current user id

2008-01-07 Thread Collin Grady
On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > When I used request.user, it outputs the username of the currently > logged in user. When I try and use this as part of the entry into the > table, it won't let me as it's expecting an integer. You are mistaken. When /printing/ the user o

Re: CSS Issues

2008-01-07 Thread Collin Grady
As zodman is getting at, django does not map your media for you - you have to do that. http://www.djangoproject.com/documentation/modpython/#serving-media-files --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Should logic appear in views.py

2008-01-07 Thread Collin Grady
It depends a lot on the use case. Does the function operate on a single model? Will it be run when you already have the instance of the model? If so, it may be a good case for a model function, since it will already have access to the object it's a part of. General purpose helpers can go in view

Should logic appear in views.py

2008-01-07 Thread Darthmahon
Hey, I've just started working on my project but before getting too far down the line I wanted to ask the opinion of people on here. I've seen some code examples that show functions within the models.py file like so: from django.db import models class SaveArticle(model

Re: How do I connect to development server with my browser?

2008-01-07 Thread zodman
python manage.py runserver 0.0.0.0:8000 give someone your ip on port 8000 :) Jeff Anderson escribió: > Keith wrote: >> Is there a way to >> connect with the development server remotely > Absolutely! > By default the development server --only-- runs on localhost. If you > want to make it access