Re: better error handling in templatetags?

2009-11-26 Thread pihentagy
Isn't it a known thing, that template tags are hard to debug? Did I miss something? On Nov 11, 11:13 am, pihentagy wrote: > Hi all! > > I am not satisfied with the error handling inside custom template > tags. > To demonstrate it, I cooked a mini useless app, which can

better error handling in templatetags?

2009-11-11 Thread pihentagy
Hi all! I am not satisfied with the error handling inside custom template tags. To demonstrate it, I cooked a mini useless app, which can be downloaded here: What I miss from the error screen is the actual location of the error. http://cid-a93120a1b42a9e7f.skydrive.live.com/self.aspx/.Public/dj

admin like list view

2009-06-26 Thread pihentagy
Hi! I am developing a django app, which will be installed at multiple places with different configuration. It has some models, and list views. I store in a config dict the fields/methods to be displayed, and I'd like to offer sorting (automagically for all fields, where possible). My big proble

Re: setting language in a cron job

2008-12-12 Thread pihentagy
Thanks, it works!!! Well, again a low-level function %-/, but I hope I won't use too much of these magic low-level hacks. On Dec 12, 4:07 pm, Rajesh Dhawan wrote: > On Dec 12, 8:33 am, pihentagy wrote: > > Hi all! > > > I started to write a cron job, which sends remi

setting language in a cron job

2008-12-12 Thread pihentagy
Hi all! I started to write a cron job, which sends reminders to users, but run into the following: I do not know how to set the current language in this situation. Setting settings.LANGUAGE_CODE has no effect. Note, that not only the text in the mail should be different, but it contains model d

Django templates and new lines

2008-12-12 Thread pihentagy
Hi all! I ran into the problem mentioned here: http://groups.google.com/group/django-users/browse_frm/thread/c9e569f7370c9c80/3b645501e9b67aa8 Does anybody know whether anything happened after that thread? thanks Gergo --~--~-~--~~~---~--~~ You received this mess

Re: help for Date base generic views

2008-10-29 Thread pihentagy
Metoo. I also don't quite understand how can I use it easily. On Oct 29, 10:02 am, "please smile" <[EMAIL PROTECTED]> wrote: > Hi All, >           Can anyone please send me a small date based generic view > application . >          Thank You. --~--~-~--~~~---~--~~

KeyError with cache

2008-10-27 Thread pihentagy
Hi all! I'm getting KeyErrors on my site. The key seems much like a cache key, and the stack trace verifies it. How can I avoid it? Is there a maximum number or entries I can use? Or is it not thread- safe? CACHE_BACKEND = 'locmem:///?max_entries=3' Trace comes: Traceback (most recent call

Re: problem with i18n (blocktrans)

2008-10-15 Thread pihentagy
Ok, I have figured out. You should never use non-unix-style line-endings in your templates, because blocktrans will not work :-/ On Oct 15, 11:42 am, pihentagy <[EMAIL PROTECTED]> wrote: > Hi all! > > Can somebody please tell me what's wrong with my template and/or po &g

problem with i18n (blocktrans)

2008-10-15 Thread pihentagy
Hi all! Can somebody please tell me what's wrong with my template and/or po file? trans tags work fine, but blocktrans isn't translated. http://dpaste.com/hold/84553/ thanks pihentagy --~--~-~--~~~---~--~~ You received this message because you are sub

Navigation elements at top and bottom

2008-10-10 Thread pihentagy
Hi! I need an advice. Until now, I have a base.html, which looks like sg. like: {%block prev %}{% endblock %} {% block next %}{% endblock %} {% block path %} {% endblock %} {% block content %} {% endblock%} By inheriting this template in all other templates, and filling the block went fine. But

Re: mptt + contrib.comments?

2008-10-04 Thread pihentagy
Hi! What about thins project? http://code.google.com/p/django-threadedcomments/ --~--~-~--~~~---~--~~ 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.c

Re: per-request cache

2008-09-30 Thread pihentagy
Hi! Thanks for your reply. I thought about it, and come up with the following comments: On Sep 15, 11:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 15, 9:11 am, pihentagy <[EMAIL PROTECTED]> wrote: > > Also for consistency and for perform

Re: How to view the sql query statement involved in a django web page?

2008-09-30 Thread pihentagy
That's fine, and useful indeed, but I need a bit more detail: I'm hunting for duplicate queries. Is there a possibility to tell where django fires those queries? thanks On Aug 29, 6:38 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > How to view thesqlquerystatement involved in a django web page for

Re: locale aware number formats

2008-09-23 Thread pihentagy
On Sep 23, 12:28 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-23, o godz. 12:21, przez pihentagy: > > > How can I print a number using the locale's thousand separator and > > decimal? > > > Basically I hoped ther is a te

locale aware number formats

2008-09-23 Thread pihentagy
Hi all! How can I print a number using the locale's thousand separator and decimal? Basically I hoped ther is a template filter, but floatformat doesn't have thousand separator, and seems to use decimal point always. thanks Gergo --~--~-~--~~~---~--~~ You receive

copying data from a model to another (having common abstract base class)

2008-09-19 Thread pihentagy
Hi! Suppose I have 2 models with a common abstract base class: class Base(models.Model): Meta: abstract=true field1 = ... ... class Child1(Base): ... class Child2(Base): ... Is there a way to copy child1's fields coming from Base to child2 where child1, child2 has type Child1, C

Truncated incorrect DOUBLE value: 'AnonymousUser'

2008-09-18 Thread pihentagy
? Thanks pihentagy >>> UserProfile.objects.get(user=AnonymousUser) Traceback (most recent call last): File "", line 1, in File "/home/profilia/.python/lib/python2.5/site-packages/django/db/ models/manager.py", line 93, in get return self.get_query_set().get(*

per-request cache

2008-09-15 Thread pihentagy
Hi all! I have a site with sidebar, and main area... I watch the queries, and found that the same queries are executed more, than once. The reason for it: there are some informations in the sidebar, and in the main area (if you request certain pages). Also for consistency and for performance rea

django-mptt and fixtures

2008-09-03 Thread pihentagy
Hi all! Has anybody tried to load a fixture to a model class, which is registered with mptt? I tried and failed, all the internal columns need to be filled. Has anybody a solution how to dump and/or restore such tables? thanks Gergo --~--~-~--~~~---~--~~ You rece

Re: similar method for get_or_create()

2008-07-22 Thread pihentagy
Hi! I also have the same issue. I should write: pp, pp_created = WSProductPurchase.objects.get_or_create(purchase=purchase, ws_product=ws_product, defaults=dict(quantity=quantity)) if not pp_created: pp.quantity = quantity pp.save() I suspect lepp

accessing a model ojbect's saved fields

2008-07-09 Thread pihentagy
Hi all! Is it possible to access a model object's saved field values? Purpose: I have an ImageField, and if that field changes, I would like to remove the old file from the filesystem. Now the only way to figure it out is with a new query, but I suspect this hits the database again, and seems a b

Re: forms + UI question

2008-07-03 Thread pihentagy
I don't quite get how a context processor, which can define template variables, help here. On Jul 3, 12:43 am, phillc <[EMAIL PROTECTED]> wrote: > look up context processors > > On Jul 2, 4:31 am, pihentagy <[EMAIL PROTECTED]> wrote: > > > Hi! > > >

forms + UI question

2008-07-02 Thread pihentagy
Hi! I have an auction site, the items appear in more views (and there are more items in a view), and I would like to allow users to bid on every view. I have done it somehow, but I think that solution is not pretty (I mean the code quality). I would like to use the same newforms form on every vie

language should be part of the url

2008-06-26 Thread pihentagy
Hi! As I read in http://groups.google.com/group/django-users/browse_thread/thread/f8558f8c4c0de564/28ae8a6ecbb921ff the current language should be part of the URL. Just a little question: how can I achieve that without messing up all my reverse function, and of course links in the template... a

Re: using only database part of Django

2008-06-26 Thread pihentagy
Then why django? What about sqlalchemy? On Jun 26, 1:13 pm, Peter <[EMAIL PROTECTED]> wrote: > Hello. > > I want to use Django database API without using other parts of Django > (views, templates etc). > > What is the most correct way of doing that? > > Of course, I can create a new project with

i18n model - tri-lingual data

2008-06-26 Thread pihentagy
Hi! I have a 3-lingual app, and there are some model fields translated, like this: class Category(models.Model) name_hu = models.CharField(_(u'név (magyar)'), max_length=255,) name_en = models.CharField(_(u'név (angol)'), max_length=255) name_de = models.CharField(_(u'név

Re: django-registration with my custom user profile

2008-06-25 Thread pihentagy
Hi! I'm also trying to use django-registration. In my case the userprofile is mandatory, so I should create my own form. However, I would like to use ModelForms for the UserProfile part, but I should also provide room to enter username, and password. (and I also would like to store additional dat

slightly off: icon for the google group

2008-06-25 Thread pihentagy
Hi all! Maybe it should sound a bit offtopic, but can I ask for a custom icon for the group? I have subscribed to a bunch of google groups, and many of them doens't use custom icon (many computer icons around). Using a custom icon will help people quickly find this group :) thanks Gergo --~--~--

Re: django-registration with my custom user profile

2008-06-19 Thread pihentagy
You didn't provide the 'dob' parameter. On Jun 13, 12:02 pm, Chr1s <[EMAIL PROTECTED]> wrote: > Hi thanks for your replay, > It is the second situation, I re-write the form.py like this > > class RegistrationForm(forms.Form): >   (other stuff  ) > def save(self, profile_callback=None

Re: newbie: Filter an inclusion tag

2008-06-19 Thread pihentagy
Thanks! Saved my day :) On Jun 17, 2:32 am, Ned Batchelder <[EMAIL PROTECTED]> wrote: > I think this will work: > >     {% filter truncatewords:10 %} >     {% i18n_attr auction 'description' LANGUAGE_CODE %} >     {% endfilter %} > > --Ned.http://nedbatcheld

newbie: Filter an inclusion tag

2008-06-16 Thread pihentagy
Hi all! I have an inclusion tag: {% i18n_attr auction 'description' LANGUAGE_CODE %} I don't know how can I filter it with truncatewords. {% i18n_attr auction 'description' LANGUAGE_CODE|truncatewords:10 %} doesn't work. Any ideas? thanks --~--~-~--~~~---~--~~

registration with mandatory profile

2008-06-13 Thread pihentagy
Hi all! I need an app, which registers users but also forces user to fill out a profile. I found the link below, but it seems to me, that django-profile will not send email, and with django-registration I cannot force users to fill out a profile (I would like to use ModelForm for this) So what i

i18n with exactly 3 languages

2008-06-10 Thread pihentagy
Hi all! I should create an app with exactly 3 languages. So, I have a model with name_en name_de and name_hu fields. I would like to have a name method, which returns the name in the currently selected language. I need a solution, which can also work with generic views (object_list, object_detai

foreign key and verbose name?

2008-06-09 Thread pihentagy
Hi all! In the docs here: http://www.djangoproject.com/documentation/model-api/#verbose-field-names Each field type, except for ForeignKey, ManyToManyField and OneToOneField, takes an optional first positional argument — a verbose name. If the verbose name isn’t given, Django will automatically

generic views

2008-06-05 Thread pihentagy
Hi all! As I can see in the docs, django.views.generic.create_update.delete_object needs a post_delete_redirect parameter. Isn't it possible to redirect to the referrer, if the parameter is not given? It would make sense IMHO. The other thing, that annoys me, that I cannot easily check permissi

Re: auto admin for production

2008-06-03 Thread pihentagy
On May 10, 1:25 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > pihentagy wrote: > Currently the admin interface doesn't handle row-level permissions. A > user can be granted to edit articles, but not restricted to only their > own. I *believe* this is a feature that wi

Re: auto admin for production

2008-05-10 Thread pihentagy
Jeff Anderson wrote: > pihentagy wrote: > > Hi all! > > > > I come to here from a little symfony background (a framework, which > > try to borrow good things from django), and would like to have an > > overview how django stacks up. > > > > I would li

auto admin for production

2008-05-09 Thread pihentagy
Hi all! I come to here from a little symfony background (a framework, which try to borrow good things from django), and would like to have an overview how django stacks up. I would like to ask, if the admin module can be used on a production server by registered users. What problems can occur?