Must be a bug??? "ordering" error splits field

2007-04-04 Thread TaMeR
== CODE == class Meta: ordering = ('code') == ERROR = $ python manage.py validate data.postcode: "ordering" refers to "c", a field that doesn't exist. data.postcode: "ordering" refers to "o", a field that doesn't exist. data.postcode: "ordering" refers to "d", a fi

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread [EMAIL PROTECTED]
Thanks for your comments. I've had a dig around in the code for newforms -- and it appears that to make an error, it raises django.newforms.util.ValidationError -- the only thing I don't get is how it binds this to a form field -- any ideas as all it seems to take is one argument -- the error mess

Re: Must be a bug??? "ordering" error splits field

2007-04-04 Thread Russell Keith-Magee
On 4/5/07, TaMeR <[EMAIL PROTECTED]> wrote: > class Meta: > ordering = ('code') You have been bitten by a very common Python error: ('code') defines a string ('code',) defines a tuple containing a single element, that is a string. The comma is required for parsing purposes to disti

Re: create_object error

2007-04-04 Thread Malcolm Tredinnick
Marcelo, On Wed, 2007-04-04 at 17:46 -0300, Marcelo Ramos wrote: > After submitting a form using a generic view I get this error: > > Request Method: POST > [...] > Exception Type: ValueError > Exception Value: incomplete format > Exception Location: > /usr/lib/python2.3/s

Re: create_object error

2007-04-04 Thread Malcolm Tredinnick
Hey Marcelo, On Thu, 2007-04-05 at 01:34 -0300, Marcelo Ramos wrote: [...] > Well, it seems to be just a syntax error: > > request.user.message_set.create(message=gettext("The %(verbose_name)s > was created successfully." % {"verbose_name": > model._meta.verbose_name})) > > Remove the ) after s

Re: create_object error

2007-04-04 Thread Marcelo Ramos
2007/4/4, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > Hi Marcelo, > > On Wed, 2007-04-04 at 17:46 -0300, Marcelo Ramos wrote: > > After submitting a form using a generic view I get this error: > > > > Request Method: POST > > [...] > > Exception Type: ValueError > > Exception Value:

Re: Another Django CMS customization question

2007-04-04 Thread Mike Axiak
Hey Josh, I have written an CMS in django, and so have others. One of your major problems seems to be in the argument against using another template language for page rendering. Most people I have spoken to chose a lightweight markup language (markdown, ReST, WikiText,...) to do the actual page e

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread queezy
Ah, the light just went on (finally!). I will put the http variable in where pdfbytes is found. Thanks Malcolm! Cheers! -Warren - Original Message - From: "Malcolm Tredinnick" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 04, 2007 6:50 PM Subject: Re: Django app serves PDFs bu

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread queezy
Hi Malcolm! I'm sorry that this seems so obvious but when I use the following line ( response = HttpResponse(pdfbytes, mimetype='application/pdf') ) the error is that pdfbytes is undefined and I'm just not sure how to define it. I realise that the error is telling me what is wrong, but I don'

Re: Django IDE

2007-04-04 Thread ZebZiggle
I've been using it for a couple of years now. I'm still using 3.x, can't comment on 4.x. The debugging is pretty bad and doesn't really work as advertised, but the editor is solid (can run into resource leaks on low mem computers). The browser is good, the project mgmt is good. Overall, I'm happy

Re: Sorting multiple models - Tumblelog

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 20:01 -0700, Chris H. wrote: > In developing my new personal website using Django, one thing I am > doing is replicating much of my data into my own domain. Things such > as photos from flickr, links from del.icio.us and current tracks from > last.fm. I'd also like to inco

Sorting multiple models - Tumblelog

2007-04-04 Thread Chris H.
In developing my new personal website using Django, one thing I am doing is replicating much of my data into my own domain. Things such as photos from flickr, links from del.icio.us and current tracks from last.fm. I'd also like to incorporate a tumblelog which will aggregate this information (

Re: Django and Eclipse Autocomplete NOT WORKING

2007-04-04 Thread Jon Ballard
On Apr 4, 9:13 pm, "Jon Ballard" <[EMAIL PROTECTED]> wrote: > Looks like maybe PyDev can't follow symbolic links in PYTHONPATH. For > example I'm using SVN version and couldn't get django module code > completion working until I added this to my PyDev PYTHONPATH: > /usr/lib/django_src/ Oh, yep,

Re: Django and Eclipse Autocomplete NOT WORKING

2007-04-04 Thread Jon Ballard
Sorry, following up an old post, but maybe it will help somebody. Looks like maybe PyDev can't follow symbolic links in PYTHONPATH. For example I'm using SVN version and couldn't get django module code completion working until I added this to my PyDev PYTHONPATH: /usr/lib/django_src/ I have a d

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 18:46 -0700, queezy wrote: > Hi Malcolm! > > Actually I tried the following (and gave Ned credit for solving half of my > problem): > > from django.http import HttpResponse > from django.shortcuts import render_to_response > import urllib > > def front(request): > soc

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread queezy
Hi Malcolm! Actually I tried the following (and gave Ned credit for solving half of my problem): from django.http import HttpResponse from django.shortcuts import render_to_response import urllib def front(request): sock = urllib.urlopen("/home2/a12007/webapps/officeprofiler/profiler/temp

Re: Another Django CMS customization question

2007-04-04 Thread James Bennett
On 4/4/07, Joshua <[EMAIL PROTECTED]> wrote: > The specific task I have in front of me is to build a CMS that can be > customized for different sites and different "views" (templates) while > allowing a CMS admin user to add pages to a site - much like the > radiantCMS built with Rails (http://ra

Re: Django IDE

2007-04-04 Thread grahamu
Sure, works great. My favorite (and perhaps most useful) feature is debugging a Django app and stepping through both my code and the Django code to find out what is happening. Graham On Apr 4, 6:56 pm, "Richard Blumberg" <[EMAIL PROTECTED]> wrote: > Has anyone had any experience using Komodo as a

Re: Another Django CMS customization question

2007-04-04 Thread Adam Fast
Josh, My first question would be if you've checked into flatpages yet. If I'm reading what you're asking, it solves the problem almost entirely. And, it's quite simple and you can use it to build more structure on if you need more features than it offers. http://www.djangoproject.com/documenta

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 17:31 -0700, queezy wrote: > Hi! > > Sorry it took a while - I had to get the info from work. > > Renderer mode: Quirks mode > Cache source: Not cached > Encoding: UTF-8 > > The other stuff was blank. > > My view is as follows: > > == SNIP == > from djan

Re: Templates inheritance and the passing of variables

2007-04-04 Thread Malcolm Tredinnick
On Thu, 2007-04-05 at 00:05 +, Roboto wrote: > Hey guys, just a quick question here: > > I have a base template called base.html. Essentially all it holds are > blocks to be filled in by child templates and it contains a menu which > is common to all templates but it is also in block in case

Re: Where to place ForeignKey?

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 16:47 -0700, TaMeR wrote: > I have done something like this before with php & mysql creating all > my own sql statements but I am getting a bit confused with the > ForeignKey and ManytoMany fields. > I like to create following models: > > Organizations: May be the users Comp

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 14:41 -0700, [EMAIL PROTECTED] wrote: > Hey All, > > I'm trying to use newforms to create a form to login on my site > (there's some stuff in the userprofile which prevents me from using > ths standard django.contrib.auth.views.login view) > > I nearly have everything set u

Re: create_object error

2007-04-04 Thread Malcolm Tredinnick
Hi Marcelo, On Wed, 2007-04-04 at 17:46 -0300, Marcelo Ramos wrote: > After submitting a form using a generic view I get this error: > > Request Method: POST > [...] > Exception Type: ValueError > Exception Value: incomplete format > Exception Location: > /usr/lib/python2.

Django IDE

2007-04-04 Thread Richard Blumberg
Has anyone had any experience using Komodo as an IDE for Django development? Thanks. --~--~-~--~~~---~--~~ 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@googlegroup

Re: Templates inheritance and the passing of variables

2007-04-04 Thread akonsu
hello, {{block.super}} renders the block contents of the parent, but this might not be enough for what you want. konstantin On Apr 4, 8:05 pm, "Roboto" <[EMAIL PROTECTED]> wrote: > Hey guys, just a quick question here: > > I have a base template called base.html. Essentially all it holds are >

Re: loaddata against postgresql doesn't update primary key's sequence 'last_value' ?

2007-04-04 Thread Russell Keith-Magee
On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I think you can fix it by running something like: > > $ python manage.py sqlsequencereset | psql mydbname Correct. I'll be merge something similar to that into the loaddata code. > When you load data with the primary keys already set it

Re: Django app serves PDFs but browser doesn't render them

2007-04-04 Thread queezy
Hi! Sorry it took a while - I had to get the info from work. Renderer mode: Quirks mode Cache source: Not cached Encoding: UTF-8 The other stuff was blank. My view is as follows: == SNIP == from django.http import HttpResponse from django.shortcuts import render_to_response i

Problem with form caching data

2007-04-04 Thread Luciano Adamiak
Hi everyone... I'm having an strange behavior with a form. It's a simple sign-up form. When I call the page using the url http://xxx/membro/cadastro/3/ the form show the data for de mebro.id=3, so after that, if I call the page using the url http://xxx/membro/cadastro/ the form should not show a

Re: Path/Environment problem (may be Mac-specific)

2007-04-04 Thread Will McCutchen
On Apr 4, 1:16 pm, "Richard Blumberg" <[EMAIL PROTECTED]> wrote: > ImportError: No module named django.db > > I can't figure out why it works from the standard python shell but not from > within BBEdit. Perhaps this is a question for the BBEdit list rather than > the Django list, but if anyone her

Templates inheritance and the passing of variables

2007-04-04 Thread Roboto
Hey guys, just a quick question here: I have a base template called base.html. Essentially all it holds are blocks to be filled in by child templates and it contains a menu which is common to all templates but it is also in block in case I ever needed to override it in the future So I have a vi

Where to place ForeignKey?

2007-04-04 Thread TaMeR
I have done something like this before with php & mysql creating all my own sql statements but I am getting a bit confused with the ForeignKey and ManytoMany fields. I like to create following models: Organizations: May be the users Company or one of many clients People: May be a users info or o

Another Django CMS customization question

2007-04-04 Thread Joshua
Hello all, I am completely new to the Django project and have some initial questions that I hope someone can answer for me. I have searched this group and the internet looking for this information, however, I seem unable to find answers. First, a little background info. After giving rails a sho

Re: Hacking admin changes

2007-04-04 Thread Kent Johnson
Kent Johnson wrote: > Enrico wrote: >> Can't you just override the 'save' method of your model? > > Maybe I can. I think I once had a reason not to do that but I can't > remember it :-) Yes, this is fine, thanks for nudging me in the right direction. Kent --~--~-~--~~

HOWTO: displaying a picasa web album in django

2007-04-04 Thread Timothy.Broder
Was looking into this for my own site and did a write up of my findings: http://timothybroder.blogspot.com/2007/03/using-python-to-display-picasa-web.html hope this can help someone =) --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Adding an error to an empty error list with newforms?

2007-04-04 Thread anders conbere
If you're using custom forms it's often times much easier to do validation within the forms class using the clean_xxx() methods. I know this isn't the question you're asking, but I feel like that should be thrown out there. ~ Anders On 4/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hey

Re: Hacking admin changes

2007-04-04 Thread Kent Johnson
Aidas Bendoraitis wrote: > I would have written a request_middleware instead of what you did. I > think, it would be cleaner. The middleware would have to inspect each request to find the ones it actually cares about. It seemed cleaner to me to use the url dispatch to do this for me. Thanks, K

Re: Hacking admin changes

2007-04-04 Thread Kent Johnson
Enrico wrote: > Can't you just override the 'save' method of your model? Maybe I can. I think I once had a reason not to do that but I can't remember it :-) Thanks, Kent --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Adding an error to an empty error list with newforms?

2007-04-04 Thread [EMAIL PROTECTED]
Hey All, I'm trying to use newforms to create a form to login on my site (there's some stuff in the userprofile which prevents me from using ths standard django.contrib.auth.views.login view) I nearly have everything set up just as I'd like it.. but it seems that when newforms validators have pe

Re: On more efficient use of QuerySets

2007-04-04 Thread Rob Hudson
James Bennett wrote: > The 'select_related' method[1] may be what you're looking for; it > selects related objects up-front in the same query, so that later > access doesn't go back and hit the DB again. Yes, I'm doing this where it makes sense. What I'm looking for is whether there is a way to

Re: Accessing custom model methods from template

2007-04-04 Thread James Earl
Oops, you're right! Thanks! James akonsu wrote: > hello, > > {{item.image}} is correct. > > konstantin > > On Apr 4, 2:15 pm, "James Earl" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm pretty new to python and django. I have a list of items that I'm > > displaying, and each item can have zero

Re: Pickling error in Django using Apache2

2007-04-04 Thread Jeremy Dunck
On 4/4/07, paceman <[EMAIL PROTECTED]> wrote: ... > > > "/var/lib/python-support/python2.4/django/contrib/sessions/models.py", > > > line 10, in encode pickled = pickle.dumps(session_dict) PicklingError: > > > Can't pickle : it's not the same object as > > > psycopg2.tz.FixedOffsetTimezone > *

create_object error

2007-04-04 Thread Marcelo Ramos
After submitting a form using a generic view I get this error: Request Method: POST [...] Exception Type: ValueError Exception Value:incomplete format Exception Location: /usr/lib/python2.3/site-packages/django/views/generic/create_update.py in create_object, line

Re: Hacking admin changes

2007-04-04 Thread Aidas Bendoraitis
I would have written a request_middleware instead of what you did. I think, it would be cleaner. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, Enrico <[EMAIL PROTECTED]> wrote: > > Can't you just override the 'save' method of your model? > > Or maybe use a 'pre_save' or 'post_save' signa

Re: Hacking admin changes

2007-04-04 Thread Enrico
Can't you just override the 'save' method of your model? Or maybe use a 'pre_save' or 'post_save' signal. --~--~-~--~~~---~--~~ 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: loaddata against postgresql doesn't update primary key's sequence 'last_value' ?

2007-04-04 Thread Jon Ballard
> I think you can fix it by running something like: > > $ python manage.py sqlsequencereset | psql mydbname > > When you load data with the primary keys already set it doesn't update > the postgres sequence generator. There's a ticket about how this > affects fixture loading: > > http://code.djan

Per-object-permission branch and Many-to-many relationship issue

2007-04-04 Thread Aidas Bendoraitis
Hello! I am using per-object-permission branch and experiencing the same problem, mentioned in the closed ticket #2201: can't get the many-to-many-related objects from the side of the model which defines the many-to-many relation, although no problem vice versa. Let's say I have class Category(

Hacking admin changes

2007-04-04 Thread Kent Johnson
In my application I want to intercept changes made through the admin interface so I can make additional changes based on the changes made by the user. In other words, if the request has a new value for attribute 'foo', I want to compute a new value for attribute 'bar' and add that to the request.

Re: On more efficient use of QuerySets

2007-04-04 Thread James Bennett
On 4/4/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > What would be more efficient would be if I could get all responses for a > particular user, then pluck the particular variables out of that data > set as/when I need them. 1 SQL call. Is that possible? Are there > memory tradeoffs? There could

Pickling error in Django using Apache2

2007-04-04 Thread paceman
I am experiencing a pickling error when accessing Django web pages via Apache2 in authorized sessions. I am currently using: Debian Distribution - Etch Django - 0.95.1-1 Apache2 - 2.2.3-4 Apache2-mpm-prefork - 2.2.3-4 Libapache2-mod-python - 3.2.10-3 Using the Django session and authorization f

Re: Securing the admin site

2007-04-04 Thread John DeRosa
trickyb wrote: > This is a somewhat open-ended question: what are people doing to > secure their admin sites against unwelcome visitors? On my site, what > I've done is change the URL root from /admin/ to something else so > that casual visitors do not know where to look. Richard, To change the

Re: Accessing custom model methods from template

2007-04-04 Thread akonsu
hello, {{item.image}} is correct. konstantin On Apr 4, 2:15 pm, "James Earl" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm pretty new to python and django. I have a list of items that I'm > displaying, and each item can have zero, one or many images. I want > to display the first image if one exis

Path/Environment problem (may be Mac-specific)

2007-04-04 Thread Richard Blumberg
I've gotten used to using BBEdit as a kind of rough-and-ready IDE for python. Now I'm trying to develop a Django project, and I've run into a peculiar problem. I have a program called 'initialize', with which I want to populate a django database table with data from a tab-delimited file. My proj

Accessing custom model methods from template

2007-04-04 Thread James Earl
Hi, I'm pretty new to python and django. I have a list of items that I'm displaying, and each item can have zero, one or many images. I want to display the first image if one exists. I soon found out that I can't do stuff like test: item.images.all().count() in the templates, so I thought I'd

Re: Django Powered Tabblo to be acquired by HP

2007-04-04 Thread bedros
thanks a lot, eventually I'll try bunch of javascript libraries, but I thought I'll save time by limiting my choices to few. On Apr 4, 11:40 am, Ned Batchelder <[EMAIL PROTECTED]> wrote: > We use a number of libraries. We have prototype and scriptaculous, and > have been making a lot of use of YU

media urls in templates

2007-04-04 Thread akonsu
hello, i need a way to emit media url in a template. something similar to the {% url %} tag but for media. curently django site itself is in violation of the DRY principle: http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/base.html (line 18 for example) i guess i

On more efficient use of QuerySets

2007-04-04 Thread Rob Hudson
Fellow Djangonauts, Here at my work[1] we've built a number of web-based educational websites in Django now. I'm analyzing the number of SQL calls and am realizing that the number is higher than I'd like. My main question is around whether or not I can do a bulk query to get most of the data

Re: loaddata against postgresql doesn't update primary key's sequence 'last_value' ?

2007-04-04 Thread [EMAIL PROTECTED]
On Apr 3, 10:28 pm, "Jon Ballard" <[EMAIL PROTECTED]> wrote: > Hello everybody, I'm new. Django is the bomb.. my app is coming > together quickly. > > Now to my issue.. > > I dumped my database to json and tried to ingest it back in. Seemed > to work fine at first -- everything was there -- but

Re: capturing urls from previous views

2007-04-04 Thread canen
Tipan, Are you talking about the refer url? This should be available if you use RequestContext as your context for the new view. See the request/ response object docs http://www.djangoproject.com/documentation/request_response/ On Apr 4, 11:09 am, "Tipan" <[EMAIL PROTECTED]> wrote: > I need to

Re: Showing images in Django Admin

2007-04-04 Thread oggie rob
For a list display, it can be very simple. Write a method within the model that returns an "img" html tag, and use the "allow_tags" decorator on that method (just like you would for short_description). Then add that method to your list_display variable in Admin. I did this for thumbnails. I haven

capturing urls from previous views

2007-04-04 Thread Tipan
I need to capture the url from the previous view to use after processing the new view - I expect there's a simple way of doing this, but I'm not sure of the best approach. I'm thinking about writing to a session cookie or stack when arriving at a view and then recall it when I get to the new view.

Re: create/drop individual table

2007-04-04 Thread Nathan R. Yergler
There's no Django magic there; just do it like you normally would using your database. On 4/4/07, John <[EMAIL PROTECTED]> wrote: > > Hi, new to django, getting familiar w/ it. So far, love what I've > seen. One question: how do I create/drop an individual table, > preferably not from the manage.

create/drop individual table

2007-04-04 Thread John
Hi, new to django, getting familiar w/ it. So far, love what I've seen. One question: how do I create/drop an individual table, preferably not from the manage.py shell? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

newform processing - template tags and multiple views - Confusion

2007-04-04 Thread Tipan
I want to incorporate a user login form on virtually all of my sites main pages. I felt that the best way to do this was to use an inclusion template tag to display the form on each of the relevant pages. I have a base.html template which is extended using several sub templates. The template tag

Help!!!

2007-04-04 Thread sidewalk22
Click the banner and vote for my band to play Warped Tour '07 this summer! Thanks http://www.battleofthebands.com/profile.php? auth=00017567ef396161055b4b6be462d8fef14bd3c17567&path=vagrantdownfall">http://www.battleofthebands.com/photos/bb0030/30099.jpg";> http://www.battleofthebands.com/pl

Re: Showing images in Django Admin

2007-04-04 Thread Edwin W
The django filebrowser admin extension may be close to what you're looking for, it will display thumbnails of images on a filesystem being browsed. I'm not sure how it integrates with the models though, haven't tried it myself. You'll need PIL as pointed out on the website. http://trac.dedhost-

Re: Curious error with Session Variables

2007-04-04 Thread chasfs
There are several things going on here. If you have multiple django sites all setting sessions cookies, make sure that the SESSION_COOKIE_NAME and SESSION_COOKIE_DOMAIN are unique in the respective settings.py files. You also need to clean out old session rows in the django_session database. You

Maintaning a private branch of Django

2007-04-04 Thread Ramiro Morales
Hi, Just wanted to share some notes I've just finished writing (for my own future reference) and translating to English: http://seeonee.homeip.net:81/intdoc/DjangoPost096 It describes how I maintain a private branch Django based mostly in 0.96 with some cherrypicked changesets backported from t

Re: Error building an sqlserver database

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 07:02 -0700, maurizio wrote: > I succesfully managed to build an sqlite 3 db, now i'm trying to buil > an sql server db. > Issuing the command : > python manage.py syncdb > I get the following error : [...] > > I'm using python2.5 on win2k, > pywin32-210.win32-py2.5 > adodba

Re: Error building an sqlserver database

2007-04-04 Thread Sean De La Torre
Maurizio, Take a look at this patch: http://code.djangoproject.com/ticket/2358 Sql Server will not work unless the patch is applied. Sean On 4/4/07, maurizio <[EMAIL PROTECTED]> wrote: > > > I succesfully managed to build an sqlite 3 db, now i'm trying to buil > an sql server db. > Issuing the

Error building an sqlserver database

2007-04-04 Thread maurizio
I succesfully managed to build an sqlite 3 db, now i'm trying to buil an sql server db. Issuing the command : python manage.py syncdb I get the following error : D:\dati\PERSON~1\PROVEP~1\newwin>python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in execu

Re: Ordered list of objects?

2007-04-04 Thread Nathan R. Yergler
On 4/4/07, Atilla <[EMAIL PROTECTED]> wrote: > > On 04/04/07, Nathan R. Yergler <[EMAIL PROTECTED]> wrote: > > > > I'm working on an app for a client, and one of the requirements is > > that they be able to re-order objects in the admin interface. I know > > exactly how I'd do with with an object

Re: Using url in a view

2007-04-04 Thread Chris Moffitt
> > Oh, I see what you're asking now. There's no built-in way to do that. Ok. Do you think this would be a useful feature. I don't know if I can create the patch but at a minimum I can put in a ticket so it doesn't get lost. -Chris --~--~-~--~~~---~--~~ You re

Re: Differentiate addition or change during post_save signal

2007-04-04 Thread David Larlet
2007/4/4, Aidas Bendoraitis <[EMAIL PROTECTED]>: > > You can have a pre_save signal for adding property > instance._is_new=True if the instance has no id. And then to delete > that property in the post_save signal after checking it. Thanks for your answer, it's a bit complicated because I need to

Showing images in Django Admin

2007-04-04 Thread brian corrigan
Hi all, I have a django model and want to include an image field. Is there a way of displaying this field in the admin templates as an image (not the string path of the image) or do I have to write my own template for that? Cheers Brian --~--~-~--~~~---~--~~ Yo

Re: Django Powered Tabblo to be acquired by HP

2007-04-04 Thread Ned Batchelder
We use a number of libraries. We have prototype and scriptaculous, and have been making a lot of use of YUI as well. In terms of Django integration, we use the libraries less as an automatic remote object methodology and more as an ad-hoc protocol between the browser and the server, so we real

Re: edit_inline causing problems with multiple relations

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 01:13 -0700, mh wrote: > > I thought we fixed this a bit before 0.96 was released. Are you using > > the latest release or some older code? > > Upgraded to 0.96 before I posted here, hoping it'd fix it but it > didn't :/. Hmmm. :-( That's annoying. Could you drop your mode

Re: edit_inline causing problems with multiple relations

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 18:33 +0800, Russell Keith-Magee wrote: > On 4/4/07, mh <[EMAIL PROTECTED]> wrote: [...] > > > GenericRelations exist for this kind of relationship. GenericRelations > > > aren't completely stable or documented, and they aren't fully > > > supported in the Admin, but they do

Re: Django app initialisation

2007-04-04 Thread Malcolm Tredinnick
On Wed, 2007-04-04 at 10:10 +, Andrew Durdin wrote: > I've got a situation where one of my django apps needs to perform some > initialisation that includes processing the models from all the > installed apps -- and it needs its own models to have been initialised > also. Because of this, I ca

Re: Using a ForeignKey in ordering

2007-04-04 Thread Aidas Bendoraitis
correcting myself: a) Page.objects.order_by('menuitem__name') --> Page.objects.select_related().order_by('menu_menuitem.name') Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > As far as I know, currently it's impossible to sort items according

Re: Using a ForeignKey in ordering

2007-04-04 Thread Aidas Bendoraitis
As far as I know, currently it's impossible to sort items according the fields of the related model in the contributed administration. If that's your business requirement, then you have the following hacking options: a) write a custom view which will override the default admin list where you coul

Re: edit_inline causing problems with multiple relations

2007-04-04 Thread Russell Keith-Magee
On 4/4/07, mh <[EMAIL PROTECTED]> wrote: > > > the top of my head, but I do know that problems with edit_inline and > > manipulators is one of the many reasons that we are introducing > > newforms. > > Good to know. I see there's a branch dedicated to porting the admin to > newforms, but sadly the

Django app initialisation

2007-04-04 Thread Andrew Durdin
I've got a situation where one of my django apps needs to perform some initialisation that includes processing the models from all the installed apps -- and it needs its own models to have been initialised also. Because of this, I can't do my initialization when the app's __init__ module is loade

Re: Using a ForeignKey in ordering

2007-04-04 Thread James Turnbull
Thanks Atilla, > There was a simmilar question a couple of days ago: >class Meta: >ordering = ['name'] I did read this thread but it appears to only be useful for sorting the MenuItem objects when viewed through a drop down or some such. What I want to do is sort the Page object

Re: built-in comment system with custom views

2007-04-04 Thread Atilla
On 03/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > > I was following tutorial on django built-in comment system in wiki on > djangoproject.com; Everything went fine, however, I can't figure out > how to use them with custom views, I keep getting different errors. > Tutorial exa

Re: Using a ForeignKey in ordering

2007-04-04 Thread Atilla
On 04/04/07, James Turnbull <[EMAIL PROTECTED]> wrote: > > I'm trying to group items in the Admin interface based on a foreign > key, and I'm hitting a few stumbling blocks. > > Simplified objects are... > > > class MenuItem(models.Model): > > name = models.CharField(maxlength=200) > > > > cla

Using a ForeignKey in ordering

2007-04-04 Thread James Turnbull
I'm trying to group items in the Admin interface based on a foreign key, and I'm hitting a few stumbling blocks. Simplified objects are... > class MenuItem(models.Model): > name = models.CharField(maxlength=200) > > class Page(models.Model): > name = models.CharField(maxlength=200) >

Re: Differentiate addition or change during post_save signal

2007-04-04 Thread Aidas Bendoraitis
You can have a pre_save signal for adding property instance._is_new=True if the instance has no id. And then to delete that property in the post_save signal after checking it. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, David Larlet <[EMAIL PROTECTED]> wrote: > > Hi, > > I'd like to k

Differentiate addition or change during post_save signal

2007-04-04 Thread David Larlet
Hi, I'd like to know if it's possible to make the difference between addition and change for the post_save signal. For the moment I use something like that: def log_modification(sender, instance, signal): try: print sender.objects.get(id=instance.id) LogEntry.objects.log_acti

Re: Per-app permissions ?

2007-04-04 Thread Atilla
On 03/04/07, Chris Brand <[EMAIL PROTECTED]> wrote: > > What's the best way to restrict access on a per-app basis ? > I want to have two apps, with some users allowed access to one, others > allowed access to the other, and some allowed access to both. > > Any advice would be very much appreciated

Re: Ordered list of objects?

2007-04-04 Thread Atilla
On 04/04/07, Nathan R. Yergler <[EMAIL PROTECTED]> wrote: > > I'm working on an app for a client, and one of the requirements is > that they be able to re-order objects in the admin interface. I know > exactly how I'd do with with an object database, but the ideas I've > come up with for doing it

Re: edit_inline causing problems with multiple relations

2007-04-04 Thread mh
> the top of my head, but I do know that problems with edit_inline and > manipulators is one of the many reasons that we are introducing > newforms. Good to know. I see there's a branch dedicated to porting the admin to newforms, but sadly there doesn't seem to have been that much activity in the

Re: edit_inline causing problems with multiple relations

2007-04-04 Thread mh
> I thought we fixed this a bit before 0.96 was released. Are you using > the latest release or some older code? Upgraded to 0.96 before I posted here, hoping it'd fix it but it didn't :/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Django Powered Tabblo to be acquired by HP

2007-04-04 Thread [EMAIL PROTECTED]
On Apr 4, 6:18 am, "bedros" <[EMAIL PROTECTED]> wrote: > nice work; I've always been impressed by Django; and Tabblo website > gives a more convincing reason to use Django. > > But, I'm still not sure on javascript/ajax library to use with > Django... so my question which ajax kit did you use with

dilling down with generic views

2007-04-04 Thread Tim Tsai
I am learning Django and my first program is a drill-down type page similar to what I see at http://chicagocrime.org. I am using generic views and have run into confusion about how to handle a URL like this: http://www.chicagocrime.org/types/armed_violence/245/ I have two models, programs

Re: request object out of a view (I need to access session['data'])

2007-04-04 Thread Adrian Ribao
Ok Thank you very much both of you, and sorry about missunderstanding what James said. I understand it now. I'll try it as soon as I arrive home. Thank you. 2007/4/3, Karen Tracey <[EMAIL PROTECTED]>: > > I'll try to elaborate what James said. (Did you consult the documentation > links he pointed