Re: About extending User model

2010-03-25 Thread Peter Bengtsson
Generally, try to build your application so that it doesn't blindly depend on the profile existing. The signal example Tom showed you is good as it means you won't have to check if the UserProfile instance exists for the user on every turn. However, don't depend on the data within. Keep it light an

Re: Grouped statements in debug_toolbar

2010-03-26 Thread Peter Bengtsson
On 26 March 2010 11:09, Daniel Roseman wrote: > On Mar 25, 7:17 pm, Peter Bengtsson wrote: >> The old django debug-toolbar used to make it possible to group >> statements that were the same so you can see if a particular statement >> was called repeatedly. This does not app

Re: Multi-cores & Django

2010-04-01 Thread Peter Herndon
t gunicorn is a very speedy moving target. But if you use pip to install it, and pip -U to keep on top of new releases, you'll be fine. The above server runs us about $5k, your mileage will inevitably vary. If you don't require SAN, you can chop ~$1500 off by dropping the HBAs. Hop

Re: PK and FK questions

2010-04-07 Thread Peter Herndon
needing to modify the database table structures -- assuming you allow Django's ORM to manage your tables, which is a common case. In that situation, the changes to the underlying DDL can be automated using a Django-aware schema migration tool. South (http://south.aeracode.org/) is one s

Re: how to use IPC in Django??

2010-04-11 Thread Peter Herndon
On Apr 11, 2010, at 5:52 AM, vishwanath b wrote: > I have developed an application in django which has to send or receive > requests from/to a server.These requests have to be sent or received > through sockets.how do i achieve this? Python socket programming: http://docs.python.org/library/sock

Re: how to use IPC in Django??

2010-04-11 Thread Peter Herndon
On Apr 11, 2010, at 10:20 AM, vishwanath b wrote: > thanx for the reply...peter i am new to django so i am a bit confused > regarding implementing this...will i have to write python socket > client code in views which would interact with server c code rite? > > On Apr 11, 7:11 pm

Re: dumping data in utf-8

2010-04-11 Thread Peter Murphy
Loaded = yaml.load(stream); otherstream = file("fixture_with_lovely_ukrainian_characters.yaml", "w"); yaml.dump(Loaded, otherstream, allow_unicode=True); This gets you something like: - fields: {description: 'Украи́на (укр. Україна[ukrɑˈ'} Which is what you want.

Internationalization of templates

2007-06-29 Thread Peter Melvyn
o will look for templates files by name. Is it possible to pass something like 'de/tpt1.html' as 'template_name' argument? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Ticket #399 (Bigint field object needed) status

2007-07-09 Thread Peter Nixon
h has not been applied in one form or another? Partial/imperfect support for BIGINT would IMHO be better than nothing.. Regards -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc --~--~-~--~~~---~--~~ You received this me

Re: Ticket #399 (Bigint field object needed) status

2007-07-09 Thread Peter Nixon
e record here as well: It's > likely that the patch wouldn't be applied so long as it affects only > one backend - fields have to be consistent across all of them (partial > is /not/ better in cases like that). :) > > On Jul 9, 1:47 pm, Peter Nixon <[EMAIL PROTECTED]>

Re: Ticket #399 (Bigint field object needed) status

2007-07-10 Thread Peter Nixon
any mistakes? Thanks Peter On Tue 10 Jul 2007, Collin Grady wrote: > Mentioned this on IRC, but just for the record here as well: It's > likely that the patch wouldn't be applied so long as it affects only > one backend - fields have to be consistent across all of them (partia

Problem in current svn TRUNK

2007-07-10 Thread Peter Nixon
urrent SVN snapshot when running under mod_python How can I debug this in a way that will provide the developers with more usefull info? Cheers -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc --~--~-~--~~~---~--~~ You rec

Re: Problem in current svn TRUNK

2007-07-10 Thread Peter Nixon
On Tue 10 Jul 2007, Peter Nixon wrote: > Hi Guys > > There seems to be a problem in current SVN trunk that causes the > "Development server" to exit whenever I hit one of my views which access > the database. > > It doesnt do it with a 0.96 > It doesnt do it wi

Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon
On Wed 11 Jul 2007, Russell Keith-Magee wrote: > On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote: > > How can I debug this in a way that will provide the developers with more > > usefull info? > > The best way to help us debug this would be to produce a minimal &g

Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon
Cross posted to -devel as this is definitely a bug On Wed 11 Jul 2007, Peter Nixon wrote: > On Wed 11 Jul 2007, Russell Keith-Magee wrote: > > On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote: > > > How can I debug this in a way that will provide the developers with

Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon
hell Python 2.5.1 (r251:54863, Jun 19 2007, 01:38:21) [GCC 4.2.1 20070604 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from testprj.testapp.models import Test

Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon
e django unicode branch as django SVN rev 5608 and earlier work fine on SUSE 10.3 alpha Cheers -- Peter Nixon http://peternixon.net/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&qu

Emergency - In Need Of Developer

2007-07-19 Thread Peter Pluta
details. Thanks, Peter -- View this message in context: http://www.nabble.com/Emergency---In-Need-Of-Developer-tf4114485.html#a11700313 Sent from the django-users mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you

Usage of {% trans ....%} tag in templates related to inclusion tags

2007-07-20 Thread Peter Melvyn
I miss anything or it is neccessary to translate text out of the template and pass it as an item in the dictionary returned by underlying function? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Usage of {% trans ....%} tag in templates related to inclusion tags

2007-07-20 Thread Peter Melvyn
On 7/20/07, eXt <[EMAIL PROTECTED]> wrote: > Do you have: {% load i18n %} in your template? Certainly not - I forgot it - now it works fine. Thank you for help Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Name of inclusion-tag template built in run-time

2007-07-23 Thread Peter Melvyn
this: register.inclusion_tag('%s/tag_cust_support.html' % request.LANGUAGE_CODE, takes_context=True)(.) Please, is it somehow possible to access language code of current session or I should pass those static text via underlying Python function?

Re: transaction commit

2007-07-24 Thread Peter Melvyn
> Your example is correct, and you aren't violating any 'Django principles'. Really? Should not be there something like this? enter_transaction_management() try: managed(True) try: ... except: transaction.rollback() raise ... else: tra

Re: Insert vs. Update

2007-07-24 Thread Peter Melvyn
On 7/24/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > You're not the first to suggest insert() and update() methods that > explicity do SQL INSERT and UPDATE calls. FYI: both, SQLite and MySQL support REPLACE statement to do this automatically. --~--~-~--~~~--

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Peter Melvyn
On 7/25/07, Przemyslaw Wegrzyn <[EMAIL PROTECTED]> wrote: > Thanks! I overlooked the 'fixtures' feature, I'll give it a try. I don't know wjhat kind of SQL server do you use, but If I'm not mistaken, fixtures are not fully supported on MySQL with InnoDB engine. --~--~-~--~~---

Problems with i18n of field labels (newforms)

2007-07-25 Thread Peter Melvyn
i.e. instance does not translate labels if language is session changed is changed. # Please, could anybody advise me, what I'm missing? Thank, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djang

functions missing from django.utils.translation

2007-07-26 Thread Peter Baumgartner
I'm running revision 5765 on a CentOS in Python 2.4.3 and it doesn't recognize (ImportError) the following functions from django.utils.translation: ugettext, ungettext, deactivate_all I've redownloaded django, checked permissions, and verified the functions do actually exist in the source. Why wo

Re: functions missing from django.utils.translation

2007-07-26 Thread Peter Baumgartner
On 7/26/07, Peter Baumgartner <[EMAIL PROTECTED]> wrote: > > I'm running revision 5765 on a CentOS in Python 2.4.3 and it doesn't > recognize (ImportError) the following functions from > django.utils.translation: ugettext, ungettext, deactivate_all > >

Re: Problems with i18n of field labels (newforms)

2007-07-25 Thread Peter Melvyn
function is always lazy -> this was a reason I was absolutely blind to this problem. Thanks for your help, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: How do I echo template variables?

2007-07-30 Thread Peter Melvyn
On 7/30/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > Try {% debug %} If you mentioned this feature: is there an easy way to reformat {% debug %} output the same/similiar way an exception error is reported? Peter --~--~-~--~~~---~--~~ You rece

Re: Name of inclusion-tag template built in run-time

2007-07-31 Thread Peter Melvyn
t. Its a pitty they cannot be used recursivelly having the same features as regular template. > So you might want to create a tag that isn't based on inclusion_tag, > but rather inspects the requests locale and delivers the right content at > rendering time. OK. I'll sup

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-05 Thread Peter Melvyn
But I'd like to have form declaration out of this view na pass user's ID as an argument - is there any way how to supply queryset in runtime? I tried to assign queryset later to form's instance having no success. Thanks, Peter --~--~-~--~~~---~--~

How to specify engine type for particular table?

2007-08-06 Thread Peter Melvyn
, Peter --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-08 Thread Peter Melvyn
lved my problem, but another one has arised: What should I pass as a dummy queryset parameter: this is positional mandatory argument and I cannot pass None. Is it correct if I pass queryset = _QuerySet() Thanks, Peter --~--~-~--~~~---~--~~ You received this

I am not able to run custom SQL commands

2007-08-08 Thread Peter Melvyn
bel='wss'. But currently syncdb and similiar commands like sqlall work perfectly) Please, could anybody advice me what I'm doing badly? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

urlconf for multiple page slugs

2007-08-10 Thread Peter Baumgartner
I'm building a site where pages can have parent pages in the form: * Grandparent 1 * Grandparent 2 ** Parent 1 *** Child 1 *** Child 2 ** Parent 2 I'd like the url to contain each parent. For example, 'child 2' would be at /grandparent-2/parent-1/child-2/ I'm not sure how to implement this in my

Re: Django on Linux, MS SQL on Windoz

2007-08-10 Thread Peter Bailey
Thanks Florian. Guess I better have a look at SQLAlchemey - too bad that branch of django does not seem to be advancing much either!. Thanks for your help. Peter On 8/10/07, Florian Apolloner <[EMAIL PROTECTED]> wrote: > > > Hi, > There is currently no fully working back

Re: urlconf for multiple page slugs

2007-08-10 Thread Peter Baumgartner
> > > Collin's suggestion may sound daunting, but it's really quite easy: Thanks guys. I took your advice. Here is my solution: http://www.djangosnippets.org/snippets/362/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

make-messages does not generate any message in .po except dummy header

2007-08-11 Thread Peter Melvyn
t;Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" and no messages extracted from my python files or templates. Please, does have anybody an idea what is wrong? Thanks, Peter --~--~-~--~~~---~--~~ You rece

Re: make-messages does not generate any message in .po except dummy header

2007-08-12 Thread Peter Melvyn
ket #4899. Thanks you very much, Ramiro. It works now. Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsub

Clash of related_names among two tables

2007-08-16 Thread Peter Melvyn
Hi all, please, could anybody confirm my experience with related_names. I tried to find-out some information about it and found invalid model example. If my understanding is correct, then it is not possible to have the same related_names in two different models. Is it correct? Thanks, Peter

Re: Clash of related_names among two tables

2007-08-16 Thread Peter Melvyn
ique related_name which may not clash with any attribute's name of referred model including self-reference if any. > Hope this clarifies things a bit. Yes, it does. Thank you very much for prompt and detail explanation. Peter --~--~-~--~~~---~--~~ You rece

Re: Variable choices in ModelChoiceField

2007-08-17 Thread Peter Melvyn
On 8/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > But how do I pass the 'user' object to the Form so I can use it in > filter() or run .groups.all() on it? I do it this way: self.fields['emails'].queryset = BIZEmail.objects.filter(owner=oa_request.user.id) self.fields['emails'].widget.

Re: How to create model with dual primary key in Django?

2007-08-18 Thread Peter Melvyn
On 8/18/07, richard <[EMAIL PROTECTED]> wrote: > I'm working on a database-backed Web site which requires a few tables > to use dual primary keys (two columns acted together as primary key; > each of them is not unique in itself). How to do that properly? > (I'm aware of 'unique_together', howev

unique_together and composite columns indexing

2007-08-18 Thread Peter Melvyn
(`col_a`, `col_b`) ); CREATE INDEX `xxx_amodel_col_a` ON `wss_amodel` (`col_a`); CREATE INDEX `xxx_amodel_col_b` ON `wss_amodel` (`col_b`); Should not be there another meta command, e.g. indexed_together = (('col_a','col_b'),) producing index CREATE INDEX `xxx_amodel_col

Apache does not serve static files from document root

2007-08-20 Thread Peter Melvyn
AttributeError: 'module' object has no attribute 'handler404' Filename V:/WWW-ROOT/bizweb/wssmedia/css/img/arr0_blue.gif is correct and the file *does* exist, but Apache did not serve it - it looks like the Apache routes all /wssmedia/ requests to mod_python, instead serv

Re: Apache does not serve static files from document root

2007-08-20 Thread Peter Melvyn
t server as well. But I don't know how to config Apache this way: if URL starts with "/wssmedia/": use default_handler else: use mod_python (Django) Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Apache does not serve static files from document root

2007-08-20 Thread Peter Melvyn
\\src'] + sys.path" SetHandler default-handler Thank you for your help and I hope this off-topic thread would be usefull for somebody else who meets the similiar problems on Apache side. Peter --~--~-~--~~~---~--~~ You received this message be

Re: insert or update

2007-08-21 Thread Peter Melvyn
On 8/21/07, George Vilches <[EMAIL PROTECTED]> wrote: > http://code.djangoproject.com/ticket/4879 > If you need that functionality, add a vote for it. :) Yes, I need such functionality :) Peter --~--~-~--~~~---~--~~ You received this message bec

Re: insert or update

2007-08-21 Thread Peter Melvyn
ed to synchronize its DB with Django database. We use post signals to maintain change log containing all records which has to be replicated. We'd appreciate if we could distinct between insert and update operations Thanks, Peter --~--~-~--~~~---~--~~ You receive

Is there a way how to modify value of particular field in bound new form

2007-08-23 Thread Peter Melvyn
Hi all, I'd like to clear values of some fields in the bound form before I'll render a page again, by I'm not able achieve this. Please, could anybody advice how to do it? Thank in advance Peter --~--~-~--~~~---~--~~ You received this message

Re: Injecting validation errors into newforms

2007-08-25 Thread Peter Melvyn
use following assignment: self.errors['my_field_name'] = ErrorList(['My error message']) For details see class ValidationError in django.newforms.util HTH, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Validation problem with newforms and initial value for URLField

2007-08-26 Thread Peter Melvyn
und well for me... If you need such behaveour, should not you sublass a field and override the clean() method? Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Problem in current svn TRUNK

2007-08-27 Thread Peter Nixon
10.3 (X86-64) Beta2". Given that openSUSE 10.3 is going to be released soon, and that this is a 100% repeatable problem which only occurs post the unicode merge in Django, I would really appreciate if one of the developers could take the time to have a look at it

Authenticating Django against FreeRADIUS

2007-08-27 Thread Peter Nixon
Maybe this code I whipped up tonight to teach Django to speak RADIUS will be usefull to someone... http://peternixon.net/news/2007/08/27/open-source/authenticating-django-against-freeradius/ Cheers -- Peter Nixon http://peternixon.net

Re: Django 1 debugging in pydev with breakpoints

2007-08-29 Thread Peter Melvyn
its execution using red box in Console window. Now you can issue command 'Debug last launched' (F11). see http://www.fabioz.com/pydev/manual_101_run.html HTH, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Max. size of User.email is 75 chars

2007-08-29 Thread Peter Melvyn
Hi all, I've a question, why max. size of User.email field is set to 75 characters, if RFC 2821 limits local part to 64 characters and domain to 255. With '@' it is together 320 chars. Should not be this field extended? Peter --~--~-~--~~~---~--~---

Re: unique_together and composite columns indexing

2007-08-30 Thread Peter Melvyn
te index by explicit command, it appears in sqlite_master table and is listed by .indices command 2.a If I let MySQL to explain a select command from such table, there is no composite index listed 2.a If I create a composite index by explicit command, it is listed by explain comman

Re: unique_together and composite columns indexing

2007-08-30 Thread Peter Melvyn
On 8/30/07, Peter Melvyn <[EMAIL PROTECTED]> wrote: > 2.a If I let MySQL to explain a select command from such table, there is no >composite index listed > 2.a If I create a composite index by explicit command, it is listed by explain >command among availabl

WordPress to Django Migration App

2007-08-30 Thread Peter Baumgartner
I was tinkering on this today and decided to toss it up on Google Code. This will app will hook into an existing WordPress database and create models for all the relevant content. It provides WP users with an extremely lazy way to convert their site to Django or could be used to manage a WP insta

Re: WordPress to Django Migration App

2007-08-31 Thread Peter Baumgartner
Practically, you should just build your own app and manually import your data. WPs database structure is less than ideal. My goal for this app was to lower the bar as much as possible for WP users wanting to try out Django. This is the path of least resistance for WP users to get their feet wet w

Re: newforms and DateField

2007-09-01 Thread Peter Melvyn
JavaScripts from contrib.admin.media.js.admin folder. To set attribute, you can do it this way: MyForm = forms.form_for_model(...) MyForm.base_field['my_field'].widget.attrs.update({'class':'vDateField'}) Peter --~--~-~--~~~---~--~~

Re: Problem in current svn TRUNK

2007-09-02 Thread Peter Nixon
On Tue 28 Aug 2007, Michael Radziej wrote: > On Tue, Aug 28, Michael Radziej wrote: > > On Mon, Aug 27, Peter Nixon wrote: > > > On Wed 11 Jul 2007, Michael Radziej wrote: > > > > Hi, > > > > > > > > you're using the alpha version of S

Re: passing data to view using httpresponseredirect

2008-01-03 Thread Peter Rowell
> def new(request, errors = [], messages = []): > ... > [ snip] > unfortunatly, django somehow remembers this and the arrays don't get cleaned > up. It's not django that's tripping you up. > So, normal python rules say these should get default values [] and > thus be cleared. Actually, normal

Re: passing data to view using httpresponseredirect

2008-01-03 Thread Peter Rowell
I didn't like my own explanation and did a little more searching. I just found a better description of this at http://requires-thinking.blogspot.com/2007/10/note-to-self-default-parameter-values.html. He points out that the 'def' is an executable statement and it's only executed once. Therefore,

Re: Django... False promises?

2008-01-04 Thread Peter Herndon
d in a different way provides extra perspective. And, more to the point, you've already dropped the sawbucks on the book, right? Regards, ---Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-04 Thread Peter Rowell
88 on an RHEL 4 box, Python 2.5.1, Apache 2.0.52, mod_python 3.3.1. TIA, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

Re: Context Processors: {{ MEDIA_URL }} not available in templates

2008-01-04 Thread Peter Rowell
> (3) Imported the RequestContext object in my views.py file: > > from django.template import Template, Context, RequestContext I know this is a silly question, but did you *use* RequestContext, or just import it? E.g. return render_to_response('base.html', RequestContext(reques

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-04 Thread Peter Rowell
> only save sessions which have been modified Actually, the code in the sessions/middleware is: if modified or settings.SESSION_SAVE_EVERY_REQUEST: so the whole point is to save it whether it's modified or not. But then you mentioned: > perhaps a misconfigured COOKIE_PATH Does "not conf

Re: Context Processors: {{ MEDIA_URL }} not available in templates

2008-01-04 Thread Peter Rowell
> Well, if I can't get this working I suppose I can just stuff the > settings.MEDIA_URL variable into each template render by placing it > into the render dictionary myself each time. Nah, don't do that. I think your problem is that you are running 0.96 instead of trunk. I am on trunk/6688 and

Re: Calling a method from the base template

2008-01-06 Thread Peter Rowell
iberately designed to discourage), consider using a different template package altogether. See http://www.djangosnippets.org/snippets/97/ for an example on how this can be done. HTH, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-06 Thread Peter Rowell
Malcolm, please accept my apologies for 1/2 of the problem described in the original article. I, of all people (I wrote debuggers back in the 80's), should know that you have to vet your diagnostic tools before you depend on them. Short version: The high cookie creation frequency was real (I'm go

Re: Calling a method from the base template

2008-01-06 Thread Peter Rowell
> There is a mechanism available > for that -- context processors -- but people don't want to use it > because they want *something else* that happens for every template. Malcolm's absolutely correct: context processors (I mis-typed when I said content processors) is exactly what you want here. T

Re: how to restrict username length must more than 5 words

2008-01-07 Thread Peter Rowell
> i user django-register in my project,it is fatastic, but how to: > 1. restrict username length must more than 5 words > 2. make sure email is unique. Good question. I don't recommend our short-term solution--modify the contrib/auth code--but it was the only way I could figure out how to do it a

Re: Many Django checkouts, setting which one to use (PYTHONPATH perference)

2008-01-07 Thread Peter Rowell
On Jan 7, 4:42 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Putting that in settings.py is too late, since by the thing that reads > settings.py is Django itself, so it's already been imported. You have to > modify your Python import path *before* anything Django-related is > imported. He'

Troubles with exceptions having localized text in debug.technical_500_response exception

2008-01-09 Thread Peter Melvyn
did I miss anything. I use release 6693 Thanks, Peter --~--~-~--~~~---~--~~ 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 th

Re: how to create new variable in html file in template

2008-01-09 Thread Peter Rowell
On Jan 9, 12:20 am, Gaojiawang <[EMAIL PROTECTED]> wrote: > I want to use the local variable in template's html file. > like 'count = 0' and how to use it > How to do it? The snippet José links to uses the resolve function of Django's templating system, which is good because it stays within the c

Re: Troubles with exceptions having localized text in debug.technical_500_response exception

2008-01-09 Thread Peter Melvyn
On 1/10/08, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > It's a bug. Please open a ticket about it, so we don't forget. Thank you for your help. Done. http://code.djangoproject.com/ticket/6353 Peter --~--~-~--~~~---~--~~ You received t

Re: SESSION_SAVE_EVERY_REQUEST creates new session?

2008-01-10 Thread Peter Rowell
Eoin: Do you have SESSION_SAVE_EVERY_REQUEST = True in your settings.py file? I found that with that set to False, the problem went away. From something Malcolm said, it may also go away if you explicitly set SESSION_COOKIE_DOMAIN. --~--~-~--~~~---~--~~ You receiv

Re: i18n problem: Some template variables "get stuck" in one language

2008-01-10 Thread Peter Rowell
Emil: > Except that on a couple of pages, > the language seems to get stuck on the translated language after the > first time I change languages. This smells very much like a caching issue. Do you have any form of caching enabled? If so, turn it off and see if the problem is magically fixed. Yo

trackback system

2008-01-11 Thread Peter Baumgartner
I need to add trackbacks to a blog app I've been using for a while. I don't want to reinvent the wheel, so I'm wondering what pre-built solutions are out there that I can bolt on. So far I've come across: * djog - http://dev.oebfare.com/projects/djog/ * blogmaker - http://code.google.com/p/blogmak

Tracing Django execution

2008-01-11 Thread Peter Rowell
> I think I got it! Wrong ordering of middleware - I had the i18n-urls > middleware before some other stuff, which screwed up a lot. I'm beginning to think of caching and middleware as being to Django problems as firewalls are to networking problems: powerful, unseen, 'out of band' manipulators.

Help tracking down runaway RAM

2008-01-18 Thread Peter Baumgartner
I'm serving up 6 Django apps on Ubuntu Gutsy with Ngninx 0.5.26 for a frontend and Apache 2.2.4 prefork MPM (tried both mod_python and mod_wsgi) serving Django rev. 6898. MySQL 5.045, Python 2.5.1 These are low traffic sites, 2 a bit more complex, 1 Satchmo install, and 3 very simple sites mostly

Re: Help tracking down runaway RAM

2008-01-18 Thread Peter Baumgartner
On Jan 18, 2008 8:48 AM, Peter Baumgartner <[EMAIL PROTECTED]> wrote: > I'm serving up 6 Django apps on Ubuntu Gutsy with Ngninx 0.5.26 for a > frontend and Apache 2.2.4 prefork MPM (tried both mod_python and mod_wsgi) > serving Django rev. 6898. MySQL 5.045, Python 2.5.1 &

Re: Help tracking down runaway RAM

2008-01-18 Thread Peter Baumgartner
No. On Jan 18, 2008 9:23 AM, James Bennett <[EMAIL PROTECTED]> wrote: > > Do you have "DEBUG = True" in your Django settings file? > > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of > correct." > > > > --~--~-~--~~~---~--~~ You received

Re: Help tracking down runaway RAM

2008-01-21 Thread Peter Baumgartner
on you could set Apache to kill a process when it > consumes too much memory. > > Sebastjan > > > On 1/20/08, Matt Davies <[EMAIL PROTECTED]> wrote: > > Peter > > > > Have you tried running the websites with lighttpd FCGI instead of Apache? > > > &

Managing the order of subordinate objects

2008-01-28 Thread Peter Rowell
I have run into the same problem on several different websites: a couple of PHP sites and, most recently, two Django sites. This is where you have a 'container object' that has a particular desired order of subordinate objects. Consider: class Newletter(models.Model): title = models.CharFiel

Re: Flash and Django

2008-02-01 Thread Peter Rowell
n and that you can hack on, I strongly recommend http://www.jeroenwijering.com/. Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Complex relationship for user profile

2008-02-01 Thread Peter Rowell
er way to capture the change, regardless of the source of the change. HTH, Peter --~--~-~--~~~---~--~~ 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@googl

Re: Tool recommendations

2008-02-04 Thread Peter Rowell
h-into-the-wall point, but it will give you Django's excellent error page, which includes a very nice stack trace and all of the local variables. Note: this won't do what you want during variable resolution in template pages because that is wrapped in a try/except block and

Re: Head swimming - JavaScript libraries

2008-02-17 Thread Peter Rowell
Yet another vote for jQuery. It completely changed the way I look at using JS on pages. BTW, ext works with jQuery. See http://docs.jquery.com/Tutorials:Using_Ext_With_jQuery --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Context Processing and per View Caching

2008-03-02 Thread Peter Rowell
> @cache_page(60 * 60 * 24) > def advert_detail_ver2(request,offer_id): ... > Is the cache holding just "offer" or all the variables? I have > {{ user }} in the template and this changes with each user, which > suggests that the context is not being cached - but I want to be > sure. Actually,

Re: Template caching?

2008-03-02 Thread Peter Rowell
7/oscon/tutorial/ Chris Pratt's page http://www.chrisdpratt.com/2008/02/16/signals-in-django-stuff-thats-not-documented-well/ . HTH, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

sxsw anyone?

2008-03-03 Thread Peter Baumgartner
Anyone here going to SXSW? It'll be my first trip this year and anyone that wants to meet up or impart some wisdom on me regarding the event would be great. -- Pete --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: IDE

2008-03-06 Thread Peter Herndon
I use vim a lot for, as Michael says, quick editing tasks. For longer coding sessions, I use Coda (http://www.panic.com/coda/). It's payware, and it's OS X only, but it is so easy and amazingly productive. You have a terminal session, WebKit-based browser, (S)FTP client, and a really decent tex

Re: IDE

2008-03-06 Thread Peter Danielczyk
I agree with casseen. Eclipse & Pydev works great for Django. See http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-django.html for intructions. BTW: " is a memory hungry monster " --> 1 Gig RAM is 20-25 Dollars :-) > > I use eclipse + pydev. Eclipse is a memory hungry monste

MySQL warnings raise exception

2008-03-06 Thread Peter Baumgartner
I'm running the same script over the same flat file that inserts data into the same app and same MySQL server for 3 different projects. Two of the projects print warning messages when bad data is encountered: /usr/local/lib/python2.5/site-packages/django/db/models/base.py:238: Warning: Data trunca

Re: Installing mod_python and Django on webserver

2008-03-23 Thread Peter Rowell
> He's running a site on vBulletin, so his PHP needs to stay, is there > any issues I should be careful of not upset the PHP, while still > getting Django and mod_python correctly installed on the server? The one thing I am aware of is that under certain circumstances there can be a problem invol

Re: Error with database encoding in UTF8

2008-03-27 Thread Peter Melvyn
On 3/26/08, Karen Tracey <[EMAIL PROTECTED]> wrote: > you have told MySQL that the data is utf8-encoded. I believe there is a way > (described in the MySQL doc page I cited above) to globally change your > MySQL config so it will expect/supply utf8 instead of latin1, so you might > want to look

Configuring Apache and mod_python for Django

2008-03-27 Thread Peter Rowell
In another thread (http://groups.google.com/group/django-users/ browse_thread/thread/962cfdf7609839eb/), On Mar 23, 11:48 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > For example, using prefork MPM because PHP is not thread safe in > conjunction with Python web applications in embedded mode

Re: how to convert {{candidate.vote_set.filter(vote='TU').count()}} in template syntax

2008-03-27 Thread Peter Rowell
late syntax. It compiles the templates to Python code for speed. I particularly like its support for macros with arguments. There is also Mako (http://www.makotemplates.org/). Here is a snippet that shows how to integrate Mako with Django. http://www.djangosnippets.org/snippets/97/

<    1   2   3   4   5   6   7   8   9   10   >