Re: Interesting result when displaying errors for contrib.auth.forms AuthenticationForm

2008-11-09 Thread Alex Koshelev
rrors }} > >{% endif %} > > type="submit" value="Login" /> > > >

Re: django.db.models.Q

2008-11-09 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/settings/#designating-the-settings On Mon, Nov 10, 2008 at 07:13, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > >>> from django.db.models import Q > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packa

Change date format in admin

2008-11-11 Thread Alex Rades
Hi, Is there a way to do it? Here in europe we really use DD-MM- Thank you --~--~-~--~~~---~--~~ 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

Re: question(s) about django-registration, default user profiles and django-profiles

2008-11-11 Thread Alex S.
Thanks! regards Alex On 11 Nov., 16:16, Steve Holden <[EMAIL PROTECTED]> wrote: > Alex S. wrote: > > hi there, > > > i want to use django-profiles to save some additional data for each > > user. so i created the needed profile model and set it in my settings >

Re: compare old and new model field value

2008-11-11 Thread Alex Koshelev
Why not simple fetch `old version` of object from database and compare its fields. For example: def save(self, *args, **kwargs): if self._get_pk_val(): old = self.__class__.objects.get(pk=self._get_pk_val() for field in self.__class__._meta.fields: old_value = field._ge

Re: user.username not resoving in templates.

2008-11-11 Thread Alex Koshelev
Do you use RequestContext [1] in your views? [1]: http://docs.djangoproject.com/en/dev/ref/templates/api/#id1 On Tue, Nov 11, 2008 at 23:43, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Hello, > > I am having issues acquiring the user context from templates other > than the template I spec

question(s) about django-registration, default user profiles and django-profiles

2008-11-11 Thread Alex S.
s in the custom profile if they are already existing in another table (even if i would be able to get that working then). apart from that i think it would deepen my understanding on the way django works. greetings, alex --~--~-~--~~~---~--~~ You received this message becau

Re: user-registration

2008-11-12 Thread Alex S.
cumentation for the django-registration application written by James Bennett at it's website http://www.bitbucket.org/ubernostrum/django-registration/wiki/Home. Alex S. On 12 Nov., 11:33, Maximus007 <[EMAIL PROTECTED]> wrote: > Hi guys, > I am not able to change  any of

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-12 Thread Alex Koshelev
Hi, Alex! Look at the small merging framework [1]. It allows to track changes of objects and merge them when they change. Here is [2] a usage example formed as unit test:-) [1]: http://svn.turbion.org/turbion/trunk/turbion/utils/merging.py [2]: http://svn.turbion.org/turbion/trunk/turbion/utils

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-12 Thread Alex S.
y his code and add the feature of working with two forms that should be handled by the same POST? What do you mean by "connecting them in SETTINGS". Sorry it seems like I don't it. @ Alex: I will look into that framework! Sounds really useful! But I don't think it's a good

General question: Django-Profiles, auth.User and "merging" both data

2008-11-12 Thread Alex S.
or the User profile and one for the custom additional profile and after that one template that display both forms). That point made it's way into my dreams last night so I really have to solve it to feel better :-). If there is any needed information missing to answer that please just ask.

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-12 Thread Alex S.
t? You suggested creating one form class for both models. I like that idea. But especially the saving is just above my django-skills at the moment. Best regards, Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &q

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-12 Thread Alex S.
ormProfile':formProfile}, context_instance=RequestContext(request)) [SNIP] Best regards and once again: Thanks in advance - maybe you are going to make my day :-). Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Query for all objects in table1 that DO NOT have corresponding objects in table2

2008-11-13 Thread Alex Koshelev
Hi, Ropley! Try this: jobs.objects.exclude(viewed_jobs=True) On Thu, Nov 13, 2008 at 14:47, Ropley <[EMAIL PROTECTED]> wrote: > > Noob question, but I've been running around in circles. I'm building > an in-house jobs board, and have 2 models: > > class jobs(models.Model): > ... > > class view

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-13 Thread Alex S.
form.save(user=request.user) return HttpResponseRedirect(success_url) else: form = form_class() return render_to_response("profiles/edit_profile.html", {'form':form}, context_instance=RequestContext(request)) I hope that code is

Re: Views triggering twice

2008-11-13 Thread Alex Koshelev
How have you noticed that view was triggered twice? On Fri, Nov 14, 2008 at 00:17, Jeff Gentry <[EMAIL PROTECTED]>wrote: > > > Actually I lied a little bit - a completely blank file doesn't trigger > this (I can also seem to put in a and tag), but adding > anything else will cause the view to

Re: Problem with named URL and parameters

2008-11-13 Thread Alex Koshelev
Hmm... Why in template tag you wrote `conversions` as view name but in error traceback there is `my_site.conversions`? On Thu, Nov 13, 2008 at 06:27, Brandon Taylor <[EMAIL PROTECTED]>wrote: > > Hi everyone, > > So I have a question/problem with a named URL pattern... > > #urls.py > url(r'^resou

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-13 Thread Alex S.
should help. Thanks for all your help (especially to you, urukay)! Best regards, Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

"available user permissions" list incomplete

2008-11-14 Thread Alex Chun
I need to give permission to an admin user to add/edit a class, but that class does not appear on the "available user permissions" list. The class is listed automatically for superusers, so it appears to be registered correctly with the admin. But I can't make that class available to regular adm

Re: Serialization of custom model fields

2008-11-15 Thread Alex Koshelev
There is ticket and patch for this issue http://code.djangoproject.com/ticket/9522 On Sat, Nov 15, 2008 at 16:38, AndyH <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a custom model field class that stores event recurrence > information. In python this is an instance of dateutil.rrule.rule, and >

Re: ManyToMany and save method

2008-11-17 Thread Alex Koshelev
Related objects save after `host`. So insertion into M2M table happens after save method of host object has executed. In your example - after `Ticket.save` On Mon, Nov 17, 2008 at 14:49, Marco Minutoli <[EMAIL PROTECTED]>wrote: > > I have this model: > > class Ticket(models.Model): >## Forei

Passing values to template

2008-11-17 Thread Alex Jonsson
Hey guys, I have a news application that I would like some help with. My view generates a list with objects mixed with dictionaries with two objects. Then in my template, I want to loop through this list and output each value. However, when it encounters a dictionary in the list I want it to loo

Re: Passing values to template

2008-11-17 Thread Alex Jonsson
Thanks to both of you! David's suggestion fits my application perfectly. Again, big thanks. --~--~-~--~~~---~--~~ 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

Re: Multiple Admin Site and Restricting models available in one AdminSite

2008-11-18 Thread Alex Koshelev
> I understand that we can now have several admin site for the same app. (by proper configuration in the url_conf). Yes with using of several AdminSite instances. So you can register models to needed site instance. That helps you to separate access to models from different admin backends. On Tue,

Re: Template custom filter doesn't work

2008-11-19 Thread Alex Koshelev
You have to convert value from string to integer: int(arg) On Wed, Nov 19, 2008 at 13:18, K*K <[EMAIL PROTECTED]> wrote: > > I modified some code so I made mistake again. -_-# > > The right result looks like this: > > $ ./manage.py shell > Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) > [GCC

Re: Problems with file upload and model forms

2008-11-20 Thread Alex Koshelev
Do you use `enctype` attribute[1] of form tag? [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Thu, Nov 20, 2008 at 16:59, Marc Barranco <[EMAIL PROTECTED]> wrote: > > Hi! > I'm trying to upload a file like the example in documentation in > Django (h

Re: Request object from models

2008-11-21 Thread Alex Koshelev
No. Request object does not exist when model classes are created. On Fri, Nov 21, 2008 at 13:47, FT <[EMAIL PROTECTED]> wrote: > > class Document(models.Model): > >created = models.DateTimeField( >help_text='Timestamp when the document is created', > blank=True, >default=date

Re: NoReverseMatch question

2008-11-21 Thread Alex Koshelev
You have an underscore in slug - "second_post" but your regex doesn't allow it - "[-\w]+". I think it is the problem. And why you did you choose "\w" for day? On Fri, Nov 21, 2008 at 17:16, goblue0311 <[EMAIL PROTECTED]> wrote: > > Hi all: > > I'm receiving this error: > > #*

Re: unicode cipher & generic views

2008-11-22 Thread Alex Koshelev
Hi, Oleg! Show your code to us. Problem is where. On 11/22/08, oleg <[EMAIL PROTECTED]> wrote: > > Hi there! I'm brand new user of django.. So, please, don`t be ugly, > if I`m missing something elementary ^_^ > > I use django.views.generic.create_update to generate an editing/ > inserting form f

Re: django query API help

2008-11-24 Thread Alex Koshelev
Values gets onli fields names [1]. Try this: results = Article.objects.filter(qset).values('published_at') [1]: http://docs.djangoproject.com/en/dev/ref/models/querysets/#values-fields On Mon, Nov 24, 2008 at 13:16, kele <[EMAIL PROTECTED]> wrote: > > hi all, > > i have some codes like these:

Executing raw Python

2008-11-24 Thread Alex Jonsson
image first to my own server, and then at the save() method run the update_s3.py script. It can be found here: http://www.holovaty.com/code/update_s3.py If I want to run this command and copy the entire directory over to S3, how would be the easiest way to do that? Thanks,

I18N not working

2008-11-24 Thread Alex Jonsson
Hey guys, I have some problems with the translations of my website. Locally, it works flawlessly. But as soon as I run the project on my server, it won't translate. I've translated the project per app, and I'm wondering if it could have something to do with my PYTHONPATH? As of now, my .htaccess

Re: I18N not working

2008-11-25 Thread Alex Jonsson
Thank you everyone for your feedback. I forgot to mention that I read that paragraph in the docs as well and already installed the LocaleMiddleware. This makes the translation of the built-in modules work, but not my per-app translations. This was why I was thinking that maybe it had something to

Re: I18N not working

2008-11-25 Thread Alex Jonsson
Oh, and another note. I have checked my browser language, it's set to Swedish. That works locally as well with LocaleMiddleware. On Nov 25, 12:01 pm, Alex Jonsson <[EMAIL PROTECTED]> wrote: > Thank you everyone for your feedback. > > I forgot to mention that I read that para

Re: I18N not working

2008-11-25 Thread Alex Jonsson
) and then made and compiled a project-wide translation. Still not working! Could it have something to do with gettext or such? I use the ugettext_lazy and my server runs Python 2.3. On Nov 25, 12:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-11-25 at 03:01 -0800, Ale

Re: I18N not working

2008-11-25 Thread Alex Jonsson
o finally found them. Oh, and I can concur that the LocaleMiddleware is not needed to translate per-app. Thank you everyone for your help! On Nov 25, 12:37 pm, Alex Jonsson <[EMAIL PROTECTED]> wrote: > I did just check the permissions, and even tried change them to a=rwx. > Still not w

Re: Reusable forms!

2008-11-25 Thread Alex Koshelev
You have to pass form instance to all pages context where it is used. You can do it explicitly or write custom context processor or (the better solution) write custom inclusion tag. On Tue, Nov 25, 2008 at 20:13, Alfonso <[EMAIL PROTECTED]> wrote: > > Hey, > > I've put together a simple search fo

Re: Running Django on a shared-hosting provider with Apache in fcgi mode

2008-11-25 Thread Alex Koshelev
You have to start FastCGI demon that will handle request. For example by using `./manage.py runfcgi` command On Tue, Nov 25, 2008 at 20:47, Oleg Oltar <[EMAIL PROTECTED]> wrote: > Hi! > > I have a shared hosting. Need to place there my django application. I > created ./.htaccess in my root direct

Compare Lists for Unique Items

2008-11-25 Thread Alex Jillard
de works fine now, but I can see it getting slow. for b in output_list: found = False for i in current_projects: if i.name == b: found = True if not found: new_projects.append(b) Thanks for the help, Alex --~--~-~--~~---

Re: Compare Lists for Unique Items

2008-11-25 Thread Alex Jillard
tring that I'm splitting, so I can't do it as I build that list. Thanks again On Tue, Nov 25, 2008 at 4:38 PM, Rajesh Dhawan <[EMAIL PROTECTED]>wrote: > > Hi Alex, > > > Here is the code that I use. Output_list is from CVS and > current_projects > > is fr

Re: App Name in Admin

2008-11-26 Thread Alex Koshelev
Application not model. verbose_name works for model itself Just now there is no way to set custom application name. On Wed, Nov 26, 2008 at 10:40, Daniel Roseman <[EMAIL PROTECTED] > wrote: > > On Nov 26, 6:57 am, "Steve Phillips" <[EMAIL PROTECTED]> wrote: > > Hi All > > > > I have been search

Re: Overriding contrib.auth User save()

2008-11-26 Thread Alex Koshelev
Of course you can monkey-patch the User model but the better way is to use signals pre_ or post_save On Wed, Nov 26, 2008 at 13:54, Paddy Joy <[EMAIL PROTECTED]> wrote: > > I would like to override the save() method on the contrib.auth User > model so that I can run a routine when a user is creat

Re: Reusable forms!

2008-11-26 Thread Alex Koshelev
Oh.. and what is the error you get? On Wed, Nov 26, 2008 at 13:39, Alfonso <[EMAIL PROTECTED]> wrote: > > Thanks Alex, > > I'm attempting to go the inclusion tag route but having difficulty > understanding how to get the form in place correctly. > > I've

Re: Compare Lists for Unique Items

2008-11-26 Thread Alex Jillard
e key on the project's name field, then > you're good to go--no duplicates will ever get inserted. No need to > do any filtering ahead of time--just put each save() in a try/except > block that catches the error you get and does nothing. > > -Jeff > > On Nov 25, 4:53 pm

Re: Using {% url %} with generic views

2008-11-26 Thread Alex Koshelev
Url patterns can have names [1] [1]: http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 On Wed, Nov 26, 2008 at 14:48, dash86no <[EMAIL PROTECTED]> wrote: > > Yesterday I replaced hard coded links on my site with a dotted > notation path to the relevant view using the {% url %} tag. > >

Re: significance of date published

2008-11-26 Thread Alex Koshelev
It is just verbose_name - something like human description or label for field. On Wed, Nov 26, 2008 at 20:40, mahesh_aka_amol <[EMAIL PROTECTED]> wrote: > > Hi > > I have came across a constructor like this > models.DateTimeField('date published') > > What is significance of 'date published' can

Re: Passing in dynamic id's to a template tag?

2008-11-28 Thread Alex Koshelev
Standard `simple_tag` shortcut resolves variables well. On Fri, Nov 28, 2008 at 19:29, truebosko <[EMAIL PROTECTED]> wrote: > > Mulling over the docs I can't find an answer to this, say I want to do > something like so: > > {% get_shipping 'ontario' product.id %} > > Parsing ontario is simple en

Re: rendering DB text in template

2008-11-28 Thread Alex Koshelev
Look at this: http://docs.djangoproject.com/en/dev/topics/templates/#id2 On Fri, Nov 28, 2008 at 21:43, Django Newbie <[EMAIL PROTECTED]> wrote: > > So I have some text fields in the db that have some embedded html in the > text. How do I get the template to render the text as html? > > The tex

Paragraph modifying

2008-11-29 Thread Alex Jonsson
he post is passed in HTML format, so the most logical thing would be to split the paragraphs by perhaps, and then ... yeah then what :)? Thanks, Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

Modify uploaded image

2008-11-30 Thread Alex Jonsson
x27;s name instead of having randomly named files in my folders. Thanks, Alex --~--~-~--~~~---~--~~ 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

Re: Overwriting Django Authentication / Session Logic

2008-12-01 Thread Alex Koshelev
Have you read this - http://docs.djangoproject.com/en/dev/topics/auth/#other-authentication-sources? On Mon, Dec 1, 2008 at 19:02, Devye <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to integrate a Django app with an in-house developed > webapp. The biggest hurdle is to consolidate the two

Re: how to create json from template?

2008-12-02 Thread Alex Koshelev
To trim last colon wrap it with if statement: {% if forloop.revcounter0 %},{% endif %} On Wed, Dec 3, 2008 at 04:26, Viktor Nagy <[EMAIL PROTECTED]> wrote: > Hi, > > I know about the serialisation framework, but with MultiResponse[1] you > can't really use it (and anyway I don't know how to cust

Re: how to create json from template?

2008-12-02 Thread Alex Koshelev
Oh, Yes. Good point. On Wed, Dec 3, 2008 at 09:49, David Zhou <[EMAIL PROTECTED]> wrote: > > On Wed, Dec 3, 2008 at 1:17 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > > To trim last colon wrap it with if statement: > > > > {% if forloop.revc

django-tagging encoding errors

2008-12-03 Thread Alex Jonsson
ive server: >>> s = u'ä' >>> s u'\xc3\xa4' I don't know if that helps anyone, but I sure hope so. Thanks in advance, Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: django-tagging encoding errors

2008-12-03 Thread Alex Jonsson
Karen, I thank you a million times over. You have no idea how many hours I've spent on this issue. :) I got it working by using exactly the method you specified. Finally I'll be able to get some sleep at night! Take care, Alex On Dec 3, 8:18 pm, "Karen Tracey" <[EMAIL

Re: django-tagging encoding errors

2008-12-04 Thread Alex Jonsson
in the next weeks as well, so soon enough we'll be on 2.6 (sweet relief). I don't really see the point in supporting 2.3 with Django much longer, it seems as ancient as supporting IE5.5. Alex On Dec 4, 12:55 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Glad to help

Re: fields in object.values()

2008-12-07 Thread Alex Koshelev
Manager's `values` method excepts list of field names but you give the string. Try this: tbData = tableName.objects.values(*strFld.split(",")) On Sun, Dec 7, 2008 at 23:48, sotiris.kazakis <[EMAIL PROTECTED]>wrote: > > hello, > > I search a lot about the use of object.values() but don't get what

Re: time it takes django to read database?

2008-12-07 Thread Alex Koshelev
Do you use caching? On Mon, Dec 8, 2008 at 07:34, garagefan <[EMAIL PROTECTED]> wrote: > > ok... i've been able to figure out how long it takes based on the time > stamp... an hour and a half for a new object to have come in. It > appears that the item is not readable by the two templates, one of

unique_together question

2008-12-09 Thread Alex Jonsson
oMany column. How would be the easiest way to do this? Thanks, Alex --~--~-~--~~~---~--~~ 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 u

Re: how to do redirects with django?

2008-12-09 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses http://docs.djangoproject.com/en/dev/ref/contrib/redirects/#ref-contrib-redirects On Tue, Dec 9, 2008 at 16:25, nbv4 <[EMAIL PROTECTED]> wrote: > > If the user goes to /foobar, I want it to redirect him to /foobar-

Re: referencing the current instance inside limit_choices_to

2008-12-09 Thread Alex Koshelev
There is no way to have per-instance limit_choices_to. On Wed, Dec 10, 2008 at 03:56, GuyBowden <[EMAIL PROTECTED]> wrote: > > Hi, > > I've looked about but can't find the answer to this. > > I'd like to set the limit_choices_to value of a ForeignKey field based > on another selection in the cur

Re: models.FileField() vs. forms.FileField()

2008-12-11 Thread Alex Koshelev
models.FileField realy requires `upload_to` param. And it can be callable with `instance` argument [1]. Using this feature you can generate upload path by the instance fields. [1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield On Thu, Dec 11, 2008 at 13:47, Alan <[EMAIL PROTEC

Re: template string formatting

2008-12-13 Thread Alex Koshelev
{{var|slice:"0"}} On 12/13/08, Vicky wrote: > > Is there any way to take out the first letter of a string in django > template system? > ex: > > x("Hai") should give o/p as: "H" > > > -- --- Александр Кошелев daeva...@gmail.com --~--~-~--~~~---~--~~ You re

Re: Optional GenricForeigKey: "null=True, blank=True" => unexpected keyword argument

2008-12-13 Thread Alex Koshelev
GenericForeignKey is pseudo-field. It doesn't have any own underlying db field representation, so there is no need to specify it as blank and nullable. On Sat, Dec 13, 2008 at 22:45, mwebs wrote: > > Hello, > > I have a model that I want to have an optional generic relation to any > other kind

Re: remove object from queryset

2008-12-14 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/ref/models/querysets/#exclude-kwargs On Sun, Dec 14, 2008 at 16:03, Alfredo Alessandrini wrote: > > Hi, > > can I remove an objects from the queryset: > > In [138]: from CHALLENGE.models import start_game > > In [139]: start_game.objects.all() > Out[139]: [, ,

Re: Reusing a python model

2008-12-14 Thread Alex Koshelev
You don't need to define it else where.Just write a django model once and use it any where in you project. On Sun, Dec 14, 2008 at 18:40, JULIO Cayo wrote: > > Hi, I want to start with django framework. I've never used it. ( I'm > sorry, I'm learning english) > > My question is: I have an appli

Re: db API where ...or...

2008-12-15 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects On Mon, Dec 15, 2008 at 18:35, Lars Stavholm wrote: > > Hi all, > > when combining Django ORM criteria you get > the "...WHERE...AND..." clauses. > > How do I get the "...WHERE...OR..." clauses? > > Resorting

Re: invalid syntax - install django 1.0.2

2008-12-17 Thread Alex Koshelev
What is your version of python? On Wed, Dec 17, 2008 at 21:26, Richard wrote: > > Hi, > > when im running the "setup.py install" command in my shell under > Windows Vista > it returns an syntax error in Line 70 > > if u'SVN' > ^ > > anybody knows what im doing wrong? > > > > --~--~---

Re: invalid syntax - install django 1.0.2

2008-12-17 Thread Alex Koshelev
tro/install/#intro-install On Wed, Dec 17, 2008 at 22:02, Richard wrote: > > Im running Python 3.0 > > and the line 70 is correct in my file: > > "if u'SVN' in version:" > > > On Dec 17, 3:35 pm, "Alex Koshelev" wrote: > > Wha

Request dictionary in view

2008-12-21 Thread Alex Jonsson
Hey guys, I want to check the user's user agent string in a template tag, but when I try to use the request variable in the template I get a Caught an exception while rendering: Failed lookup for key [request] error message. I'm using the generic list_detail templates, is there anything special

Re: Request dictionary in view

2008-12-21 Thread Alex Jonsson
Did it! Thanks a bunch. On Dec 21, 8:16 pm, Bradley Wright wrote: > Request isn't ending up in the context, try installing: > > http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-c... > > It's not enabled by default, and you need it to make request available > in templates. --~

Re: Get model name

2008-12-25 Thread Alex Koshelev
Foo._meta.object_name On Thu, Dec 25, 2008 at 2:44 PM, Kless wrote: > > How to know the name of the model? i.e. > > class Foo(models.Model): > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: list_display - display all fields

2008-12-25 Thread Alex Koshelev
list_display = [f.name for f in MyModel._meta.fields] On Thu, Dec 25, 2008 at 1:41 PM, Kless wrote: > > In the 'list_display' control, is possible display all fields without > having to list them? > > > > --~--~-~--~~~---~--~~ You received this message because y

Re: How to implement code that runs in the background?

2008-12-26 Thread Alex Koshelev
Use cron and custom manage.py commands On Fri, Dec 26, 2008 at 10:58 AM, Fluoborate wrote: > > I have a philosophical question. How should I implement code that runs > in the background, automatically, and continuously? What is a safe and > kosher way to do that? > > > --~--~-~--~~

Re: sql translation error in django?

2008-12-26 Thread Alex Koshelev
Paper.objects.filter(Journal__Name='Science').order_by("-PublishedDate") Read the documentation please. On Fri, Dec 26, 2008 at 8:43 PM, 夏恺 wrote: > > Hi all! > > I'm working on an app which has two classes: > > # This one records acedemic journal name and related infomation: > class Journals(

Re: cross table querying II

2008-12-26 Thread Alex Koshelev
tb1.objects.extra(select={"tb2_name": "app_tb2.name"},where=["app_tb1.name= app_tb2.name"], tables=["app_tb2"]).values("name", "tb2_name") On Sat, Dec 27, 2008 at 7:16 AM, Shuge Lee wrote: > > class tb1( models.Model ): >name = models.CharField(max_length=32) >tb2 = models.ForeignKey(Cat

Re: enumerate in templates

2008-12-27 Thread Alex Koshelev
{% for %} itself On 12/27/08, Vicky wrote: > > Is there a way to access the previous value of a for loop in > templates. Can anyone tell the template representation for the python > code like: > > for i,j in enumerate(item): > ... > > > -- --- А

Re: Field.default optional attribute is not working properly

2008-12-29 Thread Alex Koshelev
Default values stay only on python layer. For example you can specify any callable as default value so it cannot be "mapped" into DLL. On Mon, Dec 29, 2008 at 3:50 PM, Rama wrote: > i have a model class as below. *(please observe the red color lines)* > > class NewsEntry(models.Model): > *

Re: Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread Alex Koshelev
How have you created custom AdminSite? Have you registered auth and site models to it? On Mon, Dec 29, 2008 at 1:41 PM, raj wrote: > > In the usual admin index at http://host:port/admin/ page, there are > the auth and sites app visible on top of our custom app list. I'd to > customize the admin

Re: Sites and Auth apps not visible on using custom AdminSite

2008-12-29 Thread Alex Koshelev
e, not to the > class. So inheritance doesn't help you there. I think this must have > been declared in the documentation. > > Thanks Alex. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Django is generating requests that result in untyped binary data download in FF 3.0

2008-12-30 Thread alex kessinger
Hi, I am having a problem that seems like a ghost. I can find where it's comming from. It doesn't happen all the time. But what happens is sometimes when I go to a page. instead of loading the page, the browsers askes me if I would like to download a file called untyped binary data. I am hostin

Re: Django in runfcgi mode does not have log even is daemonize=false

2008-12-30 Thread Alex Koshelev
How do you put messages to log? On Tue, Dec 30, 2008 at 7:08 AM, CG wrote: > > Hi, all I am using Django 1.02 + lighttpd , and I run my django app in > fastCGI mode using the following > > runfcgi method=prefork socket=/tmp/socket.sock > pidfile=/var/run/process.pid outlog=/var/log/lighttpd/ou

Re: form validation does not work

2008-12-30 Thread Alex Koshelev
Please post here entire view code On Wed, Dec 31, 2008 at 8:18 AM, Chuck22 wrote: > > class ContactForm(forms.Form): > email = forms.EmailField(required=True, > widget=forms.TextInput(attrs= > {'size':'30'}), >error_messages={'req

Re: unbalanced parenthesis

2009-01-05 Thread Alex Koshelev
You've forgotten ")" after `(?P\d{4}` On Mon, Jan 5, 2009 at 7:30 PM, mangamonk wrote: > > I'm trying to complete the practical django applications tutorial.. > > error at /weblog/ > unbalanced parenthesis > Request Method: GET > Request URL:http://127.0.0.1:8000/weblog/ > Exception

Re: request.FILES always empty

2009-01-05 Thread Alex Koshelev
You don't set proper `enctype` to the form [1] [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Mon, Jan 5, 2009 at 11:34 PM, Glimps wrote: > > I'm using ModelForm to render my form. I have a FileField in my model > that shows up as a type="file" on

Re: strip_tags in django admin issues

2009-01-06 Thread Alex Koshelev
Form class really doesn't have `strip_tags` method. I think you are interested in `strip_tags` functon from `django.utils.html`(and your comment says the same). So your method may look like this: def clean_title(self): from django.utils.html import strip_tags

Re: Newbie: Help to understand string handling

2009-01-06 Thread Alex Koshelev
Yes. Django is just Python On Tue, Jan 6, 2009 at 11:14 PM, phoebebright wrote: > > As a newbie to both python and django (ex PHP) I am not clear on when > I can use python functions and when I can't. > > I want to do some simple string handling in a view, search and replace > for example, but

Re: subquery has too many columns

2009-01-07 Thread Alex Koshelev
And what is `groupadmins`? On Wed, Jan 7, 2009 at 8:36 PM, timc3 wrote: > > I updated my django version to revision 9710 today and now I am > getting the following error message on screen: > > Caught an exception while rendering: subquery has too many columns > > This is the traceback: > > Orig

Re: editing multiple records using admin list view

2009-01-11 Thread Alex Koshelev
There is an application: http://code.google.com/p/django-batchadmin/ On Sun, Jan 11, 2009 at 1:53 PM, sateeshk...@gmail.com wrote: > > Hi, > I want to edit multiple records of users ( say selecting the user > records which I want to edit ) and then say if I press > activate button, all the rec

Re: Django Development Process

2009-01-11 Thread Alex Kowalczyk
s. > Implement templates. > Factor out template tags. > Performance test, tuning SQL/caching. Thanks Jeremy much appreciated, I like the look of this approach. -Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Field representation in n-f-admin

2008-07-17 Thread Alex Rades
Hi, I have a field (a XMLField) which I'd like to format somehow before presenting it into the admin change_list page. How do i alter the string representation of a field in django? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed

Custom validation

2008-07-21 Thread Alex Rades
Hi, First of all, I'm using trunk :) I have a couple of models like: class User(model.Model): group = models.ForeignKey(Group) Class Group(model.Model): interest = models.ForeignKey(Interests) Basically i want to be possible to change in the admin the interest of a Group *only if*: s

Re: Custom validation

2008-07-21 Thread Alex Rades
rms documentation--that's all > been deprecated. Read this instead: > http://www.djangoproject.com/documentation/newforms/ > > Especially this part: > http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation > > -Jeff > > On Jul 21, 8:14

Re: Custom validation

2008-07-22 Thread Alex Rades
]> wrote: > > If that's what you want, then override the save() method of the model > that throws an exception if it doesn't meet your requirements. > > -Jeff > > On Jul 21, 9:43 am, "Alex Rades" <[EMAIL PROTECTED]> wrote: >> The point is that

Re: problem with permalink

2008-07-22 Thread Alex Koshelev
Hi. `permalink` - is a decorator [1], not an 'ordinary' function. So it can be used like this: @permalink def get_url(self): return ('experiment_view', (), {'exp_id': self.id}) [1]: http://www.djangoproject.com/documentation/model-api/#the-permalink-decorator On Jul 22, 1:30 pm, mwebs <[

Getting my widgets to stop escaping

2008-08-22 Thread Alex G
} and {% endautoescape %} blocks, but to no avail). Does anyone know how I might get this string 'safely' out of my widget and into my template? Thanks, Alex. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Widget rendering working as intended?

2008-08-25 Thread Alex G
u' %s="%s"' % (k, escape(v)) for k, v in attrs.items()]) # <-- right there, the escape(v) call... should this be conditional_escape? Since there are a lot of calls to mark_safe scattered through the widget and form-level calls used in rendering, I assume you're meant to b

Re: Widget rendering working as intended?

2008-08-25 Thread Alex G
#x27; the wisp") attrs['normal_string'] = "cat o' nine tails" super(MyWidget, self).__init__(*args, **kwargs) w = MyWidget() w.render("field_name", "") #=> u'' On Aug 25, 1:35 pm, Alex G <[EMAIL PROTECTED]> wrote: &g

How to subclass a model class?

2008-09-05 Thread Alex Chun
something like, redCars = TempCar.objects.filter(color='red') Django gives me a programming error 1146, table myproject.myapp.TempCar doesn't exist. Any help greatly appreciated. Thanks in advance! Alex --~--~-~--~~~---~--~~ You received this

Re: How to subclass a model class?

2008-09-05 Thread Alex Chun
age, along with some calculated information for each "car," which I have called the "comment" field. Thanks again. On Sep 5, 5:11 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 sep, 01:54, Alex Chun <[EMAIL PROTECTED]> wrote: > > > How can I su

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