Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread Phillip Parrin
Hi James, I'm also looking for the books source code, any chance you could put it up somewhere? Mainly i'm looking for the "advanced" templates you talk about in the book, it's covered in the weblog section. I also found a few typo's in the code examples, do you have a specific page for this? A

Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread Phillip Parrin
Hey James, Seems like my first post, did not get posted at all.. I'm also looking for the souce code, mainly i'm looking for the advanced templates you mention when building the weblog. Did you get the chance to finish the source? I also found a few typo's in the book, do you have a specific pa

Re: Django vs. Kohana

2008-07-17 Thread Oscar Carlsson
I've never used Kohana (or CodeIgniter), but I've used both PHP and Python - and even if Kohana is a really nice framework, Python is still a great advantage. Python is very friendly. And Django (totally) kicks ass :-) Oscar 2008/7/17 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > > Henrik Bechman

Re: how to set CharField default value to logged in admin user?

2008-07-17 Thread etng
I don't think you can do that in you feild define phrase.. but you can use the pre_save hook to auto populate it with the current logged user's name.Try to find the threadlocal middle ware,it can help you to handle it! - Best regards, etng [EMAIL PROTECTED] http://www.etng.net/blog On Thu, J

Re: [i18n] How to switch/force a language from inside a usual view function?

2008-07-17 Thread Valery Khamenya
Hi Malcolm, thanks for your reply. Neither activate('de') nor translation.activate('de') have been accepted by Python from inside my view function -- some import needed? Anyway, both calls look for me rather like application-wide "side-effects" -- what do you think? Ideally, I'd like to apply

Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread James Bennett
On Thu, Jul 17, 2008 at 2:14 AM, Phillip Parrin <[EMAIL PROTECTED]> wrote: > I'm also looking for the souce code, mainly i'm looking for the > advanced templates you mention when building the weblog. Did you get > the chance to finish the source? I'm tracking down one other reported issue which -

Re: Django vs. Kohana

2008-07-17 Thread James Bennett
On Wed, Jul 16, 2008 at 6:05 PM, Henrik Bechmann <[EMAIL PROTECTED]> wrote: > Can anyone with experience or knowledge of both Django and Kohana (PHP > framework, son of CodeIgniter) list contexts in which each would be > most appropriate? I'm in a selection process right now with both on > the sho

Re: Need help in using ComboField for Forms

2008-07-17 Thread Arien
On Thu, Jul 17, 2008 at 1:57 AM, Kadusale, Myles <[EMAIL PROTECTED]> wrote: > Can anybody help me by sending snippets of code on using ComboField in > forms? Something like this from the regression tests? http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/fields.py?rev

Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread Phillip Parrin
I don't think the templates for the weblog(coltrane) app are in the book... atleast not where they should be, in the chapter covering it the templates i'm talking about are: entry_archive.html entry_archive_year.html entry_archve_month.html entry_archive_day.html and i think this is the same

Field representation in n-f-admin

2008-07-17 Thread Alex Rades
Hi, I have a field (a XMLField) which I'd like to format somehow before presenting it into the admin change_list page. How do i alter the string representation of a field in django? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: request getlist() in order?

2008-07-17 Thread Arien
On Wed, Jul 16, 2008 at 7:29 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > > If I have a form like the example: > > > > >The Beatles >The Who >The Zombies > > > > > And I call request.POST.getlist('bands'), is the order of the bands > going to always be the same as provided in the

Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread Johan Liseborn
On Thu, Jul 17, 2008 at 09:56, Phillip Parrin <[EMAIL PROTECTED]> wrote: > > I don't think the templates for the weblog(coltrane) app are in the > book... atleast not where they should be, in the chapter covering > it > the templates i'm talking about are: > > entry_archive.html > entry_archiv

Problem testing ModelChoiceField in form

2008-07-17 Thread Florencio Cano
Hi! When I try to test a post to a form that have a ModelChoiceField form I get always a form error in that field "Select a valid choice". The form is this: class OperacionForm(forms.Form): ticker = forms.ModelChoiceField(Valor.objects.all()) fecha = forms.DateField(widget=SelectD

Re: single list items in templates

2008-07-17 Thread Ronny Haryanto
On Thu, Jul 17, 2008 at 2:03 AM, Tim Chase <[EMAIL PROTECTED]> wrote: > >> I have a list: data = ['apple', 'orange', 'banana'] >> in my template: {{ data }} will output: ['apple', orange, banana] >> but {{ data[0] }} will throw an error > > > {{ data.0 }} should do the trick. Or {{ data|first }}.

Django on Windows Mobile 6 (Standard)

2008-07-17 Thread warsng
After taking a look at the blogpost where someone got django running on WM, i thought i would give it a try. however, i am not having much success. Has anyone got this working recently? I am not using Pocket PC unlike the blog author, I am using Windows Mobile 6 Standard, i.e. non-touch-screen. -

Adding and removing template dirs on the fly

2008-07-17 Thread 3xM
Is there a "right" way to add and remove directories to TEMPLATE_DIRS on the fly? Is it right to do at all? I tried to just add a directory, but realized that the settings are not per request, but per server thread, so that a directory added by one request is also there for the next request, whic

Re: Adding and removing template dirs on the fly

2008-07-17 Thread Arien
On Thu, Jul 17, 2008 at 6:23 AM, 3xM <[EMAIL PROTECTED]> wrote: [...] > I am making a generic system for generating some playlists. Playlists > for most channels look exactly the same, but some has small > differences in how it should appear (e.g. they should not include a > thumbnail for the vide

newforms and commit=False

2008-07-17 Thread Ian Lawrence
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I wondered if someone has an about this?. I take an uploaded zip/tarball and bind it to a model form. I then extract it to a temporary folder and use this as a resources folder when I compile a flash movie. If the contents of the flash movie are o

Django installation issue

2008-07-17 Thread zbiju
Hi guys, I'm noobie with python and django but I would like to try it. I have installed it as docs say but I have problem running it. I'm getting error: "Error while importing URLconf 'pyta.urls': No module named core.handlers.wsgi" which is a bit weird because in bootstrap file it seems to load

Customising admin change_list_results.html template

2008-07-17 Thread Ayaz Ahmed Khan
Is it possible to have a customised `change_list_results.html` in one's TEMPLATE_DIR/admin/app_label/model/ directory? I've it along with change_list.html, and while changes made to change_list are picked up, those made to change_list_results aren't appearing. I may be doing it wrong, I am not s

how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Andre Meyer
hi all imagine you have a first model class and a second model class with a ForeignKey referring to the first one. for example, a Post model (taken from the tutorial blog app) and a Comment model. of course, a post can have multiple comments, so the Post model gets an attribute 'comments' (specifi

Re: accessing an attribute for the first item in a template context

2008-07-17 Thread Tim Chase
>> example, I can do: >> >> {% for s in objectlist %} >> User name is: {{s.user_name}} >> {% endfor %} >> >> But, I can't do this: >> User name is: {{ objectlist.0.user_name }} What is "objectlist"? is it a list() or an iterable? It may be trying to index into an iterable. Thus you can eith

Re: Customising admin change_list_results.html template

2008-07-17 Thread Ayaz Ahmed Khan
On Jul 17, 5:17 pm, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > > Is it possible to have a customised `change_list_results.html` in > one's TEMPLATE_DIR/admin/app_label/model/ directory?  I've it along > with change_list.html, and while changes made to change_list are > picked up, those made to c

i18n: How to the language on per-user basis

2008-07-17 Thread Torsten Bronger
Hallöchen! In my Web application, every user has to log in. In an additional user database table, the prefered language of each user is given. But how do I activate it? I use django.contrib.auth.views.login for the login. However, as far as I can see, I have to copy-and-paste this function and

Re: Django on Windows Mobile 6 (Standard)

2008-07-17 Thread Russell Keith-Magee
On Thu, Jul 17, 2008 at 7:04 PM, warsng <[EMAIL PROTECTED]> wrote: > > After taking a look at the blogpost where someone got django running > on WM, i thought i would give it a try. however, i am not having much > success. Has anyone got this working recently? I am not using Pocket > PC unlike the

Re: Adding and removing template dirs on the fly

2008-07-17 Thread 3xM
On Jul 17, 1:59 pm, Arien <[EMAIL PROTECTED]> wrote: > Have you seen the section on loading templates in the documentation? > It contains a tip that describes how you can use select_template to > nicely deal with this type of situation Thanks for the fast reply. I Don't see how this would hel

Re: Django on Windows Mobile 6 (Standard)

2008-07-17 Thread warsng
I have installed Python CE, but i am getting import errors - 'No module named django' I don't know which directory i am supposed to install django into, i have tried putting it in python25/Lib/site-packages as the windows version (i think?) im fumbling around in the dark here, as the version of

Re: i18n: How to the language on per-user basis

2008-07-17 Thread Rajesh Dhawan
Hi, > In my Web application, every user has to log in. In an additional > user database table, the prefered language of each user is given. > But how do I activate it? > > I use django.contrib.auth.views.login for the login. However, as > far as I can see, I have to copy-and-paste this function

Re: how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Rajesh Dhawan
On Jul 17, 8:32 am, "Andre Meyer" <[EMAIL PROTECTED]> wrote: > hi all > > imagine you have a first model class and a second model class with a > ForeignKey referring to the first one. for example, a Post model (taken from > the tutorial blog app) and a Comment model. of course, a post can have >

Re: Django on Windows Mobile 6 (Standard)

2008-07-17 Thread warsng
a glimmer of hope http://translate.google.co.uk/translate?hl=en&sl=ru&u=http://pyromann-dude.com/2008/01/15/django-on-asus-p535-under-windows-mobile-60/&sa=X&oi=translate&resnum=4&ct=result&prev=/search%3Fq%3Dpythonce%2Bdjango%26start%3D10%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-GB:

Countdown to 1.0 alpha

2008-07-17 Thread Dan
I was wondering when the 1.0alpha was due so I went to Trac and found this page: http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&milestone=1.0+alpha There is only 10 tickets left before alpha is complete. I don't know for you, but I'm going to check this page every

Re: newforms and commit=False

2008-07-17 Thread Rajesh Dhawan
Hi Ian, > I take an uploaded zip/tarball and bind it to a model form. I then > extract it to a temporary folder and use this as a resources folder > when I compile a flash movie. If the contents of the flash movie are > ok for the user i want to commit to the database and move on to some > furthe

Re: Django installation issue

2008-07-17 Thread James Matthews
I don't see much but it seems your aren't mapping you urls properly. Please post your urls.py on http://dpaste.com/ then email the link. On Thu, Jul 17, 2008 at 4:48 AM, zbiju <[EMAIL PROTECTED]> wrote: > > Hi guys, > > I'm noobie with python and django but I would like to try it. > I have instal

Re: How to switch/force a language from inside a usual view function?

2008-07-17 Thread Valery
Hi Malcolm, > It's not documented in thei18n.txt file (which needs a bit of a rewrite > and splitting up once the docs reorganisation lands in trunk), but have > a look at the activate() function in > django/utils/translation/trans_real.py. according to what is stated here: http://code.djangopro

Why 2 servers to serve dynamic and static content?

2008-07-17 Thread eka
Hi, I'm new to django, and reading around, found out that it's better to have 2 different web servers for django and static content. How is so? And in deployment, how should this be? I mean, should I have 2 apache instances? or use another web server for static content or...? Regards. Eka --~-

Re: Countdown to 1.0 alpha

2008-07-17 Thread Jacob Kaplan-Moss
On Thu, Jul 17, 2008 at 9:20 AM, Dan <[EMAIL PROTECTED]> wrote: > I was wondering when the 1.0alpha was due so I went to Trac and found this > page: > > http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&milestone=1.0+alpha > > There is only 10 tickets left before alpha

Re: Countdown to 1.0 alpha

2008-07-17 Thread Dan
> > The tickets don't tell the *entire* story, but yes, we're very close! > > Jacob > That's awesome! Can we have many big-ass parties? If there's one near Montreal, I'm in! We could set up a wiki page for that when the final release will be closer. --~--~-~--~~~---~-

Re: Why 2 servers to serve dynamic and static content?

2008-07-17 Thread 3xM
> And in deployment, how should this be? I mean, should I have 2 apache > instances? or use another web server for static content or...? You can use the same Apache instance, running 2 different virtual hosts: One for the Django site and the other for serving static files. That will probably be s

Re: Why 2 servers to serve dynamic and static content?

2008-07-17 Thread Jon Brisbin
On Jul 17, 2008, at 10:43 AM, 3xM wrote: > >> And in deployment, how should this be? I mean, should I have 2 apache >> instances? or use another web server for static content or...? > > You can use the same Apache instance, running 2 different virtual > hosts: One for the Django site and the othe

keeping a list of objects sorted

2008-07-17 Thread jelle
Hi, I'm using the tagging app to construct a view where the most recent articles by tag are shown, ordered by date. To do so I use the following code: all_tags = set([i.name for i in Tag.objects.all()]) articles = [] for i in all_tags: qs = TaggedItem.objects.get_by_model( Ar

Using an email as the user login

2008-07-17 Thread rootbit
Hey everyone. i would like to change the authentication system, so that usernames will be email like on facebook. how should i go about doing that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: ImageFiled Uploads

2008-07-17 Thread Dane Hesseldahl
Just FYI - I ended up using the models save__file method like this: if 'avatar' in request.FILES: uf = request.FILES['avatar'] os.remove(settings.MEDIA_ROOT + "/avatars/" + user.username + ".jpg") profile.save_profile_avatar_file("avatars/" + user.username + ".jpg", uf) On Wed, Jul

Re: Using an email as the user login

2008-07-17 Thread Karen Tracey
On Thu, Jul 17, 2008 at 12:04 PM, rootbit <[EMAIL PROTECTED]> wrote: > > Hey everyone. > i would like to change the authentication system, so that usernames > will be email > like on facebook. > > > how should i go about doing that? > > The answer that has been given other times people have asked

Re: Using an email as the user login

2008-07-17 Thread Ayaz Ahmed Khan
On Jul 17, 9:04 pm, rootbit <[EMAIL PROTECTED]> wrote: > > Hey everyone. > i would like to change the authentication system, so that usernames > will be email > like on facebook. > > how should i go about doing that? > For the current project I am working on, I had to do the same. I ended up mod

Re: how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Andre Meyer
hi Rajesh thanks, that's a great link. still, it's not exactly clear to me why the admin does not work the same as other templates. in my own template, it is no problem to refer to comments of a post using, e.g. {% for comment in post.comments.all %} [...] {% endfor %} or {{ post.comments

Re: Using an email as the user login

2008-07-17 Thread Marty Alchin
On Thu, Jul 17, 2008 at 12:34 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > > On Jul 17, 9:04 pm, rootbit <[EMAIL PROTECTED]> wrote: >> >> Hey everyone. >> i would like to change the authentication system, so that usernames >> will be email >> like on facebook. >> >> how should i go about doing

Re: how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Rajesh Dhawan
Hi, > still, it's not exactly clear to me why the admin does not work the same as > other templates. The Admin is not a template. So, I don't know what you mean by that. > > in my own template, it is no problem to refer to comments of a post using, > e.g. > > {% for comment in post.comments.all

URL encoding problem

2008-07-17 Thread [EMAIL PROTECTED]
Hi, I have a problem about the encoding of the variables that i have in my views.. I've an url like this: http://elvis.sinedita.it/dossiers/Comunità/1/ my URLS:  (r'(?P[^/]+)/section/$', 'views.listpersection'), in the views i found something like 'Comunit\xe0' and when i exec: section_

Different 500.html template for admin and frontend

2008-07-17 Thread apit
Noob here :) In what circumstance admin template for 500 error used? I use nfa-branch svn. In admin site, when my app raise exception, django seems to load 500.html from my project, or from the app, but not from admin template. Am i miss something? I want different 500 template between admin sit

Re: how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Andre Meyer
hi Rajesh On Thu, Jul 17, 2008 at 6:55 PM, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > Hi, > > > still, it's not exactly clear to me why the admin does not work the same > as > > other templates. > > The Admin is not a template. So, I don't know what you mean by that. admin is not using templa

Re: how to access foreignkey field (related_name) in newforms-admin list view?

2008-07-17 Thread Rajesh Dhawan
> > > still, it's not exactly clear to me why the admin does not work the same > > as > > > other templates. > > > The Admin is not a template. So, I don't know what you mean by that. > > admin is not using templates? well, i did not check the implementation. Sorry, if I wasn't clear. The admin

Re: How to switch/force a language from inside a usual view function?

2008-07-17 Thread Malcolm Tredinnick
On Thu, 2008-07-17 at 08:26 -0700, Valery wrote: > Hi Malcolm, > > > It's not documented in thei18n.txt file (which needs a bit of a rewrite > > and splitting up once the docs reorganisation lands in trunk), but have > > a look at the activate() function in > > django/utils/translation/trans_rea

Re: URL encoding problem

2008-07-17 Thread Malcolm Tredinnick
On Thu, 2008-07-17 at 10:01 -0700, [EMAIL PROTECTED] wrote: > Hi, > I have a problem about the encoding of the variables that i have in my > views.. > > I've an url like this: > > http://elvis.sinedita.it/dossiers/Comunità/1/ > > my URLS: > >  (r'(?P[^/]+)/section/$', 'views.listpersection

Re: ImageFiled Uploads

2008-07-17 Thread d3f3nd3r
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yeah thank you, had an outdated django version. but I have another fundamental question about ImageField. If I use ImageFields in a Form, does to form handle the storage for me or have I to save the image specially? Because I cant figure out how Im

Re: Why 2 servers to serve dynamic and static content?

2008-07-17 Thread Norman Harman
eka wrote: > Hi, > > I'm new to django, and reading around, found out that it's better to > have 2 different web servers for django and static content. How is so? It's scalability issue. Each process of a server setup to serve dynamic content (using mod_python for instance) typically uses much

Re: URL encoding problem

2008-07-17 Thread Karen Tracey
On Thu, Jul 17, 2008 at 1:01 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Hi, > I have a problem about the encoding of the variables that i have in my > views.. > > I've an url like this: > > http://elvis.sinedita.it/dossiers/Comunità/1/

Re: keeping a list of objects sorted

2008-07-17 Thread Norman Harman
jelle wrote: > Hi, > > I'm using the tagging app to construct a view where the most recent > articles by tag are shown, ordered by date. > To do so I use the following code: > > all_tags = set([i.name for i in Tag.objects.all()]) > articles = [] > for i in all_tags: > qs = Ta

Row-level permissions

2008-07-17 Thread [EMAIL PROTECTED]
Hi, I need to use row level permissions on a project I'm developing. I've found several solutions: http://code.djangoproject.com/wiki/RowLevelPermissions http://code.google.com/p/django-granular-permissions/ http://www.technobabble.dk/2008/jan/06/filtering-foreign-key-choices-newforms-admin/ an

Re: keeping a list of objects sorted

2008-07-17 Thread jelle
Hi Norman, Yep, I'm just looping through the list. Pretty awkward, right? --~--~-~--~~~---~--~~ 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 un

Re: keeping a list of objects sorted

2008-07-17 Thread Norman Harman
jelle wrote: > Hi Norman, > > Yep, I'm just looping through the list. > Pretty awkward, right? Yes, very. Is the html output order seemingly random? or is there some pattern to it? Cn you post the code for the view? I'm guessing there is a typo or something similar going unnoticed. -- Nor

Source changes: How can I resolve import error -- cannot import django.db.models.query.parse_lookup

2008-07-17 Thread LRP
Hello, Still working my way through James Bennett's Practical Django Projects. Now on p. 64. I get this import error when I try to syncdb the Coltrane models. from tagging.models import Tag File "/usr/lib/python2.5/site-packages/tagging/models.py", line 9, in from tagging.managers imp

Dreamhost now supports Django

2008-07-17 Thread Ramdas S
Hi, Just recd notice that Dreamhost is officially supporting Django. Anyone has tried it out lately. I've had extremely bad expeirence with Fast CGI a year back. Please give feedback -- Ramdas S +91 9342 583 065 My Personal Blog: http://ramdas.diqtech.com --~--~-~--~~~-

Re: Dreamhost now supports Django

2008-07-17 Thread Marinho Brandao
Hi Ramdas, about 1 or 2 years ago, I head some headaches with DH Django's sites, using their FastCGI sollution (the problema wasn't the FastCGI, but the lot of shared accounts in the server). now it is working well, in last months. I don't know what really they changed to annound an official su

Re: Dreamhost now supports Django

2008-07-17 Thread Juanjo Conti
Where can I read the notice and get directions? 2008/7/17 Ramdas S <[EMAIL PROTECTED]>: > Hi, > > Just recd notice that Dreamhost is officially supporting Django. Anyone has > tried it out lately. I've had extremely bad expeirence with Fast CGI a year > back. > > Please give feedback > > -- > Ram

Re: Dreamhost now supports Django

2008-07-17 Thread Malcolm Tredinnick
On Fri, 2008-07-18 at 01:37 +0530, Ramdas S wrote: > Hi, > > Just recd notice that Dreamhost is officially supporting Django. > Anyone has tried it out lately. I've had extremely bad expeirence with > Fast CGI a year back. Can anybody who is in a position to check this out please look at one th

Re: Dreamhost now supports Django

2008-07-17 Thread Ramdas S
Ok this is the mail I recd just now Hey! This is just a note to let you know that the suggestion: "Add support for Django (a python web-development framework)." from the category "New Features" has been marked as completed. So you now have another 4 credit(s) to vote on more suggestio

Re: Dreamhost now supports Django

2008-07-17 Thread Ned Batchelder
Here's what I got, I have no idea if I need to do anything unusual to change the python path or anything: nedbat.coke ~> python Python 2.3.5 (#2, Oct 16 2006, 19:19:48) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MyS

Re: Dreamhost now supports Django

2008-07-17 Thread jake elliott
On Jul 17, 3:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Can anybody who is in a position to check this out please look at one > thing in particular: assuming the default database is still MySQL, which > version of the python MySQLdb wrapper are they using? If > >         >>> import M

Re: Django on Windows Mobile 6 (Standard)

2008-07-17 Thread warsng
seem to be having a lot of trouble renaming the files using a python script that WM has very kindly 'uppercased' for me. I'm trying to run the script on the Russian blog but keep getting an Error 13 - Windows error? --- import os, sys for root, dirs, files in os.walk('.', topdown=False): fo

Re: Dreamhost now supports Django

2008-07-17 Thread Malcolm Tredinnick
On Thu, 2008-07-17 at 16:43 -0400, Ned Batchelder wrote: > Here's what I got, I have no idea if I need to do anything unusual to > change the python path or anything: > > nedbat.coke ~> python > Python 2.3.5 (#2, Oct 16 2006, 19:19:48) > [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 > Type "help", "

Strange ProgrammingError - What causes it?

2008-07-17 Thread andrewljohnson
Hi, I am getting a strange programming error, and I wonder what causes it? The Error ProgrammingError at /trips/viewtrip/2/ ERROR: current transaction is aborted, commands ignored until end of transaction block SET client_encoding to 'UNICODE' This error is triggered by calling {{trip.

Re: accessing site settings in templates

2008-07-17 Thread gordyt
Jon I don't see why you couldn't make a custom template tag (see http://tinyurl.com/2zlzf6). I made one to display the current application revision and so to use it in a template is just this: {% revision %} --gordon --~--~-~--~~~---~--~~ You received this messag

Re: accessing site settings in templates

2008-07-17 Thread Jon Brisbin
I was considering this option, but went with some custom middleware, which allows me to mix in some other things I was wanting to add to the context as well... Thanks for the suggestion! Jon Brisibn http://jbrisbin.com On Jul 17, 2008, at 4:16 PM, gordyt wrote: > > Jon I don't see why you

Download source-code feature.

2008-07-17 Thread J . Pablo Fernández
Hello, Is there any reusable or copyable implementation of download-source- code feature as it would be used when using the Affero GPL license? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Strange ProgrammingError - What causes it?

2008-07-17 Thread Julien Phalip
Which version of Django are you using? As a first attempt, I'd replace your __str__ method by __unicode__ and replace the calls to 'str' by 'unicode'. On Jul 18, 7:02 am, andrewljohnson <[EMAIL PROTECTED]> wrote: > Hi, > > I am getting a strange programming error, and I wonder what causes it? >

Re: Strange ProgrammingError - What causes it?

2008-07-17 Thread Julien Phalip
Seems like it could be, as you say, related to a problem with psycopg, see: http://groups.google.com/group/comp.lang.python/browse_thread/thread/8e78649ac40472fe/ On Jul 18, 9:14 am, Julien Phalip <[EMAIL PROTECTED]> wrote: > Which version of Django are you using? > > As a first attempt, I'd re

Re: newforms and commit=False

2008-07-17 Thread Ian Lawrence
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, > Take a look at how Form Preview works. You should be able to adapt > that to your above workflow: > http://www.djangoproject.com/documentation/form_preview/ Thanks , that looks exactly like what I need! I do not think however it is possible to

Re: accessing site settings in templates

2008-07-17 Thread [EMAIL PROTECTED]
Look at these sample code , is this you want ? from django.template import loader, RequestContext def custom_proc(request): "A context processor that provides 'app', 'user' and 'ip_address'." return { 'app': 'My app', 'user': request.user, 'ip_address': request.META['REMOTE_ADDR'] } def view_1(re

Re: no more mail for ADMINS

2008-07-17 Thread EAMiller
Thanks again to you Rajesh, and Malcom for great troubleshooting tips. Due to separate issue I discovered that I was missing the 127.0.0.1 localhost line from my /etc/hosts ... fixing that also fixed my mail issue! - Ethan On Jul 14, 4:15 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Jul 14,

Re: accessing site settings in templates

2008-07-17 Thread Jon Brisbin
Sort of, but not really because I wanted something that worked even using the built-in views (the problem manifested when I started working with the login views). I didn't have a problem passing my settings into the templates for the views I created myself, but I didn't have access to the

Re: Source changes: How can I resolve import error -- cannot import django.db.models.query.parse_lookup

2008-07-17 Thread Bill Totman
Well, I'm not sure of the nature of the patch, but I hope to find out how to do so. I'll be certain to pass on the HOWTO to you here - since you found out the solution and all. I, too, and going through the book and would like to make progress. -Bill On Jul 17, 4:03 pm, LRP <[EMAIL PROTECTED]>

Re: Turning on mod_python in Apache does not allow non-Django pages to rendor correctly

2008-07-17 Thread danielk
On Jul 16, 2:34 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 16, 2008 at 1:49 PM, danielk <[EMAIL PROTECTED]> wrote: > > > On Jul 16, 12:03 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > On Wed, Jul 16, 2008 at 10:51 AM, danielk <[EMAIL PROTECTED]> > > wrote: > > > > > I've b

Re: Source changes: How can I resolve import error -- cannot import django.db.models.query.parse_lookup

2008-07-17 Thread Bill Totman
Here's the solution (so far): 1) Obtain the SVN version of django-tagging. 2) Place it or link the 'tagging' directory step '1' provides you into your $PYTHONPATH 3) python manage.py syncdb (in your 'cms' directory) To give helpful info: 1) Obtain the SVN version of django-tagging: run: svn

Re: Strange ProgrammingError - What causes it?

2008-07-17 Thread Karen Tracey
On Thu, Jul 17, 2008 at 5:02 PM, andrewljohnson <[EMAIL PROTECTED]> wrote: > > Hi, > > I am getting a strange programming error, and I wonder what causes it? > > The Error > > ProgrammingError at /trips/viewtrip/2/ > ERROR: current transaction is aborted, commands ignored until end of > t

Re: Strange ProgrammingError - What causes it?

2008-07-17 Thread andrewljohnson
I am using the current SVN version. On Jul 17, 4:14 pm, Julien Phalip <[EMAIL PROTECTED]> wrote: > Which version of Django are you using? > > As a first attempt, I'd replace your __str__ method by __unicode__ and > replace the calls to 'str' by 'unicode'. > > On Jul 18, 7:02 am, andrewljohnson <[

Re: Strange ProgrammingError - What causes it?

2008-07-17 Thread andrewljohnson
Thanks Karen... I'll poke around a bit. On Jul 17, 4:44 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Jul 17, 2008 at 5:02 PM, andrewljohnson <[EMAIL PROTECTED]> > wrote: > > > > > Hi, > > > I am getting a strange programming error, and I wonder what causes it? > > > The Error > > =

NEED HELP BADLY

2008-07-17 Thread Kadusale, Myles
Good Day to all! I just want to clarify my knowledge in Django Because right now I am a little bit confused. The views.py is the "controller" so this file is the one who will be handling the POST and GET. So there will be only one method that will be handling the POST and GET for the

Re: NEED HELP BADLY

2008-07-17 Thread Juanjo Conti
In views.py you define as many python functions as cotrollers you want. Hech one has thsi signature: def view1(request, *args, **kwargs) You also have a urls.py file that maps urls to view functions. -- Juanjo Conti --~--~-~--~~~---~--~~ You received this messa

Re: NEED HELP BADLY

2008-07-17 Thread Joshua Jonah
Is this the best way to organize the files in Django? Not important, it's personal taste. Also in a web cart scenario where is the best area to put the data of the items inside the cart? Umm, i would say in a database Is it good to put the checking if the user has login in the base template

Re: NEED HELP BADLY

2008-07-17 Thread TiNo
How about:http://www.djangoproject.com/documentation/tutorial03/ On Fri, Jul 18, 2008 at 4:53 AM, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Is this the best way to organize the files in Django? > > Not important, it's personal taste. > > Also in a web cart scenario where is the best area to p

Re: NEED HELP BADLY

2008-07-17 Thread Dan
On Thu, Jul 17, 2008 at 10:53 PM, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Is this the best way to organize the files in Django? > > Not important, it's personal taste. > Although, it is most of the time preferable to use regex group in your URLs rather than GET. It looks much nicer. --~--~---

RE: NEED HELP BADLY

2008-07-17 Thread Kadusale, Myles
IndexPage.py def index_page(request): lgFrm = LoginForm() #-- I this the only place where I should handle the POST #-- or I could put the function to handle the PO

64 bit integer field

2008-07-17 Thread simon
How do i create a long long integer field in my model ? Do I use decimal ? (worried about performance of the decimal field). I am using the mysql backend. Simon. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja