parametric class-based form views

2011-06-27 Thread omat
(how) can I make a CreateView use a dynamic form based on a parameter passed from the url? Thanks, oMat -- 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 fro

Re: Accessing model field validators from within form template

2010-08-20 Thread omat
a parameter to the validator and in the help text. I would like to display the max length value using a generic template. Cheers, omat > On Aug 18, 3:41 pm, omat wrote: > > > > > Hi, > > > In my generic form template, if a CharField has a max_length >

Accessing model field validators from within form template

2010-08-18 Thread omat
heers, omat -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, v

Overriding the widget of a custom form field in admin

2010-08-12 Thread omat
TagField: {'widget': admin.widgets.AdminTextareaWidget}, } This has no effect on the form field widget and tags are still rendered with a TextInput widget. Any help is much appreciated. -- omat -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: how to avoid "in" query for large sets?

2010-05-24 Thread omat
z__in=quiz_qs) is not possible as User does not have a quiz attribute. and daniel, yours, saying "user.id in Quiz queryset" does not look ok: User.objects.filter(id__in=Quiz.objects.filter(score__gt=90)) Still stuck. Any ideas? -- oMat On May 24, 4:58 pm, omat wrote: > @cliff:

Re: how to avoid "in" query for large sets?

2010-05-24 Thread omat
@cliff: you are right, but i am writing an extension to an existing app. i want to use the models as-is if possible. i found the part in the docs: inner_qs = Blog.objects.filter(name__contains='Cheddar') entries = Entry.objects.filter(blog__in=inner_qs) thanks. On May 24, 4:22 pm, Tomasz Ziel

Re: how to avoid "in" query for large sets?

2010-05-24 Thread omat
ops, a small correction. i meant: User.objects.filter(id__in=[q.user.id for q in Quiz.objects.filter(score__gt=90)]) -- oMat On May 24, 3:12 pm, omat wrote: > Hi All, > > I have a Quiz model, which is related to the User model by a > ForeignKey. I want to get a queryset of users

how to avoid "in" query for large sets?

2010-05-24 Thread omat
. What is the optimal way of doing this? Thanks, oMat -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-user

Re: cache optimization

2009-12-22 Thread omat
e the actual content for much longer, e.g. 1 month. Then, if something related to its context is submitted, I remove those pages from the cache. Maybe I am thinking this in a wrong way from the start. Thanks, omat On Dec 22, 3:50 pm, Javier Guerra wrote: > On Tue, Dec 22, 2009 at 8:44 AM,

cache optimization

2009-12-22 Thread omat
many issues, mainly due to running out of memory, and in the end the whole system is screwed. using no caching is doing much much better than this setup. Any suggestions for optimizing the caching is greatly appreciated. -- omat -- You received this message because you are subscribed to the G

Re: sorl thumbnail: messed-up thumb file path

2009-12-06 Thread omat
It is not something to do with the upload_to path. I managed to track down the problem, I was passing the full url to the thumbnail templatetag (i.e. "provider.logo.url") but it should be just the relative URL (i.e. "provider.logo"). Thanks. -- omat On Dec 6, 9:10 pm

Re: sorl thumbnail: messed-up thumb file path

2009-12-06 Thread omat
The model is as simple as can be: class Provider(models.Model): name = models.CharField(max_length=100) logo = models.ImageField(upload_to='logo/', blank=True, null=True) Thanks. -- omat On Dec 6, 4:45 pm, Kenneth Gonsalves wrote: > On

sorl thumbnail: messed-up thumb file path

2009-12-06 Thread omat
ories under my media root as: - "http/" (yes the directory name has a trailing slash) - "localhost/8000" (yes, this is funny too) - "logo" (this is the upload_to location) and the created directory is empty, no thumbnail. Am I missing something obvious? T

Re: Admin action not executed when no objects are selected

2009-05-22 Thread omat
and admin templates, which doesn't feel right. Maybe there should be a way to define model-wide actions as well as the current ones. -- omat On Apr 8, 3:10 am, Alex Gaynor wrote: > On Tue, Apr 7, 2009 at 8:04 PM, Malcolm Tredinnick > > > > wrote: > > > On Tue, 200

admin actions independent of the items selected

2009-05-22 Thread omat
le that functionality. Then I would have some admin actions in the ModelAdmin classes and some in the views and admin templates, which is not a neat solution. Can the ModelAdmin be overridden to let the selected action be executed without caring abou

Re: You don't have permission to edit anything - new forms admin

2009-05-07 Thread omat * gezgin.com
/dev/topics/auth/#other-authentication-sources should mention that. Best, oMat On Mar 12, 4:28 pm, dave wrote: > Hi, > I'm encountering exactly the same problem as yours. Didyoufinally > find the solutions? > Thanks, > Dave > > On Feb 17, 1:25 pm, Tipan wrote: >

Re: admin permissions: all or nothing

2009-05-07 Thread omat * gezgin.com
n/dev/topics/auth/#other-authentication-sources I think, this document should mention about admin / permissions issues when using custom backends. Best, oMat On May 7, 3:01 pm, "omat * gezgin.com" wrote: > While trying to track down the problem, I encountered this strange &

Re: admin permissions: all or nothing

2009-05-07 Thread omat * gezgin.com
ns() set([]) Am I missing something basic? Best, oMat On May 7, 1:25 pm, "omat * gezgin.com" wrote: > Sure, otherwise I won't be able to login to admin with that user at > first place. > > Best, > oMat > > On May 7, 1:04 pm, Kenneth Gonsalves wrote: &

Re: admin permissions: all or nothing

2009-05-07 Thread omat * gezgin.com
Sure, otherwise I won't be able to login to admin with that user at first place. Best, oMat On May 7, 1:04 pm, Kenneth Gonsalves wrote: > On Thursday 07 May 2009 15:32:08 omat wrote: > > > "You don't have permission to edit anything." > > you have

admin permissions: all or nothing

2009-05-07 Thread omat
Hi, I have set up the admin, and works as expected when logged in as a super user. When I log in with a user that have limited permissions (either when permissions were assigned directly to the user or through a group membership), the admin site says: "You don't have permission to edit anything

Re: annotation and grouping

2009-05-04 Thread omat * gezgin.com
queries is the most civilized way to go. Best, oMat On Apr 29, 3:12 pm, Russell Keith-Magee wrote: > On Wed, Apr 29, 2009 at 4:08 PM,omat wrote: > > > Hi all, > > > I would like to fetch the latest entries for each user from a model > > like: > > > cl

annotation and grouping

2009-04-29 Thread omat
., wouldn't it be great to have something like: Entry.objects.annotate(Max('added'), group_by=['user']).filter (date=date__max) Thanks, oMat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

problem with iexact / icontains matches and TR locale

2009-04-16 Thread omat
27;I', which is a legal ascii character for a username, iexact does not match it with 'i', which is the slugified version of the 'I', but matches with 'ı' (the non-ascii char), when the locale is TR. i.e. I need something like: User.objects.get(username__slug=us

permissions not recognized

2009-03-25 Thread omat
s.all() [, ...] # the user is in the group admin, and admin group has permissions >>> u.groups.all() [] >>> u.groups.all()[0].permissions.all() [, , ...] # but >>> u.get_all_permissions() set([]) Strange, or am I m

Re: Postgis on Mac OS Leopard

2009-03-02 Thread omat * gezgin.com
 pm, "omat * gezgin.com" wrote: > > > 'file' for liblwgeom.so and two of it dependencies (libgeos_c.1.dylib > > and libproj.0.dylib) reveals they are built only for i386. > > > Is this ok or should it be x86_64? as I built from source, how come >

Re: Postgis on Mac OS Leopard

2009-02-27 Thread omat * gezgin.com
'file' for liblwgeom.so and two of it dependencies (libgeos_c.1.dylib and libproj.0.dylib) reveals they are built only for i386. Is this ok or should it be x86_64? as I built from source, how come they are built for the wrong architecture, if so? Thanks, omat On Feb 27, 11:16 

Re: Postgis on Mac OS Leopard

2009-02-27 Thread omat * gezgin.com
I am using the django's built-in development server. Thanks. On Feb 27, 12:48 am, Graham Dumpleton wrote: > On Feb 27, 12:29 am, "omat * gezgin.com" wrote: > > > Thanks for the pointer. > > > But I checked the architecture of the liblwgeom.so with &#

Re: Postgis on Mac OS Leopard

2009-02-26 Thread omat * gezgin.com
pm, Graham Dumpleton wrote: > On Feb 26, 10:07 pm, omat wrote: > > > > > Hi all, > > > Following the instructions on inhttp://geodjango.org/docs/install.html, > > i managed to get to "Creating a Spatial Database Template" section. > > > But when tr

Postgis on Mac OS Leopard

2009-02-26 Thread omat
/usr/local/pgsql_saved_0804141532/lib/liblwgeom.so: mach-o, but wrong architecture Can it be that a conflicting version already existed and caused problems? Or what? I took the "build from source" path as instructed in the install documentation. I am using PostgreSQL 8

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-03 Thread omat
I opened the ticket: http://code.djangoproject.com/ticket/10182 Thanks. On Feb 3, 1:25 am, Russell Keith-Magee wrote: > On Mon, Feb 2, 2009 at 4:46 PM,omat wrote: > > > I just remembered that the above error occured when running on > > Postgresql 8.2. Sorry for the misinform

Re: EmptyResultSet exception

2009-02-02 Thread omat
I am using a recent svn checkout. I opened a ticket for the issue: http://code.djangoproject.com/ticket/10181 Best. On Feb 3, 5:03 am, Malcolm Tredinnick wrote: > On Mon, 2009-02-02 at 03:23 -0800,omatwrote: > > Hi, > > > I am receiving an EmptyResultSet exception in 'in' lookups, if the > >

Re: EmptyResultSet exception

2009-02-02 Thread omat
A typo correction: In line >>> ids = Tag.objects.filter(id__in=[]).values_list(id, flat=True) "id" in expression values_list(id, flat=True) should be quoted as: values_list('id', flat=True) Thanks... On Feb 2, 1:23 pm, omat wrote: > Hi, > > I am

EmptyResultSet exception

2009-02-02 Thread omat
t in an 'in' lookup: >>> Tag.objects.filter(id__in=ids) This results in an EmptyResultSet exception, where I would expect an empty QuerySet instead. Am I missing something here? Thanks... oMat ps: I am running the most rec

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-02 Thread omat
rank = models.IntegerField(default=0) relevance = models.IntegerField(default=0) added = models.DateTimeField(auto_now_add=True) Thanks... On Feb 2, 9:46 am, omat wrote: > I just remembered that the above error occured when running on > Postgresql 8.2. Sorry for the misinfor

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-01 Thread omat
: tagging_taggeditem.added This is very strange, because the column 'added' is surely there. On Feb 1, 11:39 pm, omat wrote: > Hi, > > TaggedItem model is as follows: > > class TaggedItem(models.Model): >     tag = models.ForeignKey(Tag, verbose_name=_('tag'

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-01 Thread omat
ent type')) object_id = models.PositiveIntegerField(_('object id'), db_index=True) object = generic.GenericForeignKey('content_type', 'object_id') And I am using sqlite on Mac OS X with django revison 9781. Thanks, oMat On Feb 1, 1:12 am, Russel

"invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread omat
Hi all, I obtain a list of tag ids by: tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max ('added'))[:10] and try to use it in the following query to obtain tag objects: Tag.objects.filter(id__in=tag_ids) But i get "invalid reference to FROM-clause" error: Caught an except

order queryset by a calculated field

2009-01-23 Thread omat
Hi, Is it possible to order a queryset by a calculated field, such as multiplication of 2 attributes? With the fantastic aggregate functions introduced, I think something like this would be cool: Book.objects.annotate(total=Arithmetic('price * tax')).order_by ('total&#

"safari can't open the page"

2008-11-29 Thread omat
ot seem to be a real solution. I doubt that Django's response may have something (HTTP headers?) that safari don't like. Any ideas? Cheers, oMat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

admin can't update: AttributeError 'parse_file_upload' for a model with no file field

2008-11-25 Thread omat
at /pathwaysolutions/validation/admin/ encounter/standardcomment/10/ Exception Value: 'module' object has no attribute 'parse_file_upload' This happens for every model and every add / edit operation. The model in example does not have a file or image field. Where does this &

Re: updating a single field / attribute, is it possible? or better practices?

2008-10-31 Thread omat
Exactly. Thanks for the reference. -- oMat On Oct 31, 6:54 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 31, 2008 at 12:39 PM, omat <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > Is it possible to update a chosen subset of a

updating a single field / attribute, is it possible? or better practices?

2008-10-31 Thread omat
or any comments, oMat --~--~-~--~~~---~--~~ 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: max_length for TextField is not respected

2008-10-24 Thread omat
Thanks for the reply Karen. Accepted but not used? Neither in the model nor in the forms? This is not how I would expect it to be. Then, how can I limit a, say comment field to 500 chars in a djangoic way? Thanks... -- omat On Oct 24, 6:09 pm, "Karen Tracey" <[EMAIL PROT

max_length for TextField is not respected

2008-10-24 Thread omat
eld? Is it something supported at db level? I am using sqlite and django 1.0. Thanks for any comments... -- omat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: moving file / image fields to another model

2008-09-20 Thread omat
It was this: http://code.djangoproject.com/ticket/7411 It is not valid anymore, but as I couldn't find time to port to post 1.0 I was experiencing this problem. On Sep 20, 11:36 am, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > Due to a model change, I would like to move a

moving file / image fields to another model

2008-09-20 Thread omat
error': >>> from products.models import * >>> for product in Product.objects.all(): >>> Image.objects.create(product=product, image=product.image) Is there a way to do such an import in django way, or should I go the raw SQL path? thanks, omat --~--~-

Re: The view django_bookmarks.bookmarks.views.bookmark_save_page didn't return an HttpResponse object

2008-09-20 Thread omat
are you getting the error with a GET request? On Sep 20, 9:08 am, ehpmail <[EMAIL PROTECTED]> wrote: > Why do i get the above error in views.py: > > def bookmark_save_page(request): >     if request.method == 'POST': >         form = BookmarkSaveForm(request.POST) >         if form.is_valid

doctest for multi-threaded apps

2008-09-02 Thread omat
to be called, I receive a: Exception in thread Thread-2: ... traceback ... OperationalError: no such table: game_question Does this mean the db tables are created only for the main thread and other threads cannot access the temporary db? Thanks, oMat

Re: advice on model design please

2008-08-20 Thread omat
I think the most natural fit for this is a database like the google appengine provides, not a relational one: Attach a review to an encounter whenever needed, and access it as an attribute of the encounter On Aug 19, 11:29 pm, omat <[EMAIL PROTECTED]> wrote: > Another approach

Re: advice on model design please

2008-08-19 Thread omat
encounter model will be reflected to the Review model resulting in DRYness. But this will not avoid the redundancy in the db tables. Thanks... On Aug 19, 11:02 pm, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a model class that holds patients' encounters. It has fie

advice on model design please

2008-08-19 Thread omat
unter) review = XMLField() And the 'review' XML field will hold all the data on reviewed fields in a non-relational and flexible format. I cannot decide among these approaches as neither of them feels natural. Any advice would be much appreciated.

Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat
I have submitted a ticket for the issue: http://code.djangoproject.com/ticket/7585 Thanks... On Jul 1, 12:51 pm, omat <[EMAIL PROTECTED]> wrote: > More specifically, I think the problem is in > ReverseSingleRelatedObjectDescriptor in related.py, where it does not > check if

Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat
low null values.' % (instance._meta.object_name, self.field.name)) ... On Jul 1, 12:30 pm, omat <[EMAIL PROTECTED]> wrote: > But it is raised at the line: > > photo = form.save(commit=False) > > On Jul 1, 12:26 pm, Malcolm Tredinnick <[E

Re: a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat
But it is raised at the line: photo = form.save(commit=False) On Jul 1, 12:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-01 at 02:18 -0700, omat wrote: > > Hi, > > > I updated Django to svn trunk v. 7811 from about a week old version.

a recent update broke form.save(commit=False) on FK fields

2008-07-01 Thread omat
=False): ValueError: Cannot assign None: "Photo.album" does not allow null values. -- omat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
AIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 12:10 PM, omat <[EMAIL PROTECTED]> wrote: > > > Thanks for the clarification. > > > Apparently my demo case of the problem was not appropriate, but my > > real problem is still there. > > > I have 2 ModelForms t

Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
ext(request)) But when I submit an invalid entry_form (i.e. nothing related to item form is executed or accessed other then the initialization item_form = ItemForm(request.POST, instance=item)) the item_form arrives at my template with a filled errors dictionary. Any opinions? -- omat On Jun 27

ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
tem >>> form = ItemForm({}, instance=Item()) >>> form.errors {'title': [u'This field is required.']} >>> The ItemForm is a ModelForm build from Item model. Is the documention or the behavior wrong? Thanks, omat --~--~-~--~~~--

Re: works for SQLite, causes ProgrammingError

2008-06-06 Thread omat
, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > omat pisze: > > >http://dpaste.com/54750/ > > This is postmortem after actual error which happened before. Basically > for PostgreSQL it works like this: if you gen an error in transaction, > any later statement raises programm

works with SQLite, causes ProgrammingError with Postgres

2008-06-06 Thread omat
jango with Postgres 8.2 on Mac OS. This seems like a bug. Any ideas? Thanks, omat --~--~-~--~~~---~--~~ 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@goog

works for SQLite, causes ProgrammingError

2008-06-06 Thread omat
http://dpaste.com/54750/ --~--~-~--~~~---~--~~ 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

queryset intersection bug?

2008-06-05 Thread omat
avorites_favorite".object_id The query representing qs2 is: SELECT "notes_note"."id", "notes_note"."title", "notes_note"."slug", "notes_note"."note", "notes_note"."tags", "notes_note&qu

Re: paginator LIMITing properly?

2008-06-03 Thread omat
I figured it out: I should you QuerySetPaginator instead of the Paginator and the LIMIT is set properly. Thanks. On Jun 3, 2:44 pm, omat <[EMAIL PROTECTED]> wrote: > Hi, > > I am using a recent svn checkout of django and: > > Paginator(User.objects.all(), 20) > &g

paginator LIMITing properly?

2008-06-03 Thread omat
."date_joined" FROM "auth_user" WHERE "auth_user"."is_active" = true ORDER BY "auth_user"."date_joined" DESC As you can see there is no LIMIT in this query and it takes quiet a long time to execute (about 0.2 sec.) Shouldn't the pa

Re: Still a bug with OR lookups?

2008-05-30 Thread omat
And, I think your problem is the same that makes "union with an empty queryset always result in an empty queryset" bug: User.objects.filter(Q) | User.objects.none() => always returns an empty queryset. -- omat On May 30, 12:12 pm, omat <[EMAIL PROTECTED]> wrote: > Hi J

Re: Still a bug with OR lookups?

2008-05-30 Thread omat
ject.com/ticket/7277 I tried to track down the problem in the django.db.query and solve my problems partially by monkey patching but I am not comfortable at all and looking forward for the official resolution. -- omat On May 30, 9:57 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > &

Re: KeyError from query.combine() when merging 2 QuerySets; bug or what?

2008-05-24 Thread omat
Not sure but this can be related to ticket #7277: http://code.djangoproject.com/ticket/7277 On May 23, 7:59 pm, omat <[EMAIL PROTECTED]> wrote: > I am trying to merge 2 QuerySet objects with the following function: > > qs_user = queryset.filter(user=user)

KeyError from query.combine() when merging 2 QuerySets; bug or what?

2008-05-23 Thread omat
'favorites_favorite' is the table name as returned by "Model._meta.db_table" The line: promote = (rhs.alias_map[alias][JOIN_TYPE] == self.LOUTER) raises thi exception as "rhs.alias_map" does not contain the key 'favorites_favorite' This seems like a bug

Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-23 Thread omat
I figured it out: unique query is referring to distinct() and to combine two QuerySets, they should both be distinct() or non-distinct. On May 23, 12:17 pm, omat <[EMAIL PROTECTED]> wrote: > I was able to track down the problem a little further and I saw that > > Tag.object

Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-23 Thread omat
means? What is a unique query? On May 22, 7:08 pm, omat <[EMAIL PROTECTED]> wrote: > An other case where I get empty result sets unexpectedly is when I > want to join 2 querysets, one holding the objects that the current > user entered and the other holds the objects marked as

Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-22 Thread omat
Set is exactly the same as the result of a query set generated by Note.objects. But when I try to get the union such as Note.objects.all() | Favorite.objects.get_by_user(Note, user) The result is a QuerySet objects with no elemnts in it. Thanks... On May 22, 4:38 pm, omat <[EMAIL PROTECTE

union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-22 Thread omat
Note.objects.none() Shouldn't it be equivalent to Note.objects.filter(tag='foo'). Am I missing something? Thanks, omat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Ordering extra fields in ModelForm

2008-05-21 Thread omat
wish hem to be displayed, but this is not applicable to my case. I tried specifying fields = (...) in the Meta inner class of the ModelForm class, but its order is not taken into account. Is there a way to specify the field order in ModelForm with extra fields? Thanks, omat

Re: ModelForm and MultiValueField

2008-05-20 Thread omat
Thanks for the reply. Here are the HistoricDateField and the HistoricDateWidget classes: http://dpaste.com/hold/51690/ -- omat On May 20, 8:08 pm, fivaldi <[EMAIL PROTECTED]> wrote: > Hi Omat, > > Does your HistoricDateField implement the compress(self, data_list) > me

ModelForm and MultiValueField

2008-05-20 Thread omat
form is not called and cleaned_data does not have the data for 'date'. Am I missing something or is it a bug? Thanks, omat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: manually rendered templates not recognized for translation?

2008-05-05 Thread omat
This was because all the templates should have the "html" extension to get translated. On Apr 1, 11:32 am, omat <[EMAIL PROTECTED]> wrote: > Hi, > > I am sending notification e-mails to members on some actions. The > message body comes from a template: > &g

HEAD requests causing AttributeError

2008-05-01 Thread omat
ENT': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv: 1.8.1.11) Gecko/20071127 Firefox/2.0.0.11', 'PATH_INFO': '', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '80.67.25.132', 'REMOTE_HOST': N

Re: beware: make-messages is file extension sensitive

2008-04-30 Thread omat
maintainable (though hacky) way is to create a template file such as translation.html and put the strings to be translated into that file such as: {% load i18n %} {% trans "Home page" %} {% trans "Continue" %} On Apr 30, 3:14 pm, omat <[EMAIL PROTECTED]> wrote: > H

beware: make-messages is file extension sensitive

2008-04-30 Thread omat
projects (settings, models, views, etc) to find related files and extract text to be translated. The way it actually is is more simple and straight-forward, so it is quite ok. But dependency on file extension (especially for templates) was something I wouldn't expect. Regards,

manually rendered templates not recognized for translation?

2008-04-01 Thread omat
when I build the translation file, the text is not recognized to be translated and does not appear in the translation file. How can I make xgettext to process those templates? Thanks, oMat --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: ModelForm design issue

2008-03-08 Thread omat
ble dealing with the date. > > Just a thought, might be able to help. > > Michael > > On Fri, Mar 7, 2008 at 9:54 AM, omat <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I need some advice to build an event submission form in a smart way. > > > I have 2

ModelForm design issue

2008-03-07 Thread omat
y) except Event.DoesNotExist: pass else: raise forms.ValidationError(_('This event already exists')) return self.cleaned_data I couldn't solve the challenges mentioned above. Any help is appreciated. Thanks, oMat --~--~-

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 cus

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

OR lookups on m2m relations fail

2008-03-03 Thread omat
Hi, Suppose 'categories' is the name of a ManyToMany field in our model (with blank=True). Q(name = 'test') | Q(categories__title = 'xyz') fails to match the instance with name = 'test' if the instance is not related to any category. This see

Re: Django on MacOS X Leopard

2008-02-01 Thread omat
t the duplicates in. On Feb 1, 12:36 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:05 am, omat <[EMAIL PROTECTED]> wrote: > > > When I install Django on Leopard, py files went into: > > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.

Django on MacOS X Leopard

2008-01-31 Thread omat
having this problem. I would like to hear if there are any better approaches. oMat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: "unknown locale: UTF-8"

2008-01-30 Thread omat
Yes! This solved the problem... Thanks a lot Thomas... On Jan 30, 5:51 pm, Thomas <[EMAIL PROTECTED]> wrote: > Hi Omat, > > May be > > export LC_ALL=en_US.UTF-8 > > in terminal prior to syncdb would help. > > Regards, > Thomas > > On Jan 30, 4:34 pm

Re: "unknown locale: UTF-8"

2008-01-30 Thread omat
OK, I found it, it is a bug: http://code.djangoproject.com/ticket/5846 On Jan 30, 5:34 pm, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > When I try to syncdb I am getting a "unknown locale: UTF-8" error. > > I am using a recent checkout from the trunk with Postgr

"unknown locale: UTF-8"

2008-01-30 Thread omat
Hi all, When I try to syncdb I am getting a "unknown locale: UTF-8" error. I am using a recent checkout from the trunk with Postgres on MacOS X. My database is UTF-8 and my DEFAULT_CHARSET is 'utf-8'. The application was used to run on different platforms as-is. Any ideas?

Re: filtering on a date field's component; a bug?

2008-01-22 Thread omat
, 2, 3]) format should be supported. I will submit it as a feature request to trac. On Jan 22, 2:58 am, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > omat wrote: > > Hi all, > > > I have a model with a date field. When I try to filter based on its > >

filtering on a date field's component; a bug?

2008-01-22 Thread omat
Hi all, I have a model with a date field. When I try to filter based on its months like: q1 = Event.objects.filter(start_date__month__in=[1, 2, 3]) I get an "unable to resolve field 'start_date__month'" error. Is this usage not supported or is this a bug? Any i

Re: per-site cache for subdomains

2008-01-05 Thread omat
Sorry, it was a stupid mistake, nothing to do with the above middleware and the cache system. My middleware above works fine for caching pages that differ by their subdomains. On Jan 5, 8:58 am, omat <[EMAIL PROTECTED]> wrote: > Hi, > > Django's per-site cache does not t

per-site cache for subdomains

2008-01-05 Thread omat
Hi, Django's per-site cache does not take sub domains into account. I derived my own middleware to handle subdomains by modifying the key_prefix: from django.middleware.cache import CacheMiddleware class SubdomainCacheMiddleware(CacheMiddleware): def process_request(self, request):

Re: sitemaps for subdomains

2008-01-02 Thread omat
Jan 2, 11:15 pm, omat <[EMAIL PROTECTED]> wrote: > The sitemaps.org says: > > > For instance, if the Sitemap is located > > athttp://www.example.com/sitemap.xml, it can't include URLs > > fromhttp://subdomain.example.com. > > But if I place it under &qu

Re: sitemaps for subdomains

2008-01-02 Thread omat
The sitemaps.org says: > For instance, if the Sitemap is located at > http://www.example.com/sitemap.xml, it can't include URLs from > http://subdomain.example.com. But if I place it under "example.com" (without the "www") it should be ok for the subdomains. On Jan 2, 5:55 pm, Peter Rowell

Re: sitemaps for subdomains

2008-01-02 Thread omat
Well, I figured out that overriding the "get_urls" method of the Sitemap class solves the problem. But, remember to call the private __get() method like _Sitemap__get() in your class. Though, a cleaner solution is appreciated... On Jan 2, 3:38 pm, omat <[EMAIL PROTECTED]>

sitemaps for subdomains

2008-01-02 Thread omat
ed to the URL. Same with get_absolute_url, too. How can I add URLs with sub-domains to my sitemap files? Thanks, oMat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: dynamic fields

2007-12-03 Thread omat
back to Review. > But I'm not sure exactly what problem you're trying to solve yet, so I > can't say for sure if that'll help you. > > -Gul > > On Dec 3, 2007 10:16 AM, omat <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > I have

dynamic fields

2007-12-03 Thread omat
simpler than what those examples cover, I had no luck managing this. I tried looping through the _meta.fields of the Record model but I couldn't manage to add them to the "base_fields" of the Review class. Thanks for any help, oMat --~--~-~--~~~-

  1   2   3   >