Re: Manipulators problem -- anyone? please help!

2006-10-06 Thread Carlos Yoder
Here you go Gábor, it's three views. my_data(request) find out what to do (change or add), and calls the proper view, either userprofile_add or userprofile_change. Hope the python code is not too ugly! Thanks a million for taking the time to help, köszönöm szépen! def my_data(request):

Re: Manipulators problem -- anyone? please help!

2006-10-06 Thread Carlos Yoder
ATTENTION ATTENTION ATTENTION! I fixed it! Brownie points to Raj for pointing to the right direction, so boys and girls, when you're trying to pass a PK (such as user.id for a OneToOne field exntending the User model) via a form, make sure you do it as follows: and NOT something like: ...

Re: long-running process. how to do it?

2006-10-06 Thread Holger Schurig
> I wrote a daemonize method that can be called by the view to > spawn a new process that executes your code. Looks very similar to django.utils.daemonize :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Manipulators problem -- anyone? please help!

2006-10-06 Thread patrickk
don´t know if this might help, but: let´s say you have this in your manipulator: def save(self, data): temp = UserExtendedProfile( user = data['user'], ) temp.save() you could also use this: def save(self, data): temp

Re: Manipulators problem -- anyone? please help!

2006-10-06 Thread Carlos Yoder
Patrick, thanks for your reply. I had actually tried similar methods to what you wrote -- the trouble was with using the default Manipulators, since they need the passed request collection to have the proper names, and since I was "injecting" my PK via a template, the trouble was there... no idea

Re: HTML entities

2006-10-06 Thread Holger Schurig
> > Oh, I just noticed this with Konqueror from KDE 3.5.4: you can have this meta line in your base.html template as long as you want. When you use "./manage.py runserver", it won't be honored, the value from DEFAULT_CHARSET from settings.py takes precedence. --~--~-~--~~-

Re: Form/manipulator advanced tutorial?

2006-10-06 Thread Peter Klein
Hi Malcolm, > It's slightly lame justification, but one of the reasons there isn't an > advanced tutorial in this area is that we have been intending to replace > the current manipulator stuff for quite a few months now. Writing a > detailed tutorial takes a long time and, at least in my case, I

Re: Apache authentication: AttributeError: 'module' object has no attribute 'auth'

2006-10-06 Thread [EMAIL PROTECTED]
Hi.. thanks for your replies guys. You're probably right... I'm running mod_python from the Ubuntu dapper repositories which currently has version 3.1.4. Unfortunately the Edgy package (which is 3.2.8) depends on a newer version of libc6 which means that I really don't want to upgrade the package

Re: Serialization on part of a model

2006-10-06 Thread Nikolaus Schlemm
> I submitted http://code.djangoproject.org/ticket/2701 which provides a > small patch to limit by field for the serializers module. Something > like -- serializers.serialize('xml', stories, fields=('headline', > 'name')) excellent, definetely a "+1" from me! -- cheers, Nikl --~--~---

Odd self referencing behavior

2006-10-06 Thread fasces
I'm trying to run a simple model where a class references a member in itself, and I keep getting validation errors. I can't for the life of me figure out what's wrong. I'm using .95. ---site.Sect.py--- from django.db import models class Sect (models.Model): shortName = models.CharField(maxle

Re: HTML entities

2006-10-06 Thread Dirk Eschler
Am Freitag, 6. Oktober 2006 09:48 schrieb Holger Schurig: > > > > > Oh, I just noticed this with Konqueror from KDE 3.5.4: you can > have this meta line in your base.html template as long as you > want. When you use "./manage.py runserver", it won't be honored, > the value from DEFAULT_CHARSET

Re: Odd self referencing behavior

2006-10-06 Thread fasces
Works fine with the svn version, so I'm quite sure you guys are aware of it. Must be why you recommend it. Sorry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: Pydev and Django

2006-10-06 Thread Malcolm Tredinnick
On Fri, 2006-10-06 at 06:07 +, olive wrote: > Fabio, > > I'm using Django 0.95 and the console says : > > manage.py: error: no such option: --noreload > > Do I need a fresh SVN copy ? Strange. Russell add the "noreload" option back in July (http://code.djangoproject.com/changeset/3348 ) an

Re: Form/manipulator advanced tutorial?

2006-10-06 Thread Malcolm Tredinnick
On Fri, 2006-10-06 at 02:02 -0700, Peter Klein wrote: > Hi Malcolm, > > > > It's slightly lame justification, but one of the reasons there isn't an > > advanced tutorial in this area is that we have been intending to replace > > the current manipulator stuff for quite a few months now. Writing a

Re: Odd self referencing behavior

2006-10-06 Thread Malcolm Tredinnick
On Fri, 2006-10-06 at 04:19 -0700, fasces wrote: > I'm trying to run a simple model where a class references a member in > itself, and I keep getting validation errors. I can't for the life of > me figure out what's wrong. I'm using .95. > > ---site.Sect.py--- > from django.db import models > >

Re: Odd self referencing behavior

2006-10-06 Thread fasces
Code posted for reference. class Sect (models.Model): shortName = models.CharField(maxlength=30) superSect = models.ForeignKey(to='self', related_name="shortName", null=True) ---in bash--- $ python manage.py validate site site.sect: Accessor for field 'superSect' clashes with field 'Sec

Meta Data - How is it used effectively.

2006-10-06 Thread MerMer
I'm trying to get my head around what Meta Data is - and more importantly how to use it effectively. I've read that it is "anything in the data model that's not a field, such as ordering options etc" but I still don't quite get it. Specifically. 1. Are we constrained to those Meta Options liste

Re: Pydev and Django

2006-10-06 Thread Łukasz Langa
olive: > Fabio, > > I'm using Django 0.95 and the console says : > > manage.py: error: no such option: --noreload > > Do I need a fresh SVN copy ? > > Olivier. Here is a command that works for me: manage.py runserver 8080 --noreload Do you happen to forget the "runserver" part? The port is optio

Re: Meta Data - How is it used effectively.

2006-10-06 Thread Malcolm Tredinnick
On Fri, 2006-10-06 at 05:03 -0700, MerMer wrote: > I'm trying to get my head around what Meta Data is - and more > importantly how to use it effectively. > > I've read that it is "anything in the data model that's not a field, > such as ordering options etc" but I still don't quite get it. > > S

Re: Pydev and Django

2006-10-06 Thread olive
You are right Malcolm, My project's PYTHONPATH was not set and Eclipse global one was pointing to an old Django version used by another project. Now all is OK. THX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Django's target applications?

2006-10-06 Thread Serg Kovrov
Hello, I'm new to Django (and Python) and have a few general questions. Is Django meant to be used to create a sophisticated (as opposite to rapid) web applications such as (for example) forums or e-shops? With all bells and whistles, you know... Does applications written on top of Django framew

unable to find css when using '/'

2006-10-06 Thread Kenneth Gonsalves
hi, i have a server hosting several django apps. most of the live in domainname/web/, where '/web/' is the name of the app. In apache, there is an alias '/media/' to django.media and an alias 'site_media' to project/site_media. Works. I am now hosting a new project where there are a set of

Re: HTML entities

2006-10-06 Thread Dirk Eschler
Am Donnerstag, 5. Oktober 2006 23:11 schrieb Ivan Sagalaev: > Dirk Eschler wrote: > > In theory i can just use utf-8, but what if one participant in the line > > (os, db, browser, whatever) can't handle it? > > Talking about client side, only very old browsers can't handle utf-8 > (NN4 and IE4 can

Re: sharing session information with plone

2006-10-06 Thread ian
spacedman wrote: > > ashwoods wrote: >> does anybody have experience of sharing session information from a >> plone site. I want our intranet users that are authenticaded in plone >> to be able to access django without having to relog. > > Haven't done this directly, but what you'd have to do i

Re: show_all_rows = False returns db error message

2006-10-06 Thread schotm
Ok updated and everything is working fine. 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@googlegroups.com To unsubscribe from this g

Re: Django's target applications?

2006-10-06 Thread fasces
Alot of marketing firms go through great lengths to discredit different projects. With some of the RAD projects, they hit it right on the head. There are alot of "RAD" frameworks out there that are easy and fast TTM, but they don't scale and they lack the necessary weight in the right areas. Howev

Re: long-running process. how to do it?

2006-10-06 Thread Adam Blinkinsop
Couldn't you just fork a process (os.spawn*)? My vote is for an email queue -- analogous to a print queue. Do the entire producer/consumer thing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Meta Data - How is it used effectively.

2006-10-06 Thread MerMer
Malcom, Many thanks. That's a big help. MerMer --~--~-~--~~~---~--~~ 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 unsubscribe from this gro

"choices" option - possible bug?

2006-10-06 Thread MerMer
I have a field inside a model that uses the "choices" attribute:- rating=models.IntegerField(choices=RATING_CHOICES). This field is then being shown in the Class Admin list:- class Admin: list_display=('rating','promotion','review_headline','review_date','is_viewable') Using the above code,

Re: Serialization on part of a model

2006-10-06 Thread Daniel Roseman
Deryck Hodge wrote: > I submitted http://code.djangoproject.org/ticket/2701 which provides a > small patch to limit by field for the serializers module. Something > like -- serializers.serialize('xml', stories, fields=('headline', > 'name')) > > Perhaps you could try the patch attached to the tic

Re: Django's target applications?

2006-10-06 Thread Tim Chase
> or work with. Django provides an incredibly simple framework with a > multitude of options for different caching and other low level > implementation decisions (which it achieves through decoupled code) In addition to Fascis's good comments, if you google for django shared-nothing you

Re: "choices" option - possible bug?

2006-10-06 Thread RajeshD
Hi, Can you copy the definition of your RATING_CHOICES? Also, where is it defined in your models file? -Raj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Re: Django documentation search bar plugin for Firefox

2006-10-06 Thread Rob Hudson
I simply added a Firefox keyword search on the Django search box on the docs page. Now I type this into my URL: "dj template tags" and I get what 'm looking for. More info are smart keywords: http://www.mozilla.org/products/firefox/smart-keywords.html -Rob --~--~-~--~~

Re: long-running process. how to do it?

2006-10-06 Thread Corey Oordt
You, know I just found that utility last week. As far as just doing an os.spawn*, my recollection is that if your process ends, the spawned process ends, even if you are not waiting for it to return. In the case with a web server, as soon as you return from your view, the spawned process e

IE ignores Content-disposition on Apache but not development server

2006-10-06 Thread Steve M
I want my view to respond with a file for downloading, so that the browser pops up the download/file save dialog. I am using the 'Content-Disposition' header to specify the name of the file. When I use the django development server, it works perfectly in Firefox and IE6 (latest versions). When I s

comment framework: lookup question

2006-10-06 Thread patrickk
I´m currently trying to use the comment framework and I´m trying to retrieve the last 10 comments given for postings by a specific user. the lookup I´d like to have is: select * from comments join posting on comments.object_id = postings.id join user on posting.user_id = user.id more detailed

SSL Middleware

2006-10-06 Thread Antonio Cavedoni
Hello everyone, yesterday I came up with a Django middleware that has the potential to be actually useful! I called it SSL Middleware, and what it does is take a tuple of paths (HTTPS_PATHS in the settings file) and redirect all the http:// requests for paths starting with these values to

Caching bug?

2006-10-06 Thread Tom Smith
When I turn on caching... and use... CACHE_MIDDLEWARE_ANONYMOUS_ONLY= True ...then, if I am logged into the admin part of my site... all pages are not cached... Is this right? I'd prefer it if the Admin screens weren't cached but the rest were regards tom --~--~-~--~~

Re: Caching bug?

2006-10-06 Thread RajeshD
When you log on to the admin area, you are no longer anonymous -- The anonymous caching mechanism will therefore not cache any pages you access across your site until you logout of admin and become anonymous again. This is correct behaviour when CACHE_MIDDLEWARE_ANONYMOUS_ONLY is set to True. -

Re: Anybody know of an example of a Django app that uses a JavaScript module?

2006-10-06 Thread Tyson Tate
No JavaScript needed. -Tyson On Oct 2, 2006, at 6:43 PM, carlwenrich wrote: > What I want to do is call a JavaScript module with clickable images, > and then go to a Django view when a user clicks on an image. --~--~-~--~~~---~--~~ You received this message

Reload Admin interface after model changes

2006-10-06 Thread Matt
Hey. I'm a Django. I've got in installed and I've created a model and tested out the admin interface. Then I wanted to make some changes to the model and reload the change to the DB and the admin console. After searching around for a bit, I haven't found a good way to do this, although it appears

Re: Django's target applications?

2006-10-06 Thread Adrian Holovaty
On 10/6/06, Serg Kovrov <[EMAIL PROTECTED]> wrote: > Is Django meant to be used to create a sophisticated (as opposite to > rapid) web applications such as (for example) forums or e-shops? With > all bells and whistles, you know... Hello Serg, I'd encourage you to check out the list of the Djang

Re: Can I pre-populate fields in the admin interface?

2006-10-06 Thread Waylan Limberg
On 10/5/06, carlwenrich <[EMAIL PROTECTED]> wrote: > > Models: > > --- > class Week(models.Model): > beginning = models.DateField(core=True) > > def __str__(self): > return str(self.beginning) > > class Admin: > pass > > > class Day(models.Mo

Re: Django's target applications?

2006-10-06 Thread James Bennett
On 10/6/06, Serg Kovrov <[EMAIL PROTECTED]> wrote: > I'm asking because rapid web application development (RAD, RWAD?) is > indeed cool (and in real life deadlines are quite issues), but I'm more > interested in development of robust, maintainable, and scalable (mostly > big) applications. I'm se

Re: Django's target applications?

2006-10-06 Thread Paul Barry
The social networking site with ~1 millions users, are you referring to grono.net? The action of the login page is do-login.jsp and the Server header is "Apache-Coyote/1.1". Melt points to a MovableType blog. On 10/6/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 10/6/06, Serg Kovrov <[EMA

DB question: OR-ing LIKES

2006-10-06 Thread Tom Smith
I am trying to iterate through a list of strings to create... OR titile LIKE '%This%' OR title LIKE '%That%' q= Product.objects.filter( some stuff ) for word in words: q = q.filter( Q(title__icontains=word) ) return q[:10] ...but the contains Queries get AND-ed together... thank

ChangeManipulator

2006-10-06 Thread Steve Wedig
** Here is the general question ** How can I use a ChangeManipulator to validate a subset of a model's fields. ** Here is the specific situation ** I am using django.contrib.auth.models.User for my user accounts. I would like to create a change/edit form that lets the user change just their email

Re: DB question: OR-ing LIKES

2006-10-06 Thread RajeshD
> for word in words: > q = q.filter( Q(title__icontains=word) ) > Try something like this instead of the above: q_fragment = Q(title__icontains=words[0]) for word in words[1:] q_fragment = q_fragment | Q(title__icontains=word) q = q.filter(q_fragment) --~--~-~--~---

Re: customizing the admin interface

2006-10-06 Thread Paul Barry
I'm still trying to understand the purpose of the admin interface. I don't think STACKED does exactly what I want, but my question is more of a broad one. Is it meant to be used with a complex application? It seems to me that you can't make changes to the admin interface because you have no cont

Re: Django's target applications?

2006-10-06 Thread Antonio Cavedoni
On 6 Oct 2006, at 22:02, Paul Barry wrote: > The social networking site with ~1 millions users, are you referring > to grono.net? The action of the login page is do-login.jsp and the > Server header is "Apache-Coyote/1.1". Melt points to a MovableType > blog. I have no idea about grono.net, but

Storing UTC Time Zone Deviations In My Model?

2006-10-06 Thread [EMAIL PROTECTED]
All, In my locations model, I'm trying to add UTC time zone deviations. I have tried a number of things, but haven't had any success. I would appriciate any suggestions on how to solve this problem(Note: I'm using Postgresql + RLP Branch). Model: from django.db import models from django.co

fulltime Django job in Chicago (+ Scrum, testing)

2006-10-06 Thread Kumar McMillan
Hello. As a developer at a fast growing, online marketing firm in Chicago (Evanston to be precise) I'd like to announce that we are looking specifically for Django developers. If you are gainfully employed but know of someone who may be interested, please pass this on. We are unable to offer tel

Re: Django's target applications?

2006-10-06 Thread Paul Barry
The link on http://code.djangoproject.com/wiki/DjangoPoweredSites points to the blog. I guess that link should be updated. On 10/6/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote: > > On 6 Oct 2006, at 22:02, Paul Barry wrote: > > The social networking site with ~1 millions users, are you refer

Re: ChangeManipulator

2006-10-06 Thread RajeshD
> ** Here is the specific situation ** > I am using django.contrib.auth.models.User for my user accounts. I > would like to create a change/edit form that lets the user change just > their email address, and perhaps other fields. You would need to use a CustomManipulator here. You can even creat

Re: ChangeManipulator

2006-10-06 Thread RajeshD
> > Couple that with the generic model create/update view and you are set. Doh', strike that last sentence from my reply -- generic create/update views use automatic manipulators and not custom ones. So, you will need your own view to go with this. --~--~-~--~~~---~

'bool' object has no attribute 'get' ??

2006-10-06 Thread Nicolas Steinmetz
Hello, I have the following code but I do not understand why I have the error below... could someone help me ? class Comment(models.Model): author = models.CharField(maxlength=50) email = models.EmailField() title = models.CharField(maxlength=50) comment = models.TextField()

Re: Django documentation search bar plugin for Firefox

2006-10-06 Thread Noah
Fair enough. I actually didn't know those existed. I still like the search box tho --~--~-~--~~~---~--~~ 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: "choices" option - possible bug?

2006-10-06 Thread MerMer
Ray, The code is below. The RATINGS_CHOICES are defined inside the Model Class. MerMer RATING_CHOICES=( ('5', '5 stars'), ('4', '4 stars'), ('3', '3 stars'), ('2', '1 stars'), ('1', '1 star'), ) rating=models.Intege

Re: 'bool' object has no attribute 'get' ??

2006-10-06 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > class Comment(models.Model): > author = models.CharField(maxlength=50) > email = models.EmailField() > title = models.CharField(maxlength=50) > comment = models.TextField() > post = models.ForeignKey(Post) > parent = models.ForeignKey('self', bla

Re: Django's target applications?

2006-10-06 Thread Don Arbow
On Oct 6, 2006, at 1:47 PM, Paul Barry wrote: > > The link on > > http://code.djangoproject.com/wiki/DjangoPoweredSites > > points to the blog. I guess that link should be updated. Melt is the Django application (next to the link it says "social networking *software*", not *site*), the link

Re: "choices" option - possible bug?

2006-10-06 Thread Don Arbow
On Oct 6, 2006, at 2:20 PM, MerMer wrote: > > Ray, > > The code is below. The RATINGS_CHOICES are defined inside the Model > Class. > > MerMer > > RATING_CHOICES=( > ('5', '5 stars'), > ('4', '4 stars'), > ('3', '3 stars'), > ('2', '1 stars'), >

Re: Diamanda Wiki and MyghtyBoard Forum on SVN now

2006-10-06 Thread Lucas Vogelsang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > Link: http://code.google.com/p/diamanda/ > The SVN repository contains the latest code for diamanda wiki and > MyghtyBoard forum (NEW). > > Requiremens: > - django svn or 0.95 with sitemap package (get from svn/trac and plac

Re: "choices" option - possible bug?

2006-10-06 Thread RajeshD
> > RATING_CHOICES=( > ('5', '5 stars'), > ('4', '4 stars'), > ('3', '3 stars'), > ('2', '1 stars'), > ('1', '1 star'), > ) Replace the first element of each tuple with an integer as you are feeding it to an IntegerField. Li

Re: DB question: OR-ing LIKES

2006-10-06 Thread Tom Smith
On 6 Oct 2006, at 21:26, RajeshD wrote: > >> for word in words: >> q = q.filter( Q(title__icontains=word) ) >> > Try something like this instead of the above: > > q_fragment = Q(title__icontains=words[0]) > for word in words[1:] > q_fragment = q_fragment | Q(title__icontains=w

Re: customizing the admin interface

2006-10-06 Thread patrickk
say you want to have a different list-template for app "blog" model "entries", just add /admin/blog/entries/change_list.html to your templates directory and customize it. we´re using that a lot to add buttons for specific models. I didn´t figure out how to customize the view yet. I guess it´s

django - kit

2006-10-06 Thread Picio
hello, do you know about some kit to have: a web server python postgres and Django? something like Wamp. In other words is there any real PAID (made in AH) kit available? thanks a lot Picio --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: ChangeManipulator

2006-10-06 Thread Michael
On 10/7/06, Steve Wedig <[EMAIL PROTECTED]> wrote: ** Here is the general question **How can I use a ChangeManipulator to validate a subset of a model's fields.** Here is the specific situation **I am using django.contrib.auth.models.User for my user accounts. I would like to create a change/edit f

Re: ChangeManipulator

2006-10-06 Thread James Bennett
On 10/6/06, Steve Wedig <[EMAIL PROTECTED]> wrote: > ** Here is the general question ** > How can I use a ChangeManipulator to validate a subset of a model's fields. http://www.rossp.org/blog/2006/aug/23/changemanipulators-only-part-model/ -- "May the forces of evil become confused on the way t

Re: Reload Admin interface after model changes

2006-10-06 Thread Russell Keith-Magee
On 10/7/06, Matt <[EMAIL PROTECTED]> wrote: > > What can I do to reload the admin interface so that it uses the new > models? Sounds like either: 1) You aren't actually recreating the models. When you say 'dumping the old app and creating it again', what procedure are you using? 2) The webserver

Re: Apache authentication: AttributeError: 'module' object has no attribute 'auth'

2006-10-06 Thread Graham Dumpleton
[EMAIL PROTECTED] wrote: > Hi.. thanks for your replies guys. > > You're probably right... I'm running mod_python from the Ubuntu dapper > repositories which currently has version 3.1.4. Unfortunately the Edgy > package (which is 3.2.8) depends on a newer version of libc6 which > means that I rea

Re: "choices" option - possible bug?

2006-10-06 Thread MerMer
Many thanks, that sorted it. Interesting to note that using the string format the data still got stored in the Database and was getting displayed back in the admin detailed view, but not in the list view. MerMer --~--~-~--~~~---~--~~ You received this message be

Re: Reload Admin interface after model changes

2006-10-06 Thread Matt
It is probably number 2. I'm using apache2 w/ mod_python. I'll check when I'm back at work next. As for what I did to dump the old app, I deleted the application folder and then recreated everything using manage.py startapp. Thanks for the quick reply. I'll post here again to confirm that it was

Re: Storing UTC Time Zone Deviations In My Model?

2006-10-06 Thread Malcolm Tredinnick
On Fri, 2006-10-06 at 13:17 -0700, [EMAIL PROTECTED] wrote: > All, > In my locations model, I'm trying to add UTC time zone deviations. I > have tried a number of things, but haven't had any success. I would > appriciate any suggestions on how to solve this problem(Note: I'm using > Postgresql

Re: Re: Reload Admin interface after model changes

2006-10-06 Thread Russell Keith-Magee
On 10/7/06, Matt <[EMAIL PROTECTED]> wrote: > > It is probably number 2. I'm using apache2 w/ mod_python. I'll check > when I'm back at work next. > > As for what I did to dump the old app, I deleted the application folder > and then recreated everything using manage.py startapp. Keep in mind tha

Re: ChangeManipulator

2006-10-06 Thread Ivan Sagalaev
RajeshD wrote: > See Ivan's example code here for a hint on this: > http://groups-beta.google.com/group/django-users/msg/f1635e9a27c6ae68 For this particular case (where you only need disable, not replace fields) that example is an overkill. For disabling it's better to use 'follow' (James Benn