Re: capture form input even after ValueError exists

2008-09-30 Thread Merrick
Yeah thanks, I guess I wasn't clear. I realize I don't have access to cleaned_data but I want to validate my url the same way as django does by default on a form - any pointers on how to accomplish that? Also how do I access the form submission if not through cleaned_data.get? On Sep 30, 10:49

Brisbane, Australia: Open Source Development team looking for Web developers

2008-09-30 Thread Biggie
I am looking for Solid open source web developers to work in Brisbane; if you know of anyone or have a friend or colleague who would be interested please let me know or pass on my contact details, Cheers - Scott +61 (07) 3023 5222 Main skills we are looking for include: *software version contro

Re: capture form input even after ValueError exists

2008-09-30 Thread Kenneth Gonsalves
On Wednesday 01 October 2008 01:35:55 am Merrick wrote: > All is not lost if a user enters an invalid code I still want to do > something with just the url, but I cannot get > form.cleaned_data.get('url'). Any ideas how to get the url inputted > and to clean it inside the ValueError branch of code

capture form input even after ValueError exists

2008-09-30 Thread Merrick
My ModelForm has two input fields url and code, and I raise a ValidationError if the code contains anything other than letters, numbers and dashes. My logic looks something like this: if form.is_valid(): ... return render_to_response('new.html', {'code': new.code}) if ValueError: if form.cle

Re: question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Merrick
Thank you, I was doing this: def encode_id(id): ... number = id charset = string.letters + string.digits base = len(charset) count = 0 while number: digit = number % base ... and kept getting an error, when I did this: id = row[0] encode_id(id) I didn't realize

Re: Using forloop counter to index into a query set

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 08:05 -0700, SnappyDjangoUser wrote: > Hi Malcolm, > > You suggested: > > > set up the data structures > > you pass to your view a bit differently so that you can loop over the > > forms and the products simultaneously (that is, pull apart the formset > > forms and zip the

Re: question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 15:08 -0700, Merrick wrote: > If I run the following query on psql: > > SELECT nextval('redirect_link_id_seq'); > > it returns an integer, say 5 > > when I do the following with the django shell I get a different > result: > > >>> def get_next_id(): > ... cursor = co

Re: Extra select question

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 13:08 -0700, krylatij wrote: > I have model with 3 fields - id, name_ru, name_en > I want rename 'name_ru' field to 'name' in query > i try this: > operations = > OperationType.objects.values('id').extra(select={'name': 'name_ru'}) > > but it returns only 'id' > what's

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 08:22 -0700, bruno desthuilliers wrote: > On 30 sep, 14:04, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> > > wrote: > > > > Partly answering to myself: > > > > (snip) > > > > > After a couple more tests and in

Re: Django on Apache (mod_python) administration cookie problem

2008-09-30 Thread Graham Dumpleton
On Oct 1, 10:56 am, Álvaro Justen <[EMAIL PROTECTED]> wrote: > Daniel bodom_lx Graziotin wrote: > > Hi everybody! I'm a new Django developer and for learning the > > framework I decided to create (another) pastebin clone that I > > published onhttp://incollo.com > > The application works very we

Re: SlugField & prepopulate_from

2008-09-30 Thread Keith Eberle
Yea... I didn't know for sure, but I thought it used to. That's why I asked. I wonder why that functionality wasn't there by default... keith On Tue, Sep 30, 2008 at 9:22 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Tue, Sep 30, 2008 at 2:41 PM, lingrlongr <[EMAIL PROTECTED]>wrote: > >> >

Re: SlugField & prepopulate_from

2008-09-30 Thread Karen Tracey
On Tue, Sep 30, 2008 at 2:41 PM, lingrlongr <[EMAIL PROTECTED]> wrote: > > Before the new forms and admin came, I could've sworn that the > prepopulate_from (now prepopulated_fields) stuff worked when creating > a new object in the admin, __AND__ when you edit an existing object. > > Can someone c

Re: Cookie problem

2008-09-30 Thread Álvaro Justen
I was with this bug but now it's corrected. Please see: http://groups.google.com/group/django-users/browse_thread/thread/676a90769fe2aec9?pli=1 -- Cheers, Álvaro Justen Debian GNU/Linux user --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Django on Apache (mod_python) administration cookie problem

2008-09-30 Thread Álvaro Justen
Ah, some details: -> Admin interface runs OK with python manage.py runserver - as of it is an Apache error, Django's web server isn't affected by this bug. -> I'm using Debian etch as server: I've installed Apache, PHP and mod_php with Debian packages, but Django installed manually. -> Versions:

Re: How to invoke a request to an URL inside a web app without making a real request?

2008-09-30 Thread Jeff Anderson
maverick wrote: > Hi, I have a django web application, I want to invoke a request of one > URL inside this application, e.g. "/getdata/", and capture the output > of such URL and do some further processing. > > Of course I can do that by make a real request, however I feel this > may not be the be

Re: Django on Apache (mod_python) administration cookie problem

2008-09-30 Thread Álvaro Justen
Daniel bodom_lx Graziotin wrote: > Hi everybody! I'm a new Django developer and for learning the > framework I decided to create (another) pastebin clone that I > published on http://incollo.com > The application works very well and I'm very proud of it because I > started learning Django six days

Re: Question about ornery nginx reverse proxy in front of apache mod_wsgi

2008-09-30 Thread Prairie Dogg
Just to follow up on this, my problem appears to have been a munged install of nginx. I restarted from scratch with the exact same config files quoted above and it just worked™ So the settings files I quoted above appear to be OK, in case anyone wants to crib off of them. On Sep 27, 9:29 am, [E

Re: How to invoke a request to an URL inside a web app without making a real request?

2008-09-30 Thread Keith Eberle
sure can! take a look @ http://docs.python.org/lib/module-urllib.html keith On Tue, Sep 30, 2008 at 8:00 PM, maverick <[EMAIL PROTECTED]> wrote: > > Hi, I have a django web application, I want to invoke a request of one > URL inside this application, e.g. "/getdata/", and capture the output >

How to invoke a request to an URL inside a web app without making a real request?

2008-09-30 Thread maverick
Hi, I have a django web application, I want to invoke a request of one URL inside this application, e.g. "/getdata/", and capture the output of such URL and do some further processing. Of course I can do that by make a real request, however I feel this may not be the best solution, is there any

Re: accessing the http conf setting: PythonOption django.root

2008-09-30 Thread Graham Dumpleton
FWIW, SCRIPT_NAME derives from CGI standard, so, it isn't like Django arbitrarily chose it. Graham On Sep 30, 10:03 pm, felix <[EMAIL PROTECTED]> wrote: > ah right, WSGI requests won't have this django_root environ var. > > so its the completely non-intuitive SCRIPT_NAME > (I know, its the serve

Re: How to dynamically set choices in ChoiceField

2008-09-30 Thread eswenson
I just ran into this myself, yesterday and found the solution by perusing the django source code. Your form class (MyClass) will have had a field called "fields" created by the meta class of the base form. That field will have a choices field that you can set. In your setChoice method (which, by

Re: status of per-object-level permission

2008-09-30 Thread kajigga
Thanks for the tip. I hadn't had time to check on the commits or status of the project yet. Others have mentioned a "variety of options" out there. I guess I haven't looked hard enough yet, because I'm not seeing them. Do you have any suggestions? - kajigga On Sep 30, 4:10 pm, "James Bennett

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
Malcolm, Carl and Felix, Thanks for the help! I figured out a solution to my above problem by using the suggested for loop approach to build the tuple of products and forms. It may not be the most elegant python code, but it is working and readable. # Build a tuple of products and forms for ea

Re: Many to Many where two fields in one model are related

2008-09-30 Thread Steve Bergman
Thank you. That looks to be exactly what I need. I remember seeing that on the ToDo list leading up to 1.0, but didn't realize how it applied to my situation. -Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
On Sep 30, 9:36 pm, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: >  In the example > above you assume that both p and v belong to products.   I just put them into a combined array called "products" > In my case, > that is not the case.  I have a queryset of products that contains the > vendor

Re: status of per-object-level permission

2008-09-30 Thread James Bennett
On Tue, Sep 30, 2008 at 5:07 PM, kajigga <[EMAIL PROTECTED]> wrote: > I've just come across this Django branch called "RowLevelPermission". > http://code.djangoproject.com/wiki/RowLevelPermissions. I have yet to > try it out. Don't bother; it's dead as a doornail and has been for quite a long ti

question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Merrick
If I run the following query on psql: SELECT nextval('redirect_link_id_seq'); it returns an integer, say 5 when I do the following with the django shell I get a different result: >>> def get_next_id(): ... cursor = connection.cursor() ... cursor.execute("SELECT nextval('redirect_link_i

Re: status of per-object-level permission

2008-09-30 Thread kajigga
I'm not sure exactly how to proceed myself. I am very pleased with Django in general, but not having ready to use object-level permissions is driving me nuts. I realize that django was designed with a slightly different view point, but there must be something out there to make it easier. Anyway

How to dynamically set choices in ChoiceField

2008-09-30 Thread alan
I'm having trouble dynamically assigning the choices to a ChoiceField. My ChoiceField stores an object's state. In the template pulldown for this field, I want to restrict the user to only go from stateA to StateB; from stateB to stateC, etc. Hence the allowable choices need to be a set based o

Re: unexpected keyword argument 'force_insert'

2008-09-30 Thread akhaitan
Thanks a lot.. i had similar problems.. Did helped.. On Sep 24, 1:52 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Found it... actually on the user_profile models save() > > changing it to > def save(self, *args, **kwargs): > ... >    super(SiteUser, self).save(*args, **kwargs) > > fixed i

Re: mptt + contrib.comments?

2008-09-30 Thread Chris Stromberger
OK, nevermind on the admin page issue. Was being caused by TEMPLATE_STRING_IF_INVALID being set to something other than ''. Would still love to see an example of contrib.comments + mptt! Thanks, Chris On Tue, Sep 30, 2008 at 4:25 PM, Chris Stromberger < [EMAIL PROTECTED]> wrote: > One specific

Re: mptt + contrib.comments?

2008-09-30 Thread Chris Stromberger
One specific issue I am having is that the admin screen for the Comment model is not "synched up" with the data. The admin list screen has a table of field names, and the columns do not match the data--the data is shifted. So for example, the "Is public" column is displaying the IP address. Etc.

Re: status of per-object-level permission

2008-09-30 Thread Roman Chyla
I am planning to use it together with django - but not for the django site, as a general permission system for digital documents. Using spiff-guard for the backend, and django as an interface to set up the rules. But I haven't really started putting them together, maybe you have clearer ideas abou

Extra select question

2008-09-30 Thread krylatij
I have model with 3 fields - id, name_ru, name_en I want rename 'name_ru' field to 'name' in query i try this: operations = OperationType.objects.values('id').extra(select={'name': 'name_ru'}) but it returns only 'id' what's wrong?? --~--~-~--~~~---~--~~ You

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Carl, You can hold the brain on this one. I think I found out a solution. Probably similar to yours except using the states as keys. i18nstates = { 'created': _('Created'), 'quoted': _('Quoted'), 'cancelled': _('Cancelled'), 'ordered': _('Ordered'), 'bill

Re: Translation of object.attribute in template

2008-09-30 Thread Carl Meyer
On Sep 30, 3:29 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > You lost me. You mean make the states numerical and in the array related its > (numeric) keys to the, then translatable, 'words'? > > If so, the problem would be that the ease of use in coding would stop to > exist. The statemachin

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
This is extremely helpful! I didn't know this was possible in Django to create a tuple and loop through both items using a for loop in the template. Thank you! I am currently hung up on one last part, however. In the example above you assume that both p and v belong to products. In my case, t

Re: display of datefield breaks admin template

2008-09-30 Thread Carl Meyer
On Sep 30, 2:19 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > That did the trick. It does, however, leave me with a previous problem. When > I edit the object via a form (in my app) it displays the field value like > this "2008-09-30". And due to field validation the form widget only accepts

Re: Django JSON deserialization and caching

2008-09-30 Thread [EMAIL PROTECTED]
Hi Rajesh, That worked brilliantly...the number of queries has been massively reduced now that I've taken your suggestion to eliminate the serialization. Thanks a lot for that! Very much appreciated. Kind regards, Mike. On Sep 30, 6:45 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > Thanks f

mptt + contrib.comments?

2008-09-30 Thread Chris Stromberger
I'm trying to use mptt with contrib.commments and am not having much luck. Basically would like to allow nested comments. Pretty new to Django, so that is contributing to the problem. Would love to see a simple example/summary of what needs to change in contrib.comments to incorporate mptt. Than

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Carl, You lost me. You mean make the states numerical and in the array related its (numeric) keys to the, then translatable, 'words'? If so, the problem would be that the ease of use in coding would stop to exist. The statemachine dynamically creates methods so you can use stuff like order.bi

Re: Set referer header in test client?

2008-09-30 Thread Tim Sawyer
On Tuesday 30 Sep 2008, Russell Keith-Magee wrote: > > Can I simulate this header with the test client? > > Yes. > > The full method signature for client.post() is: > def post(self, path, data={}, content_type=MULTIPART_CONTENT, **extra): > > 'extra' is an argument that allows you to specify a

Re: ModelForm and request.POST

2008-09-30 Thread globophobe
Doh, I changed the prefix of my form. I get it now. Thank you Malcolm. --~--~-~--~~~---~--~~ 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 unsub

IntegrityError in admin with django-tagging

2008-09-30 Thread smcoll
i'm trying to get a TagField working in the admin for my model using django-tagging 0.2. i get an IntegrityError when i save my model from the admin- it looks like django is trying to send a python list to the database, where string is expected. i suspect i haven't set it up right. Can someone

Re: Translation of object.attribute in template

2008-09-30 Thread Carl Meyer
On Sep 30, 2:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > It is indeed stored, I'm using a state machine > (http://www.djangosnippets.org/snippets/737/). Setting this up multilingual > could result in unusable orders states, when users change their locale during > the state/transition of

Re: cannot import name execute_manager

2008-09-30 Thread KillaBee
On Sep 30, 1:27 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > KillaBee wrote: > > I am use the svn and I just installed it last night, but it is giveing > > me this error: > > > [EMAIL PROTECTED]:/home/bryant/Django-1.0/intranet# python manage.py > > runserver > > 8080 > > Traceback (most rece

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Kenneth, It is indeed stored, I'm using a state machine (http://www.djangosnippets.org/snippets/737/). Setting this up multilingual could result in unusable orders states, when users change their locale during the state/transition of an order. The tricky thing is that the states (used for con

SlugField & prepopulate_from

2008-09-30 Thread lingrlongr
Before the new forms and admin came, I could've sworn that the prepopulate_from (now prepopulated_fields) stuff worked when creating a new object in the admin, __AND__ when you edit an existing object. Can someone confirm if this should work for editing objects too? Currently, it does not. Keith

Re: status of per-object-level permission

2008-09-30 Thread kajigga
> It seems to me that lot of developers are opting for auth backend - > doing things outside Django. I was looking into phpGACL then I > foundhttp://code.google.com/p/spiff-guard/which is a sort of a similar > project in python. > Have you had any success in using spiff guard with django? I hav

Re: display of datefield breaks admin template

2008-09-30 Thread Gerard Petersen
Carl, That did the trick. It does, however, leave me with a previous problem. When I edit the object via a form (in my app) it displays the field value like this "2008-09-30". And due to field validation the form widget only accepts this format: "30-09-2008". Any clue on how a datefield cont

Re: cannot import name execute_manager

2008-09-30 Thread Rajesh Dhawan
KillaBee wrote: > I am use the svn and I just installed it last night, but it is giveing > me this error: > > [EMAIL PROTECTED]:/home/bryant/Django-1.0/intranet# python manage.py runserver > 8080 > Traceback (most recent call last): > File "manage.py", line 2, in > from django.core.manage

Re: HTTPS Question...

2008-09-30 Thread Rajesh Dhawan
On Sep 30, 9:28 am, [EMAIL PROTECTED] wrote: > We have an online application for school, where we request the > individuals SSN and PharmCAS information. The application will be at > saywww.oursite.com/application/. Since we're gathering sensitive > data, I want to obviously make this secure usi

cannot import name execute_manager

2008-09-30 Thread KillaBee
I am use the svn and I just installed it last night, but it is giveing me this error: [EMAIL PROTECTED]:/home/bryant/Django-1.0/intranet# python manage.py runserver 8080 Traceback (most recent call last): File "manage.py", line 2, in from django.core.management import execute_manager Impor

Re: Django JSON deserialization and caching

2008-09-30 Thread Rajesh Dhawan
> Thanks for your help so far - that definitely improved things > somewhat! Great. > > However, I'm still having a slight problem. When I pass > Item.objects.get(id=id) into the serializers.serialize( ... ) > function, it tells me that the Item is not iterable (this is why I was > originally usi

Re: cannot save model to db

2008-09-30 Thread Rajesh Dhawan
> I have a model for Thumbnail, but I cannot save it. It says: > AttributeError: 'Thumbnail' object has no attribute 'id'. > What is wrong? > > I use django 1.0-final-SVN-unknown > > thanks, Manuel > > Here is an example: > > >>> from portfolio.models import Photo, Thumbnail > >>> p = Photo.obj

Re: Django JSON deserialization and caching

2008-09-30 Thread [EMAIL PROTECTED]
Hi Rajesh, Thanks for your help so far - that definitely improved things somewhat! However, I'm still having a slight problem. When I pass Item.objects.get(id=id) into the serializers.serialize( ... ) function, it tells me that the Item is not iterable (this is why I was originally using filter(

Re: Many to Many where two fields in one model are related

2008-09-30 Thread Rajesh Dhawan
> I'm working on an app for planning balanced daily diets. And I'm > having trouble figuring out how to set up my models. I have: > > Ingredient(models.Model): > ingredient_name = CharField(max_length=50) > unit = CharField(max_length=15) > calories = DecimalField(max_digits=6, deci

Re: egregiously long model names, hashes, constraints

2008-09-30 Thread felix
whoops, you are right. those weren't the same tables. two with the exact same tables are posted in the ticket: http://code.djangoproject.com/ticket/9253 On Sep 30, 3:23 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Please open a new ticket about this. Looks like there is an assumption

Many to Many where two fields in one model are related

2008-09-30 Thread Steve Bergman
I had trouble coming up with a decriptive "subject" for this. Sorry. I'm working on an app for planning balanced daily diets. And I'm having trouble figuring out how to set up my models. I have: Ingredient(models.Model): ingredient_name = CharField(max_length=50) unit = CharField(max_

Re: Django JSON deserialization and caching

2008-09-30 Thread Rajesh Dhawan
On Sep 30, 12:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I was wondering if somebody could help me with deserialization. > > I'm currently trying to cache the result of a database query using a > JSON serializer in (what I assume to be) the standard fashion: > > ---

Re: per-request cache

2008-09-30 Thread pihentagy
Hi! Thanks for your reply. I thought about it, and come up with the following comments: On Sep 15, 11:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 15, 9:11 am, pihentagy <[EMAIL PROTECTED]> wrote: > > Also for consistency and for performance reasons, is it possible to > > someh

Django JSON deserialization and caching

2008-09-30 Thread [EMAIL PROTECTED]
Hi guys, I was wondering if somebody could help me with deserialization. I'm currently trying to cache the result of a database query using a JSON serializer in (what I assume to be) the standard fashion: --- def cache_query(id): cache_key = "cache_key_" % id item = cache.get(ca

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
malcom is suggesting this: def view(request): blah blah blah ... zipped = [] for p in products: v = find the vendor for this product zipped.append( ( p, v) ) # add them as a tuple # or more pythonically if its easy to find your vendor: zipped = [ (p, vendor for

Re: Using forloop counter to index into a query set

2008-09-30 Thread Carl Meyer
On Sep 30, 11:05 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > > set up the data structures > > you pass to your view a bit differently so that you can loop over the > > forms and the products simultaneously (that is, pull apart the formset > > forms and zip them together with the product entr

Re: display of datefield breaks admin template

2008-09-30 Thread Carl Meyer
On Sep 30, 7:29 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > I get this trace:http://paste.pocoo.org/show/86579/ > > This is the model in question:http://paste.pocoo.org/show/86580/ Remove the strftime() call from your default= setting for the DateField. Django model fields automatically han

Re: How to view the sql query statement involved in a django web page?

2008-09-30 Thread pihentagy
That's fine, and useful indeed, but I need a bit more detail: I'm hunting for duplicate queries. Is there a possibility to tell where django fires those queries? thanks On Aug 29, 6:38 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > How to view thesqlquerystatement involved in a django web page for

relating auth user to company model

2008-09-30 Thread MilesTogoe
> On Sep 29, 12:58 am, MilesTogoe <[EMAIL PROTECTED]> wrote: > >> I've seen the docs on how to relate the user with a 1-1 relationship (ie >> profile) but is there a way to have another model relate in a 1:many >> (ie one company with many users) - this would require user to have a >> company f

Re: Using forloop counter to index into a query set

2008-09-30 Thread SnappyDjangoUser
Hi Malcolm, You suggested: > set up the data structures > you pass to your view a bit differently so that you can loop over the > forms and the products simultaneously (that is, pull apart the formset > forms and zip them together with the product entries in the view). This is exactly what I li

Re: Custom ModelChoiceField muddle

2008-09-30 Thread Donn
Perhaps if I ask it in a different way: 1. A 'book' has a title (string) and an author (foreign key). 2. I use a ModelForm from the model. 3. I want the 'author' form-control to look like this: Author:__ [click here to choose or add an author] 4. When you click the link it opens a div. 5. The

Re: DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Scott Moonen
An alternative solution is to replace the pound character with the HTML entity £. -- Scott On Tue, Sep 30, 2008 at 8:01 AM, Jens <[EMAIL PROTECTED]> wrote: > > I got the same message the other day and the solution was to put > following line at the top (first line, befor everything else) of my

Dynamically appending a step to FormWizard

2008-09-30 Thread Jeroen
Hi All, I'm adding a step to FormWizard based on user input from the previous (first) step: def process_step(self, request, form, step): if step == 0: self.form_list.append(get_form2(form.cleaned_data['mode'])) Above works, a second (and final) form is created based on the value of

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread bruno desthuilliers
On 30 sep, 14:04, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > Partly answering to myself: > > (snip) > > > After a couple more tests and investigations, it appears that the > > nested blocks have nothing to do with my prob

Re: HTTPS Question...

2008-09-30 Thread Jeff Anderson
[EMAIL PROTECTED] wrote: > We have an online application for school, where we request the > individuals SSN and PharmCAS information. The application will be at > say www.oursite.com/application/. Since we're gathering sensitive > data, I want to obviously make this secure using https:// I don't wa

Re: DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Sérgio Durand
Hi Nick, Insert the following code as first line of your models.py (and other .py files) # -*- coding: utf-8 -*- []'s Sergio Durand Nick escreveu: > Hi, > > I've recently noticed that I'm getting the following in my Apache > error log... > > DeprecationWarning: Non-ASCII character '\xc2' in f

Re: Translation of object.attribute in template

2008-09-30 Thread Kenneth Gonsalves
On Tuesday 30 September 2008 10:40:15 am Gerard Petersen wrote: > #~ msgid "quoted" > #~ msgstr "jaja" > > It's in the template like this "{% trans order.state %}" so it's not picked > up by the makemessages command. Then another option is putting the > translation in the view, and manipulate it t

Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
Hi all, I've been trying to workout a solution on the following: I want to show the translation of a string stored in the database in a template preferably with the use of "|capfirst" .. yeah yeah I know .. ;-) The translatable: order.state = 'billed' .. The term 'billed' is what needs to be

cannot save model to db

2008-09-30 Thread Manuel Meyer
Hey, I have a model for Thumbnail, but I cannot save it. It says: AttributeError: 'Thumbnail' object has no attribute 'id'. What is wrong? I use django 1.0-final-SVN-unknown thanks, Manuel Here is an example: >>> from portfolio.models import Photo, Thumbnail >>> p = Photo.objects.all()[0]

Re: HTTPS Question...

2008-09-30 Thread Gerard Petersen
Hi, Using https://application.oursite.com/ would imho be the only simpel solution. An SSL certificate is IP bound, and if you are to serve plain and secure on 1 domain name, you're in for an administrative nightmare. https://www.oursite.com/application/ is possible but then you need to keep t

Re: overwrite get_absolute_url /contrib/auth/User

2008-09-30 Thread felix
and related to this: if your django site needs to be running at someplace besides '/' (say for a beta installation or a subsite) then permalinks and reverse will work correctly, but user.get_absolute_url() will not it will return /user/username/ rather than /subsite/user/username/ so, def _us

HTTPS Question...

2008-09-30 Thread mccomas . chris
We have an online application for school, where we request the individuals SSN and PharmCAS information. The application will be at say www.oursite.com/application/. Since we're gathering sensitive data, I want to obviously make this secure using https:// I don't want the rest of the site to be on

Re: Using mod_python with Lighttpd - advice on the best set up

2008-09-30 Thread Kip Parker
Sounds good, how did you get it to do that? On Sep 30, 1:03 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > Apache can also start/restart your FastCGI process(es) as needed. > > Erik > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Date from django to form and back again.

2008-09-30 Thread Peter
fromtimestamp is exactly the ticket. Thanks! On Sep 30, 6:16 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-09-29 at 14:08 -0700, Peter wrote: > > Hi folks, > >   I want to check a form when it submitted to see whether it contains > > an input called 'lastUpdate' > > >   If las

Re: ManyToMany relationship on self through other table

2008-09-30 Thread felix
post the traceback. I may not be able to help you since I haven't tried to do person-to-person at all. it might be simpler to just do Friends and Idols (without using through and without friends and idols being fields on Person) and then add methods to Person that fetch those relationships. or

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread bruno desthuilliers
On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> wrote: Partly answering to myself: (snip) > After a couple more tests and investigations, it appears that the > nested blocks have nothing to do with my problem. What really happens > is that, given > > - a context updating tag > - a base

Re: Using mod_python with Lighttpd - advice on the best set up

2008-09-30 Thread Erik Allik
Apache can also start/restart your FastCGI process(es) as needed. Erik On 30.09.2008, at 13:33, Graham Dumpleton wrote: > > > > On Sep 30, 8:24 pm, Kip Parker <[EMAIL PROTECTED]> wrote: >> After both your replies and some googling I'm starting to lean >> towards >> a FastCGI set up of some so

Re: accessing the http conf setting: PythonOption django.root

2008-09-30 Thread felix
ah right, WSGI requests won't have this django_root environ var. so its the completely non-intuitive SCRIPT_NAME (I know, its the server that refers to it as this) this works : {% django_root %} @register.tag def django_root(parser,token): return DjangoRootNode() class DjangoRootNode(tem

Re: DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Jens
I got the same message the other day and the solution was to put following line at the top (first line, befor everything else) of my models.py: #coding: utf8 worked for me, hope it'll work for you. Jens On 30 Sep., 13:07, Nick <[EMAIL PROTECTED]> wrote: > Hi, > > I've recently noticed that I'm

Re: Highlight current active page

2008-09-30 Thread Gerard Petersen
Steven, Sorry, I replied to the wrong message in this thread. Your setup is actually quite charming. Regards, Gerard. Steven Armstrong wrote: > Alex Rades wrote on 09/30/08 09:03: >> Hi, >> what kind of pattern do you use to add a class attribute to the >> current page being viewed? >> I mean

Re: Highlight current active page

2008-09-30 Thread Gerard Petersen
Hi All, I don't understand why it's needs to be so complicated. When using a 'double' template inheritance, e.g: base > base_products > product_add There's only one place where you have to maintain some navlist html/css code. This is where the 'active' attribute is maintained. So with multiple

Re: ManyToMany relationship on self through other table

2008-09-30 Thread chris
On Sep 30, 8:07 pm, felix <[EMAIL PROTECTED]> wrote: > are you actually getting a runtime error or an error when trying to > syncdb ? syncdb works fine, but then I get a runtime error when I want to edit such a record in the admin interface. The traceback complains about the two foreign keys

Re: Looking for an example on how to use us.forms.USZipCodeField

2008-09-30 Thread Adam Stein
Thanks for the information. I eventually stumbled across a web page that mentioned formfield_for_dbfield(). I wound up doing this: class AddressAdmin(admin.ModelAdmin): def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == "Zipcode": return USZipCodeFi

display of datefield breaks admin template

2008-09-30 Thread Gerard Petersen
Hi all, I'm trying to get my head around why the admin template breaks. I have a properly setup datefield in a product model. When I want to see a product list via the admin gui with the datefield name as part of the list_display declaration like so: class ProductAdmin(admin.ModelAdmin):

Re: DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Graham Dumpleton
Have you read the PEP it refers to? Graham On Sep 30, 9:07 pm, Nick <[EMAIL PROTECTED]> wrote: > Hi, > > I've recently noticed that I'm getting the following in my Apache > error log... > > DeprecationWarning: Non-ASCII character '\xc2' in file /var/www/django/ > newsite/web/models.py on line 10

Re: ManyToMany relationship on self through other table

2008-09-30 Thread felix
are you actually getting a runtime error or an error when trying to syncdb ? On Sep 30, 10:52 am, chris <[EMAIL PROTECTED]> wrote: > Hi there, > > Just starting to use django, so forgive me if this has been answered > before (a quick search at djanog-search did not turn up something > useful). >

DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Nick
Hi, I've recently noticed that I'm getting the following in my Apache error log... DeprecationWarning: Non-ASCII character '\xc2' in file /var/www/django/ newsite/web/models.py on line 101, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Line 101 in my models.

Re: Suggested approach for a date based form layout

2008-09-30 Thread Nick Lo
Hi Gerard, Actually part of my solution was and is using modelform but that was really just for the convenience of save(). I've got a solution together now but thanks for your response, Nick > > Nick, > > I'm not a longtime Django user, but I would check de django docs on > "modelform". Th

Re: Using mod_python with Lighttpd - advice on the best set up

2008-09-30 Thread Graham Dumpleton
On Sep 30, 8:24 pm, Kip Parker <[EMAIL PROTECTED]> wrote: > After both your replies and some googling I'm starting to lean towards > a FastCGI set up of some sort. The only thing that worries me is > dealing with FastCGI crashes, I guess you need a process watcher for > each site/FastCGI instanc

Re: Using mod_python with Lighttpd - advice on the best set up

2008-09-30 Thread Kip Parker
After both your replies and some googling I'm starting to lean towards a FastCGI set up of some sort. The only thing that worries me is dealing with FastCGI crashes, I guess you need a process watcher for each site/FastCGI instance, what's that like to maintain in practice? On Sep 29, 8:53 pm, Pr

Re: trunk or 1.0?

2008-09-30 Thread chiggsy
> If you can hold off on adopting new features, using v1.0 > will be your safest bet. Thanks. At least i'll be able to have a baseline. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

ManyToMany relation and admin newforms

2008-09-30 Thread Jens
Hello django-users, after searching google and this group and not finding any helpful answers I hope you can help me. I am making an event-app which allows me to manage my own events I organize for me and my friends. I add my friends to the database. Then I create an event and choose which frien

  1   2   >