Django an STI

2009-03-06 Thread Vbabiy
I know django does not support STI, but I was wondering if there is any way I can implement this behaviour. Here is an example of what I would like: class Tracker(models.Model): notifications = models.ForeignKey(Notification) class Notification(models.Model): # Common fields pass

Re: Django and Python Warnings

2009-03-06 Thread Graham Dumpleton
On Mar 7, 12:50 pm, Malcolm Tredinnick wrote: > On Fri, 2009-03-06 at 18:12 -0500, Jacob Kaplan-Moss wrote: > > On Fri, Mar 6, 2009 at 5:56 PM, Graham Dumpleton > > wrote: > > > Anyway, the issue is that at the moment mod_wsgi doesn't have

Re: append_slash and mod_wsgi problem when Django lives in subdirectory

2009-03-06 Thread Benedykt
On Mar 5, 11:51 pm, Graham Dumpleton wrote: > What version of Django are you using? > > Are you perhaps using a pre 1.0 version where SCRIPT_NAME, which > defines mount point, was not being properly handled by Django. Yes, it was the reason - I was using 0.9.7. I

Re: Is a Complex filter with __in and __exact possible?

2009-03-06 Thread Malcolm Tredinnick
One day I'll stop posting in this thread. Really. On Sat, 2009-03-07 at 12:03 +1100, Malcolm Tredinnick wrote: > However, find things that are simultaneously in all those categories can > be done without all the annotation nonsense I posted. Simply > > >

multiple S3 buckets using David Larlet's S3Storage.py

2009-03-06 Thread wynfred
David Larlet's Amazon S3 wrapper for Django seems widely used, and I'm inclined to use it. However, there's something in the documentation that confuses me: http://code.welldev.org/django-storages/wiki/S3Storage It seems as though one can only use a single bucket, in AWS_STORAGE_BUCKET_NAME in

Re: manage.py dumpdata app.model doesn't seem to work?

2009-03-06 Thread Russell Keith-Magee
On Sat, Mar 7, 2009 at 5:48 AM, Alex Koshelev wrote: > This `dumpdata` command you can only serialize whole application not just > its models. This isn't completely correct. As of [9921], you can specify individual models to dumpdata. However, [9921] was committed after the

Re: pythonpath on Ubuntu 8.10

2009-03-06 Thread Ishwor Gurung
Hi python_fan wrote: > Hey, > > I have an application that I'm running using Django's built-in server > on both Windows XP and Ubuntu 8.10. While it is wokring perfectly fine > on XP, I get import errors in Ubuntu. When I tried printing pythonpath > on Ubuntu, I managed to locate the problem. It

Re: Compressed fixtures?

2009-03-06 Thread Alex Gaynor
This only works on the latest development version of Django, not 1.0. -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You received this

Re: Django Resource Usage

2009-03-06 Thread Alex Gaynor
Also consider a hosting mechanism not yet mentioned in the docs, mod_wsgi. Alex On 3/6/09, Graham Dumpleton wrote: > > > > On Mar 6, 10:45 pm, Paulo wrote: >> Well, this leads me to an unknown path. Where i can find more >> information about how

Re: translating app name ... again

2009-03-06 Thread Malcolm Tredinnick
On Sat, 2009-03-07 at 12:21 +1100, Malcolm Tredinnick wrote: [...] > All of those are bugs (the same bug: not marking app name for > translation). If you'd like to open a ticket and drop in a patch, it's > an more-or-less obviously correct set of changes to make. > > Put it in the

Re: How do I model optional Parent/Child relationships, e.g. not all Tasks are related to a Project?

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 15:45 -0800, Doug wrote: > I have 2 related models, Project and Task. > > What's the best way to set up my models so a Task can either be part > of a Project or not? Do I set up a "dummy" Project for Tasks which > aren't related to a specific Project? Or is there a way to

Re: Django and Python Warnings

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 18:12 -0500, Jacob Kaplan-Moss wrote: > On Fri, Mar 6, 2009 at 5:56 PM, Graham Dumpleton > wrote: > > Anyway, the issue is that at the moment mod_wsgi doesn't have an > > equivalent for the command line -W option. Do people feel it would be > >

[OT] python + rrdtool?

2009-03-06 Thread Jeremy Dunck
Does anyone use a python interface to rrdtool? I've looked around, and it seems there are several interfaces, but non have been updated recently. If someone could report success with one, I'd appreciate it. --~--~-~--~~~---~--~~ You received this message because

Re: pythonpath on Ubuntu 8.10

2009-03-06 Thread python_fan
Seems like I found one solution to that: Add -- pythonpath="path_to_your_app" to the manage.py runserver call. Any better solutions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: count and group by aggregation

2009-03-06 Thread kbs
thanks that worked --~--~-~--~~~---~--~~ 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 group, send email to

Re: forms.ModelForm

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 12:25 -0800, mike171562 wrote: > I am using Django's ModelForm in a template im working on. I am trying > to use it to display the Django User Object and an extension I added > of the user model, what would be the correct way to display my User > model extension in my

Re: template include and for loop speed

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 10:51 -0500, Jacob Kaplan-Moss wrote: > On Fri, Mar 6, 2009 at 4:25 AM, Thierry wrote: > > Why is an include tag so much heavier on the template system? > > Because it has to search for the given template on the file system. > Depending on

Re: translating app name ... again

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 07:01 -0800, patrickk wrote: > so, now here´s a little tutorial for translating app-names throughout > the admin-interface: Nice summary. :-) > 3. change app-names in index.html /// on line 18 replace {% blocktrans > with app.name as name %}{{ name }}{% endblocktrans %}

pythonpath on Ubuntu 8.10

2009-03-06 Thread python_fan
Hey, I have an application that I'm running using Django's built-in server on both Windows XP and Ubuntu 8.10. While it is wokring perfectly fine on XP, I get import errors in Ubuntu. When I tried printing pythonpath on Ubuntu, I managed to locate the problem. It seems like if I start the server

Re: Figuring out what has changed at save()

2009-03-06 Thread Malcolm Tredinnick
On Thu, 2009-03-05 at 22:02 -0800, hanks...@gmail.com wrote: > Sorry for the unwieldy title, but nothing else strikes me at the > moment. > > I have a blog app -- a version of basic.blog, actually. There's a > field in the model called "status" with two options: "draft" and > "public." > > What

Re: Cherrypy and view variables caching?

2009-03-06 Thread Malcolm Tredinnick
On Thu, 2009-03-05 at 22:42 -0800, John M wrote: > Well, given my example, i would think it does. I'm sorry you think that, but if it was clear to me, I wouldn't have asked the question. At no point in your earlier posts did you show any examples of or mention using generic views. > I put the

Re: Is a Complex filter with __in and __exact possible?

2009-03-06 Thread Malcolm Tredinnick
On Fri, 2009-03-06 at 00:11 -0800, Daniel Hepper wrote: > > > Book.objects.filter(Q(categories=1), Q(categories=2), Q(categories=3)) > > > > Not if you were trying to solve the original poster's question. Your > > query is exactly the same as what he tried to do originally. > > I played a bit

How do I model optional Parent/Child relationships, e.g. not all Tasks are related to a Project?

2009-03-06 Thread Doug
I have 2 related models, Project and Task. What's the best way to set up my models so a Task can either be part of a Project or not? Do I set up a "dummy" Project for Tasks which aren't related to a specific Project? Or is there a way to set "Null" on the FK of a Task for the Project field?

Re: Can't run django on Apache

2009-03-06 Thread xankya
One thing I noticed in my windows and sun solaris is that, there is no trailing slash in python paths. When I added trailing slash, apache showed error. So you might as well try removing trailing slash in python paths. --~--~-~--~~~---~--~~ You received this

Re: Microsoft using Django?

2009-03-06 Thread Anderson Santos
Dãr, it was a IE bug displaying a error message from my own server. Sorry On 6 mar, 20:12, Anderson Santos wrote: > I tried to access a file from Microsoft website I got a Django error, are > they really using Django? (It's not phising or spam, just copy and paste

Re: Django and Python Warnings

2009-03-06 Thread Jacob Kaplan-Moss
On Fri, Mar 6, 2009 at 5:56 PM, Graham Dumpleton wrote: > Anyway, the issue is that at the moment mod_wsgi doesn't have an > equivalent for the command line -W option. Do people feel it would be > useful to have a directive in mod_wsgi which allows one to control the

Microsoft using Django?

2009-03-06 Thread Anderson Santos
I tried to access a file from Microsoft website I got a Django error, are they really using Django? (It's not phising or spam, just copy and paste the link) http://download.microsoft.com/download/f/3/c/f3c93e70-ccdc-46c9-bbd4-70d94bdd0cc9/IEDevToolBarSetup.msi/ Cheers, Anderson

Re: Three Physical Tiers

2009-03-06 Thread Ishwor Gurung
ruffeo wrote: > I guess my question is how do you call a remote model object on a > different web server using Django MTV framework. I reckon you'd have to use some sort of RPC that translates the call to/from the remote model but I am not sure if Django provides such primitive. Cheers, Ishwor

Re: Python Multiprocessing With Django

2009-03-06 Thread Jirka Vejrazka
> Thanks Jirka, that fixed the problem. But I think I will file a bug report > that seem to be very hacky :) Great, I'm glad it solved your problem. Personally, I don't think it is a bug, as we both pushed Django well beyond its "area of expertise". I really believe that Django is great for

Re: Django and Python Warnings

2009-03-06 Thread Graham Dumpleton
On Mar 7, 2:53 am, Jacob Kaplan-Moss wrote: > On Fri, Mar 6, 2009 at 9:46 AM, Brian Neal wrote: > > I updated my working copy of Django after a long period and was > > browsing the source and noticed it was taking advantage of the Python > >

Re: Three Physical Tiers

2009-03-06 Thread ruffeo
I guess my question is how do you call a remote model object on a different web server using Django MTV framework. On Mar 5, 5:14 pm, Kevin Teague wrote: > On Mar 4, 12:21 pm, ruffeo wrote: > > > Does anyone know how to develop a complex django project in

Re: Django Resource Usage

2009-03-06 Thread Graham Dumpleton
On Mar 6, 10:45 pm, Paulo wrote: > Well, this leads me to an unknown path. Where i can find more > information about how to install it and tweak it? You still aren't saying how you intend to host it. If you do not know, start by looking at the deployment mechanisms

Re: ImportError: Could not import settings '.settings'.

2009-03-06 Thread Ishwor Gurung
Muslu Yüksektepe wrote: >46 PythonPath "['*/home/hutch/apps/wikinotes/*'] + sys.path" > > > try this code [ ... ] Apache returns 500 with that particular code. Anyway, it works already (see my last post). Thanks in any case. ;) Cheers, Ishwor smime.p7s Description: S/MIME

Re: Django Pluggable application for invoicing / accounts?

2009-03-06 Thread Adi Sieker
Hi, there is also djime http://github.com/mikl/djime/tree/master though that leans more in the direction of hourly charges. adi On 06.03.2009, at 21:15, John Boxall wrote: > > Trolling through the board a bit here are some other postings on > similar topics: > > Suggesting looking at Satchmo

Compressed fixtures?

2009-03-06 Thread Ben Davis
http://docs.djangoproject.com/en/dev/ref/django-admin/#compressed-fixtures The docs say that you can use compressed fixtures, but I haven't gotten this to work. For example, I have myapp/fixtures/myfixture.yaml.gz, but when I run ./django-admin.py loaddata myapp/fixtures/myfixture.yaml, it

loaddata spewing to standard output but not actually loading

2009-03-06 Thread Serdar T.
Hey everyone, While trying to load a json fixture, the contents are spitting out to my bash shell but nothing is loading into the postgres database backend. >From inside my project directory, I'm executing the documented command: ./manage.py loaddata data2.json In addition to the contents,

Re: Programmtically accessing properties on a model field?

2009-03-06 Thread Rajesh D
> > I'm working on some code to scrub an images directory of anything not > currently stored in the database, and would like to de-couple some > things. I'm using signals, passing in an instance of a model that I > would like to be able to grab some data from, namely, the 'upload_to' > parameter

Re: count and group by aggregation

2009-03-06 Thread kbs
returned an empty dict --~--~-~--~~~---~--~~ 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 group, send email to

Re: Optimizing my ORM query

2009-03-06 Thread Jeff Gentry
Sorry for the self-followup, but I got the right bits of extra. My actual case was a bit more complicated than my example below (it involved a fourth model), but it's working now - and much quicker than w/ the IN directive. Thanks. On Fri, 6 Mar 2009, Jeff Gentry wrote: > On Fri, 6 Mar 2009,

Re: manage.py dumpdata app.model doesn't seem to work?

2009-03-06 Thread Alex Koshelev
This `dumpdata` command you can only serialize whole application not just its models. On Fri, Mar 6, 2009 at 11:17 PM, John M wrote: > > I tried using the command > > $ python manage.py dumpdata app.model. > > where app is the name of my application and model is one of

Re: count and group by aggregation

2009-03-06 Thread Alex Koshelev
Try this: R.objects.values('type').aggregate(Count('type')) On Fri, Mar 6, 2009 at 10:12 PM, kbs wrote: > > Hello, > > I got a model with a type field > > > class R(mode): >type = CharField(max_length=100) > > > Here is what im trying to do using sql notation: > > >

forms.ModelForm

2009-03-06 Thread mike171562
I am using Django's ModelForm in a template im working on. I am trying to use it to display the Django User Object and an extension I added of the user model, what would be the correct way to display my User model extension in my template, I would like to be able to edit the User information and

manage.py dumpdata app.model doesn't seem to work?

2009-03-06 Thread John M
I tried using the command $ python manage.py dumpdata app.model. where app is the name of my application and model is one of it's models, I didn't actually use the names app and model. I get the following error: django.core.exceptions.ImproperlyConfigured: App with labelapp.model could not be

Re: Django Pluggable application for invoicing / accounts?

2009-03-06 Thread John Boxall
Trolling through the board a bit here are some other postings on similar topics: Suggesting looking at Satchmo http://groups.google.com/group/django-users/browse_thread/thread/94ac6b1766a96208/e6b5f4189648bf53?lnk=gst=accounting#e6b5f4189648bf53 Suggesting Beancounter:

Re: Equivalent of postgresql coalesce for sqllite

2009-03-06 Thread madhav
I found an answer to my own question. The answer is here:http:// stackoverflow.com/questions/620156/equivalent-of-postgresql-coalesce- for-sqllite On Mar 7, 12:52 am, madhav wrote: > This may sound more like a sql question but I got this error in the > django context. And

Re: Optimizing my ORM query

2009-03-06 Thread Sebastian Bauer
W dniu 06.03.2009 20:06, Jeff Gentry pisze: > On Fri, 6 Mar 2009, Malcolm Tredinnick wrote: > >>> Bob.objects.filter(foo=myFoo).filter(blah__in=myBlahs) >>> >> Seems like the best (and obvious) way to me. >> > > Gotcha. > > >> Yes it does. As written, your models have no

Failures in auth.tests.views.ChangePasswordTest on trunk

2009-03-06 Thread Brett Hoerner
Has anyone else seen this? Running tests with django.contrib.* installed on r9983. I just want to make sure I'm not doing something stupid here before I investigate a further. It's certainly possible because I see no tickets or relevant matches on the lists. http://dpaste.com/8094/ Creation

Equivalent of postgresql coalesce for sqllite

2009-03-06 Thread madhav
This may sound more like a sql question but I got this error in the django context. And I presume django users would have solved this issue, So I am posting it here. I am using postgresql_psycopg2 engine for my production db, but the test runner uses sqllite3 for running the tests. Keeping my

Re: Python Multiprocessing With Django

2009-03-06 Thread Vitaly Babiy
Thanks Jirka, that fixed the problem. But I think I will file a bug report that seem to be very hacky :) Vitaly Babiy On Fri, Mar 6, 2009 at 11:15 AM, Vitaly Babiy wrote: > Alright I will have to give this a try > > Vitaly Babiy > > > > On Fri, Mar 6, 2009 at 10:30 AM,

count and group by aggregation

2009-03-06 Thread kbs
Hello, I got a model with a type field class R(mode): type = CharField(max_length=100) Here is what im trying to do using sql notation: SELECT typ,count(*) FROM R GROUP BY type The following R.objects.aggregate(Count('type')) returns the same result as SELECT count(*) R is it

ajax request is missing default values for inputs?

2009-03-06 Thread Aaron Newton
Hi all, First time caller and a total noob to django (not new to development/ programming or anything though). Have this bizarre thing going on. When I request a form (using the FormsWizard) with my browser, everything works great. Specifically, the input initial value is present:

Re: Optimizing my ORM query

2009-03-06 Thread Jeff Gentry
On Fri, 6 Mar 2009, Malcolm Tredinnick wrote: > > Bob.objects.filter(foo=myFoo).filter(blah__in=myBlahs) > Seems like the best (and obvious) way to me. Gotcha. > Yes it does. As written, your models have no ordering requirements. That > complete lack of constraint is preserved perfectly. :-)

Programmtically accessing properties on a model field?

2009-03-06 Thread Brandon Taylor
Hi everyone, I'm working on some code to scrub an images directory of anything not currently stored in the database, and would like to de-couple some things. I'm using signals, passing in an instance of a model that I would like to be able to grab some data from, namely, the 'upload_to'

For Chinese Django users

2009-03-06 Thread usr . root
Hi guys, My company planed to develop a game with Python, the whole product is planned to write in python, including build the website with Django. I have build a technology bbs yesterday, the topic is set to game and website developing with python. You can join us if you have any interest.

Re: Inserting Into Cleaned_Data Inside a ModelForm

2009-03-06 Thread rajeesh
You may change the save_model() method of corresponding AdminClass for that: e.g, to set the attribute 'a' of model 'Book' , write inside BookAdmin.save_model() something like this: obj.a = form.cleaned_data['another_key'] * 2 obj.save() On Mar 6, 8:43 pm, Waldemar Kornewald

Re: opposite of icontains

2009-03-06 Thread koranthala
On Mar 6, 9:15 pm, Jeff FW wrote: > Clearly, you get to work on cooler projects than I :-)  I had thought > of the keywords/phrases case, but the other ones are far more > interesting.  Thanks for the explanation! > > -Jeff > > On Mar 5, 7:02 pm, Malcolm Tredinnick

Re: Custom filter() operators

2009-03-06 Thread Jay Deiman
Malcolm Tredinnick wrote: > On Fri, 2009-03-06 at 08:00 +0900, Russell Keith-Magee wrote: > [...] >> However, I agree that this would be a useful feature to add (or >> improve). This isn't something we want to be trivial to accomplish, >> but it should be a lot easier for people who are adding

Model design question

2009-03-06 Thread tdelam
Hi Everyone, I recently put a new design to a web site. The web site is static basically aside from some content changes every now and then. The navigation is static, there will never be any addition to this. Each section will have a sub-section though. Also, MAYBE in the future a new

Re: Why are views not called controllers?

2009-03-06 Thread Jacob Kaplan-Moss
Also see: http://www.pointy-stick.com/blog/2008/11/30/removing-model-view-controller-straitjacket/ Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Why are views not called controllers?

2009-03-06 Thread Karen Tracey
On Fri, Mar 6, 2009 at 11:37 AM, chyld.medf...@gmail.com < chyld.medf...@gmail.com> wrote: > > I'm new to django, but have experience with asp.net mvc. In asp.net > mvc, controllers receive and process the request from the user and > then once the data is ready to present, it's handed off to a

Re: Why are views not called controllers?

2009-03-06 Thread Masklinn
On 6 Mar 2009, at 17:37 , chyld.medf...@gmail.com wrote: > I'm new to django, but have experience with asp.net mvc. In asp.net > mvc, controllers receive and process the request from the user and > then once the data is ready to present, it's handed off to a view. In > django a view receives

Why are views not called controllers?

2009-03-06 Thread chyld.medf...@gmail.com
I'm new to django, but have experience with asp.net mvc. In asp.net mvc, controllers receive and process the request from the user and then once the data is ready to present, it's handed off to a view. In django a view receives and processes the request and then sends the data to a template to

Re: Why serializing to JSON doesn't work?

2009-03-06 Thread Jeff FW
Keep the way you're serializing the querysets, add each one to a dictionary, and then: return dict((k, simplejson.dumps(v)) for k, v in ret_val.iteritems()) -Jeff On Mar 6, 10:49 am, Marek Wawrzyczek wrote: > Thanks for your responses, they helped :) > > In the code

Re: Django setup problem when executing syncdb

2009-03-06 Thread bitra
Thanks Karen, oops, I forgot to mention, yes I'm using Windows and had the same "No module named Mysqldb" error message... I'm checking the link you gave and I'll try it out. Thanks again. :) On Mar 6, 11:05 pm, Karen Tracey wrote: > On Fri, Mar 6, 2009 at 10:54 AM, bitra

Re: Python Multiprocessing With Django

2009-03-06 Thread Vitaly Babiy
Alright I will have to give this a try Vitaly Babiy On Fri, Mar 6, 2009 at 10:30 AM, Jirka Vejrazka wrote: > > > I have a management command that that starts up a few process to process > a > > request: http://dpaste.com/7925/. > > Hi, I was recently debugging similar

Re: opposite of icontains

2009-03-06 Thread Jeff FW
Clearly, you get to work on cooler projects than I :-) I had thought of the keywords/phrases case, but the other ones are far more interesting. Thanks for the explanation! -Jeff On Mar 5, 7:02 pm, Malcolm Tredinnick wrote: > On Thu, 2009-03-05 at 12:54 -0800, Jeff

Re: Django setup problem when executing syncdb

2009-03-06 Thread Karen Tracey
On Fri, Mar 6, 2009 at 10:54 AM, bitra wrote: > > Hi, I had the same problem with ches. I install mysql with Django > 1.0.2 and given the same error message, but I was using Python 2.5.2. > Do I have to install mysqldb module for this Python version? > Yes. You have to

Re: Django setup problem when executing syncdb

2009-03-06 Thread bitra
Hi, I had the same problem with ches. I install mysql with Django 1.0.2 and given the same error message, but I was using Python 2.5.2. Do I have to install mysqldb module for this Python version? thanks, On Mar 1, 6:18 am, AKK wrote: > If you have windows you may

Re: template include and for loop speed

2009-03-06 Thread Jacob Kaplan-Moss
On Fri, Mar 6, 2009 at 4:25 AM, Thierry wrote: > Why is an include tag so much heavier on the template system? Because it has to search for the given template on the file system. Depending on how you've got TEMPLATE_LOADERS and TEMPLATE_DIRS set, this could search

Re: Why serializing to JSON doesn't work?

2009-03-06 Thread Marek Wawrzyczek
Thanks for your responses, they helped :) In the code below: ret['b'] = State.objects.all() print 'ret: %' % ret try: serialized = encoder.JSONEncoder().encode(ret) except Exception, e: print 'exception: %s' % e I was

Re: Inserting Into Cleaned_Data Inside a ModelForm

2009-03-06 Thread Waldemar Kornewald
On 6 Mrz., 14:13, Chris wrote: > I have a model that has a required attribute, but I want this > attribute set to a calculated value based on the input from a form. So > inside the save() method of my ModelForm class, I'm doing: > > self.cleaned_data['requiredKey'] = 123 >

Re: Python Multiprocessing With Django

2009-03-06 Thread Jirka Vejrazka
> I have a management command that that starts up a few process to process a > request: http://dpaste.com/7925/. Hi, I was recently debugging similar issue and came to a conclusion (which may be wrong of course :) that multiprocessing and Django DB connections don't play well together. I ended

Python Multiprocessing With Django

2009-03-06 Thread Vitaly Babiy
I have a management command that that starts up a few process to process a request: http://dpaste.com/7925/. But every so offen I get a exception say mysql went a way, but it didn't. Process PoolWorker-3: Traceback (most recent call last): File

Re: translating app name ... again

2009-03-06 Thread patrickk
so, now here´s a little tutorial for translating app-names throughout the admin-interface: 1. define the app-names: I´m currently using the __init__-file of my blog-application. it looks like this: from django.utils.translation import ugettext_lazy as _ _(u'auth') _(u'configuration')

Re: Figuring out what has changed at save()

2009-03-06 Thread Hank Sims
For what it's worth, I can imagine on way of doing this. I could use signals to monkeypatch the instance at post_init, adding an attribute called "post_init_status." Then I could compare this value with "status" at post_save. Please save me from doing something so ugly. On Mar 6, 12:28 am, Rama

Re: Figuring out what has changed at save()

2009-03-06 Thread Hank Sims
Rama: Thanks, but that's no good. That would trigger the action whether or not the post is saved as "draft." Hank Sims On Mar 6, 12:28 am, Rama Vadakattu wrote: > So you need to trigger an action the first time you save an object in > to the database. > >

Django and Python Warnings

2009-03-06 Thread Brian Neal
I updated my working copy of Django after a long period and was browsing the source and noticed it was taking advantage of the Python warnings module. What is the best way to "see" such warnings when doing development? Is it possible to configure Python or the Django development server to display

Re: translating app name ... again

2009-03-06 Thread patrickk
you´re talking about the models name, not the applications name ... @nadya: with changing index.html the way you did it works for me as well. for changing the breadcrumbs (which obviously is a "must" if you change the app-names) you have to change change_list.html and change_form.html replace

Re: translating app name ... again

2009-03-06 Thread Muslu Yüksektepe
i dont understand.. do u wanna mean your app name? if u wanna tell about your app name in admin panel i think u can use *USE_I18N = True in settings.py* and * class Meta: verbose_name_plural = "Your App Name" in models.py* try it and write me answer please 2009/3/4 patrickk

Re: Creating a Symbolic Link using Windows

2009-03-06 Thread Sergio Durand
Hi, Pay attention to the end of your trackeback : snaggz03 escreveu: > __init__.py", line 56, in cursor > cursor = self._cursor(settings) > File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/ > base.py", line 262, in _cursor > self.connection = Database.connect(**kwargs)

Re: translating app name ... again

2009-03-06 Thread Nadya Sevova
I put my translations in the django.po file and also changed a little bit the admin's index.html template. Replaced this: {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}

Re: ImportError: Could not import settings '.settings'.

2009-03-06 Thread Muslu Yüksektepe
46 PythonPath "['*/home/hutch/apps/wikinotes/*'] + sys.path" try this code 2009/3/6 Ishwor Gurung > Hi > I want to run this django app I wrote called wikinotes (its a modified > version of note application to maintain user single user session [1]) > for

Re: translating app name ... again

2009-03-06 Thread Nadya Sevova
I put my translations in the django.po file and also changed a little bit the admin's index.html template. Replaced this: {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}

Re: Problems rendering HTML stored in database.

2009-03-06 Thread Muslu Yüksektepe
i think u can use markdown {{ html_text|markup }} or {{ html_text|textile }} try this 2009/3/6 nils > > Im running django-1.0.2-final with the django.contrib.admin in my > application. > It's a blog-like application so i implemented tiny-mce (wysiwyg- > editor) in

Re: Problems rendering HTML stored in database.

2009-03-06 Thread hugoto
Yeah, the default behaviour in django templates is to escape html code, so if you render something like hello, the template will convert it to h1 ... etc. This is for prevent the script inyections in forms. So if you want to show the raw html as is in the database you have no escape the text with

Re: ModelForm/clean_

2009-03-06 Thread gregor kling
Daniel Roseman wrote: > On Mar 6, 10:37 am, gregor kling > wrote: >> Hello List, >> >> I have a form inheriting from ModelForm. >> class C(ModelForm): >> >> >> class Meta: >> model = SomeModel >> >> def clean_somefield: >>

Inserting Into Cleaned_Data Inside a ModelForm

2009-03-06 Thread Chris
I have a model that has a required attribute, but I want this attribute set to a calculated value based on the input from a form. So inside the save() method of my ModelForm class, I'm doing: self.cleaned_data['requiredKey'] = 123 record = forms.ModelForm.save(self) However, this raises the

Problems rendering HTML stored in database.

2009-03-06 Thread nils
Im running django-1.0.2-final with the django.contrib.admin in my application. It's a blog-like application so i implemented tiny-mce (wysiwyg- editor) in the admin interface. It saves/deletes/updates as supposed, but the view+template does not render the HTML-tags, the HTML-tags renders as plain

Re: Django Resource Usage

2009-03-06 Thread stout . elias
Hi, I've used the past two years django 0.96 with fastcgi in a shared server, an average website with products, image processing, forms, etc will take from 10mb to 15mb. David On Mar 6, 11:46 am, Paulo wrote: > My main concern is about django in standby. Does it take too

Re: Django Certifications

2009-03-06 Thread Peter Herndon
In short, no.If you are looking to create one, feel free, there's no competition. There's also been no discernible demand, from what I've seen. On 3/6/09, Praveen wrote: > > Is there any Django certification as others like SCJP, MCSE, CCNA and > more on? > >

Re: ModelForm/clean_

2009-03-06 Thread Daniel Roseman
On Mar 6, 10:37 am, gregor kling wrote: > Hello List, > > I have a form inheriting from ModelForm. > class C(ModelForm): >       > >      class Meta: >          model = SomeModel > >      def clean_somefield: >          enhanced checks > > Now my problem is how to

Re: Django Resource Usage

2009-03-06 Thread Paulo
My main concern is about django in standby. Does it take too much resources? Not too much customers will be using it so i guess it's not a problem. On 5 mar, 23:08, Paulo wrote: > Hi > > I want to install Django on my webserver, but i would like to know > from you if django

Re: Django Resource Usage

2009-03-06 Thread Paulo
Well, this leads me to an unknown path. Where i can find more information about how to install it and tweak it? On 6 mar, 00:04, Graham Dumpleton wrote: > On Mar 6, 1:24 pm, Malcolm Tredinnick > wrote: > > > > > On Thu, 2009-03-05 at 18:08

Re: Django Application's Response Time

2009-03-06 Thread Rama Vadakattu
if you really want to measure the page response time (amount of time that a page has taken to download on your local computer) 1) you can use firebug (popular) : it shows all the request and reponse... 2) AOL's web based test tool : webpagetest.org 3) IBM's page detailer

Re: Forms: custom clean for DateField

2009-03-06 Thread MarcoS
Sorry, i've posted without finishing the message :) So, if I call clean(self), Django give me this exception for the following line: super(forms.DateField, self).clean() Exception Type: TypeError Exception Value: super(type, obj): obj must be an instance or subtype of type

ModelForm/clean_

2009-03-06 Thread gregor kling
Hello List, I have a form inheriting from ModelForm. class C(ModelForm): class Meta: model = SomeModel def clean_somefield: enhanced checks Now my problem is how to access session data (request.session) from within the clean method. Does anyone have a clue

Django Application's Response Time

2009-03-06 Thread Harish
Hi All, I want to calculate the response time of web application designed in django.. Basically I do not have any idea how to proceed with this Any suggestions or idea on this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: ImportError: Could not import settings '.settings'.

2009-03-06 Thread Ishwor Gurung
Hi Ishwor Gurung wrote: > Hi [ ] Another follow up (and hopefully last one for the night). The problem was with my mod_python, view and urlconf configs - I changed mod_python directives from what was in the previous to: SetHandler python-program PythonHandler

template include and for loop speed

2009-03-06 Thread Thierry
the following use case {% for item in items %} {% with item.score as score %} {% include rating_small %} {% endwith %} {% endfor %} Using an include tag is very slow compared to pasting the included template here. My total template processing time goes up from 0.1 to 0.4

Re: Optimizing my ORM query

2009-03-06 Thread Sebastian Bauer
W dniu 06.03.2009 01:24, Malcolm Tredinnick pisze: > On Thu, 2009-03-05 at 18:48 -0500, Jeff Gentry wrote: > >> Suppose I have three models (in pseudocode): >> >> class Foo: >> asdf = models.CharField() >> >> class Blah: >> qwerty = models.CharField() >> >> class Bob: >> foo =

  1   2   >