Re: App naming conflict? - modification of contrib.comments

2008-03-07 Thread [EMAIL PROTECTED]
Hmmmjust remembered to try: {% load comment_utils %} Still doesn't work though. I just get: 'comments' is not a valid tag library: Could not load template library from django.templatetags.comments, No module named contenttypes.models On Mar 7, 10:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECT

Re: image dimensions

2008-03-07 Thread Eric Abrahamsen
I solved this by deleting all my Pic objects and re-entering them into the database. I have no idea what was going on. On Mar 7, 9:39 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > I've become unable to use the get_IMAGEFIELD_dimensions() set of   > methods on images recently: using pic.get_pic

Re: Is it necessary to impliment tearDown to clean up database when using django.test.TestCase?

2008-03-07 Thread Russell Keith-Magee
On Sat, Mar 8, 2008 at 3:22 AM, meppum <[EMAIL PROTECTED]> wrote: > > I've been doing something like the following: > > MODELS = [SomeObjectType, AnotherObjectType] > > class testFoo(TestCase): > > def tearDown(self): > for model in MODELS: > model.objecs.all().delete() > > Is

Re: App naming conflict? - modification of contrib.comments

2008-03-07 Thread [EMAIL PROTECTED]
Thanks for posting an update to your original problem. I didn't even think about looking at comment_utils but that was definitely my problem. Now I can't figure out what to put in my templates to load comments. Before, I used {% load comments %} and it worked just fine. Any ideas? On Jan 20, 6

Re: Resolving dynamic dictionary parameters in templates

2008-03-07 Thread Justin Fagnani
This is the third time this issue has come up in the last day :) Try this, since it'll work for dictionaries, lists, and objects: from django.template import resolve_variable @register.filter def lookup(value, key): return resolve_variable(key,value) -Justin On Fri, Mar 7, 2008 at 6:20 PM, Nick

Re: Context problem - From list to details and back

2008-03-07 Thread Justin Fagnani
Well one way of looking at this is that HTTP is supposed to be stateless, and GET requests are more or less intended to return the same results for the same parameters - assuming the data hasn't changed. In this case, storing state in the URL is exactly the right thing to do. It's ugly, but it'

Context problem - From list to details and back

2008-03-07 Thread efege
Hi, I'm new to Django and Python too, and just started planning the migration of an existing app to Django, after reading (though not very carefully) The Definitive Guide to Django. Excellent documentation, BTW! I'd like to know which is the recommended approach to handle this situation in Django

URLConf/ManytoManyField issue (exercise problem from Teach Yourself Django in 24 Hour)

2008-03-07 Thread Rilindo Foster
Hi! I am going Django (liking it so far), and I seem to hit a wall with one of the exercises. It likely because of my unfamiliarity with Python, so bear with me, please. At the end of Hour 6, I got two exercises to do: 1. Create an additional view for the People object that displays the Bl

Re: Resolving dynamic dictionary parameters in templates

2008-03-07 Thread Nick Fishman
Malcolm Tredinnick wrote: > I wouldn't be too surprised if something like that already existed at > djangosnippets.org, but, if not, it should be only a couple of lines to > write one. > Thanks, Malcom. A friend of mine found something that's exactly like what you were talking about: http://pu

Re: Adding variables to context only in one block?

2008-03-07 Thread Michael
Thanks for the explanation and the potential work around. To be honest, I have been working with Django templates for almost 2 years and this situation never has manifested itself before and it was a simple change in the layout to avoid it in the HTML and by your explaination it wouldn't be that h

Re: ModelForm ManyToMany add

2008-03-07 Thread M.Ganesh
Malcolm Tredinnick wrote: > On Thu, 2008-03-06 at 15:24 +0100, Alper Çugun wrote: > > >> If I have a model with a ManyToMany relation, the django admin shows >> multiselect widgets with a plus so you can add the related objects on >> the spot. Is there a way to duplicate this functionality when

Re: newforms-admin InlineFormSet usage?

2008-03-07 Thread Brian Rosner
> I gave a look at newforms.models and I see this "InlineFormSet" class, > but I can't really understand how to use it, nor I can find docs on > this matter, the only thing I found (don't ask me how) is > http://code.djangoproject.com/ticket/6632 .. that explains the various > FormSets (including

Re: newforms-admin InlineFormSet usage?

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 16:20 -0800, fizban wrote: > Hi, > > I'm trying to use this newforms-admin to make custom forms for my app/ > project (I have a lot of inline stuff in my models, so it's supposed > to come handy). I've already managed to convert my models to newforms- > admin (it's not that

newforms-admin InlineFormSet usage?

2008-03-07 Thread fizban
Hi, I'm trying to use this newforms-admin to make custom forms for my app/ project (I have a lot of inline stuff in my models, so it's supposed to come handy). I've already managed to convert my models to newforms- admin (it's not that hard since it's documented) and I'm currently able to add/edi

Re: Where to send localized files

2008-03-07 Thread Kenneth Gonsalves
On 07-Mar-08, at 11:52 PM, Boris Ozegovic wrote: > I did localization for croatian language. Where do I send .po files? create a ticket - attach the files - announce on the i18n list -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common ma

Re: Adding variables to context only in one block?

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 18:33 -0500, Michael wrote: > I am still not really understanding what you are saying. It makes > sense that extended templates do not have the same context as the > template extending it. But all this is occurring in the same template, > let's say story_detail.html that has

Re: Adding variables to context only in one block?

2008-03-07 Thread Michael
I am still not really understanding what you are saying. It makes sense that extended templates do not have the same context as the template extending it. But all this is occurring in the same template, let's say story_detail.html that has {% block extrahead %} and {% block sidebar %} that need ac

Re: Generic Views: Variable Table Columns

2008-03-07 Thread Justin Fagnani
Coincidentally, this was just brought up in the django-dev list. I have a simple filter to do this that uses the template variable lookup functionality so that it behaves the same, including silent failure. from django.template import resolve_variable def lookup(value, key): return resolve_variabl

Re: Validation system for models

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 14:13 -0800, Hugh Bien wrote: > For the website I'm writing, I've just been overriding the > 'validate()' method on models but that's still experimental: > > http://www.djangoproject.com/documentation/models/validation/ > > Is there a built-in validation system for Django

Validation system for models

2008-03-07 Thread Hugh Bien
For the website I'm writing, I've just been overriding the 'validate()' method on models but that's still experimental: http://www.djangoproject.com/documentation/models/validation/ Is there a built-in validation system for Django models? - Hugh --~--~-~--~~~---~--~-

Re: Adding variables to context only in one block?

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 15:53 -0500, Michael wrote: > Thanks for the reply Malcolm, > > Yea I meant the block template tag. I was trying to access a variable > that is returned from template tag in my extrahead and sidebar blocks. > > Is there a reason this is to be expected? It's expected at t

Re: Adding variables to context only in one block?

2008-03-07 Thread Michael
Thanks for the reply Malcolm, Yea I meant the block template tag. I was trying to access a variable that is returned from template tag in my extrahead and sidebar blocks. Is there a reason this is to be expected? Seems odd to have a variable scope inside of one block content and not the next in

Re: How to create test suite for entire website consisting of many apps

2008-03-07 Thread Tim Chase
> I know that using manage.py I can do something like: > >> python manage.py test >> python manage.py test >> python manage.py test > ... and so on. > > But if I have several applications in my website (project) it would be > easier if I could just run them all together, but the following > d

Re: Adding variables to context only in one block?

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 12:25 -0800, Michael Newman wrote: > I have a template tag that returns a list of objects in a category in > a context variable. I was wondering if it was normal and expected that > the context variable only works within the content block in which the > item was called? Wha

jraaa7.com جراح

2008-03-07 Thread [EMAIL PROTECTED]
جراح http://www.jraaa7.com العاب http://games.jraaa7.com منتديات http://forums.jraaa7.com اقسام الدليل التحميل من يوتيوب يوتيوب داونلودر http://www.jraaa7.com/page-youtube.html حواء http://www.jraaa7.com/cat20s1.html مواقع الطرب والفنانين http://www.jraaa7.com/cat12s1.html مواقع الثقافه الجنسيه

Adding variables to context only in one block?

2008-03-07 Thread Michael Newman
I have a template tag that returns a list of objects in a category in a context variable. I was wondering if it was normal and expected that the context variable only works within the content block in which the item was called? Also I noticed the must_be_first variable and was wondering if any of

Re: Where to send localized files

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 19:22 +0100, Boris Ozegovic wrote: > Hello > > I did localization for croatian language. Where do I send .po files? Open a ticket in Trac and attach it there. The preferred format is a diff against the current Croatian translation from subversion. Check out the subversion

Re: IDE (UML )

2008-03-07 Thread jason
SPE features UML generation. I don't know if this is what you want, if not you might want to try bluej. Best Regards, jason On Mar 7, 10:21 am, Jean-Christophe Kermagoret <[EMAIL PROTECTED]> wrote: > Simone Cittadini a écrit :> Since there's an active discussion about ide .. > > > Back in my ja

Re: ModelForm design issue

2008-03-07 Thread Michael
Here is a simpler solution for you. Try creating a custom field type for your admin: http://www.djangoproject.com/documentation/model-api/#custom-field-types for your date object. This will give you the ability to add only those fields and combine them in the field instead of in your save call. Y

Where to send localized files

2008-03-07 Thread Boris Ozegovic
Hello I did localization for croatian language. Where do I send .po files? Tnx. --~--~-~--~~~---~--~~ 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.

Re: Recovering from Postgres errors

2008-03-07 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 7 Mar 2008 09:44:27 -0800 (PST) meppum <[EMAIL PROTECTED]> wrote: > > I have also begun to run into this issue, and I agree with Kent here. > If transaction management is set to the default (automatic) then > failed saves should automatically

Re: Unit tests with Postgres backend and transaction errors, revisited

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 09:33 -0800, meppum wrote: > I've been playing with Django for a while now, learning the ropes and > such. I started building some unit tests using the django TestCase > classes, but recently I've hit a snag with using Postgres as the > backend to my tests and testing databa

Re: Help needed (very granular admin permissions)

2008-03-07 Thread fizban
On Mar 7, 2:01 pm, David Reynolds <[EMAIL PROTECTED]> wrote: > > You'll probably have to roll your own admin system where you can > enforce this the per row permissions. Thanks, I digged into it a bit and it looks like the best solution for me is to use the newforms-admin branch (newform is supp

Re: newforms 0.96.1 custom validation

2008-03-07 Thread Panos Laganakos
Thanks Malcolm, that was it! Newforms are starting to feel fun :) On Mar 6, 7:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-03-06 at 08:45 -0800, Panos Laganakos wrote: > > Trying to add custom validation for a customer creation form, but when > > I add: > > > def clean_use

Re: Advanced admin interface customization question

2008-03-07 Thread Josh Ourisman
That's pretty much what I figured. Thanks. On Mar 6, 9:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Mar 6, 12:42 pm, David Reynolds <[EMAIL PROTECTED]> > wrote: > > > > > On 5 Mar 2008, at 6:17 pm, Josh Ourisman wrote: > > > > There are two ways in which I want to customize the admi

Re: Newforms-admin: filter_horizontal doesn't work

2008-03-07 Thread Brian Rosner
> "Hold down "Control", or "Command" on a Mac, to select more than one." > > and NO select boxes, search input etc! What revision of newforms-admin are you using? Also, what browser is this behavior is displayed in? -- Brian Rosner http://oebfare.com --~--~-~--~~~--

ModelForm design issue

2008-03-07 Thread omat
Hi, I need some advice to build an event submission form in a smart way. I have 2 wishes: 1. Display DateTimeField as 2 ChoiceFields (1 for day, other for month, non for year) and a TimeField. This requires creating the event_date dynamically in the form class's clean methods. 2. Validate if th

Django Admin SelectMulitple Widget

2008-03-07 Thread Rufman
Hey guys I tried to get the code from the Django admin that makes the nice SelectMultiple widget (ex. when you assign user permissions). I added the following scripts to my template: - jsi18n/ - adminMedia/js/core.js - adminMedia/js/SelectBox.js - adminMedia/js/SelectFilter.js This d

Re: "form action" opinions?

2008-03-07 Thread Malcolm Tredinnick
On Sat, 2008-03-08 at 01:38 +1100, Malcolm Tredinnick wrote: [...] > There are various opinions and approaches here and you need to find a > reasonable mix between purity and pragmatism. Some people will argue > that /LakeSide?display=edit would be a better form URL, since it is a > variant (altn

Re: "form action" opinions?

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 05:58 -0800, cjl wrote: > Thank you for your replies. I have a lot to learn about REST-ful > design, and it makes sense when you talk about nouns and verbs, but I > can't seem to make the idea fit my current scenario, a simple wiki. > > I have a page: > /LakeSide/ > > Now

Re: IDE

2008-03-07 Thread Evert Rol
>> So far many editors/IDEs have been put on the table here, let me >> remind you: > > Free as in freedom: > * OpenKomodo > * UliPad > * PIDA > * Eric > * Boa Constructor > * Eclipse + Pydev > * Kate > * Geany > * SPE > * Vim > * PyPE > > Non-free: > * Komodo > * Textmate (mac only) > * Coda (ma

Re: IDE

2008-03-07 Thread Alvaro Mouriño
On Fri, Mar 7, 2008 at 6:40 AM, jason <[EMAIL PROTECTED]> wrote: > > 1 vote for SPE, aka Stanis Python Editor. So far many editors/IDEs have been put on the table here, let me remind you: Free as in freedom: * OpenKomodo * UliPad * PIDA * Eric * Boa Constructor * Eclipse + Pydev * Kate * Geany *

Re: "form action" opinions?

2008-03-07 Thread cjl
Thank you for your replies. I have a lot to learn about REST-ful design, and it makes sense when you talk about nouns and verbs, but I can't seem to make the idea fit my current scenario, a simple wiki. I have a page: /LakeSide/ Now I want to edit it. /LakeSide/edit <- not good REST design T

Re: Alternative to listdir on every page view

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 08:16 -0500, Prof. William Battersea wrote: > Hello, > > I'm working on a photo gallery for a user. I wanted to make it dead > easy for him to create the gallery and upload photos. Right now, each > time a gallery page is viewed, I look at the directory where the > thumbnai

Alternative to listdir on every page view

2008-03-07 Thread Prof. William Battersea
Hello, I'm working on a photo gallery for a user. I wanted to make it dead easy for him to create the gallery and upload photos. Right now, each time a gallery page is viewed, I look at the directory where the thumbnails are stored using listdir and slice the resulting list depending on what page

Re: Can't redirect using HttpResponseRedirect with a form in a template inclusion tag

2008-03-07 Thread A Hampton
Thanks, I wish I had asked the day before. I was getting very frustrated about it. I moved it to the view and now it works perfectly. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Help needed (very granular admin permissions)

2008-03-07 Thread David Reynolds
On 7 Mar 2008, at 11:50 am, fizban wrote: > > Hello, > > I'm doing my first complex django based application (actually a > website), I started doing it in PHP but it really bored me having to > deal with a huge amount of forms.. so I decided to go for the good old > django. I'm not new to Django

Re: IDE

2008-03-07 Thread lhonda
Folks, I use Eric in Ubuntu and Komodo in Mac. Sometimes I use Kate (Ubuntu) with word completion plugin enabled. One important feature is the word completion in IDEs. I have not found this feature applied to a whole project, only applied to the current buffer and believe me, it helps a lot. You

Re: "form action" opinions?

2008-03-07 Thread Malcolm Tredinnick
On Thu, 2008-03-06 at 19:49 -0800, cjl wrote: [...] > Why not the following URLs: > /form/<- display the form with action="./submit/" > /form/submit <- handle the form, then redirect > > I'm not that smart, so I would love to hear any and all opinions on > this. In REST-ful design, URLs cor

Re: Custom form where fields in Form do not match Model

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 16:59 +1100, Michael Lake wrote: [...] > In forms.py I have: > > class AddDecisionForm(forms.Form): > > choice1 = forms.CharField(label='choice1', required=False) > choice2 = forms.CharField(label='choice2', required=False) > > enumerated-choices = [] > if

Re: Problem with encoding and feeds

2008-03-07 Thread Malcolm Tredinnick
On Thu, 2008-03-06 at 19:09 -0800, Brian Morton wrote: > 2019 is an right single quote in unicode. Perhaps that title is > causing the problem? Did you paste it from some editor that would > have created it as that character rather than an apostrophe? Maybe > you should correct that by hand if

Help needed (very granular admin permissions)

2008-03-07 Thread fizban
Hello, I'm doing my first complex django based application (actually a website), I started doing it in PHP but it really bored me having to deal with a huge amount of forms.. so I decided to go for the good old django. I'm not new to Django, but I've only created "basic" projects with it (CMS, We

Re: form's clean() cannot access all cleaned_data when data is empty

2008-03-07 Thread omat
I should have checked if there were form validation errors already. Required fields that receive empty data get dropped in the fields' validation before reaching the form class's clean(). On Mar 7, 11:28 am, omat <[EMAIL PROTECTED]> wrote: > Hi, > > I am doing custom validation in my form clas

apache/fastcgi/django files limit problem

2008-03-07 Thread Robin Becker
I'm having a problem related to a freebsd 6.x apache 2.0.x+mod_fastcgi --> django+flup forked server. Basically under heavy load the system seems to reach some kind of limit on the number of open files ie I see messages related to user 80 & (the django server uid) having reached kern.maxfi

Delete protection

2008-03-07 Thread LiMu
In a weak moment yesterday, I typed in a console instead of note.bursts.clear() a terrible mistake note.bursts.all().delete() Notes are comments linking to one or more principal objects, which are Bursts. Luckily, this specific note was not related to many of them, but I started thinking of a way

form's clean() cannot access all cleaned_data when data is empty

2008-03-07 Thread omat
Hi, I am doing custom validation in my form class's clean() method according to several fields in the form but some fields does not appear in the cleaned_data dictonary when the supplied value is empty. My (simplified) model is: class Event(models.Model): title = models.CharField(max_lengt

Re: IDE (UML )

2008-03-07 Thread Jean-Christophe Kermagoret
Simone Cittadini a écrit : > Since there's an active discussion about ide .. > > Back in my java days I was using eclipse with omondo for uml, I really > miss the uml drawings, someone has some plugin to suggest ? > > I've no need for fancy features, just something to draw class and > sequence d

Re: "form action" opinions?

2008-03-07 Thread Daniel Roseman
On Mar 7, 3:49 am, cjl <[EMAIL PROTECTED]> wrote: > DU: > > I'm playing around with forms (newforms), and a common way of handling > forms seems to be a template that does this: > > > > With a view that does this: > > if request.method == 'POST': >process the form, then redirect... > else: >

IDE (UML )

2008-03-07 Thread Simone Cittadini
Since there's an active discussion about ide .. Back in my java days I was using eclipse with omondo for uml, I really miss the uml drawings, someone has some plugin to suggest ? I've no need for fancy features, just something to draw class and sequence diagrams, project is becoming huge and p

Re: IDE

2008-03-07 Thread jason
1 vote for SPE, aka Stanis Python Editor. It has syntax coloring and calltips, I think it uses pycrust for that internally. When you open a bracket, you will get a bubble reminding you of the arguments you have to/can supply. It is also reasonably customizable, and offers a lot of functionality ou

Re: IDE

2008-03-07 Thread Simone Cittadini
Tom Badran ha scritto: > Do people find eclipse+pydev reliable? I've tried it out a few times > over the last year and it never seems to run for more than a few hours > without dying. This is both the 3.2 (from eclipse.org > and ubuntu packaged) and 3.3 (from eclipse.org >