Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev
in views.py for activating the > admin interface. > There is 1 instruction in urls.py (r'^admin/', > include('django.contrib.admin.urls')), and another in settings.py : > adding 'django.contrib.admin', in INSTALLED_APPS. > So, why this exception's message? > I don't understand

Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev
Error is in your code. Read the exception's message. On 14 янв, 16:06, Rocco Pellegrini <[EMAIL PROTECTED]> wrote: > Before admin worked well. Now with development version this is the > result: > ViewDoesNotExist at /admin/ > Tried home1 in module prog_innov.views. Error was: 'module' object has

Re: Getting checkbox values of a Form in view function

2008-01-13 Thread Alex Koshelev
Try `status__in` as filter param On 13 янв, 23:00, Nader <[EMAIL PROTECTED]> wrote: > Hallo, > > I have a Form in which I have define some checkbox input. > > > starting > waiting > accepted > failed > > completed > > > > > And I want to get the checkbox values in a list, therefor I use

Re: dynamic choices in a ChoiceField

2008-01-13 Thread Alex Koshelev
Thanks. My mistake On 13 янв, 21:39, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Alex Koshelev wrote: > > When you explicitly write list in choices it evaluates at module > > import type. To avoid this write function and pass it as 'choices' > > parameter > > &g

Re: Can not login on running behind Apache, but can when on development server

2008-01-13 Thread Alex Koshelev
What daes it mean "I am unable to login". Error aqcures, exception raises or something else? On 13 янв, 18:33, shabda <[EMAIL PROTECTED]> wrote: > I have a view function I am using for logging in people. When I am > deploying it to Apache/Mod_python, I am unable to login, but If I am > running

Re: Custom template tag

2008-01-13 Thread Alex Koshelev
'templatetags' instead of 'templatetag' '{% load feed_import %}' instead of '{% load feedimport %}' On 13 янв, 19:47, Alessandro <[EMAIL PROTECTED]> wrote: > I'm trying to create a custom template tag. I've added a feedimport > app in my project, added it on my installed apps, and inside it I've

Re: dynamic choices in a ChoiceField

2008-01-13 Thread Alex Koshelev
When you explicitly write list in choices it evaluates at module import type. To avoid this write function and pass it as 'choices' parameter def get_choices(): [(d.id,d.name) for d in Deck.objects.all()] #... deck = forms.ChoiceField(required=True,choices = get_choices ) When this function

Re: Curious bugs with middleware (but possible with other features).

2008-01-13 Thread Alex Koshelev
You wrote: P/ APP2/ middlewares.py -> MyMiddleware And then: 'P.APP2.middlewares.ProfileMiddleware', MyMiddleware != ProfileMiddleware Is it right? On 13 янв, 13:53, Grindizer <[EMAIL PROTECTED]> wrote: > Hello. > > I have one project let say P, > In this project i define several

Re: user.get_profile() attribute error

2008-01-12 Thread Alex Koshelev
file doesn't > exist if user.get_profile() is called. > > Ivan > > On Jan 12, 3:24 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > Do you create a profile model and set right value in settings.py > > file?http://www.djangoproject.com/documentation/authentication/#sto

Re: user.get_profile() attribute error

2008-01-12 Thread Alex Koshelev
Do you create a profile model and set right value in settings.py file? http://www.djangoproject.com/documentation/authentication/#storing-additional-information-about-users And User.get_pofile() does not require logged in user. Note that profile instance per user you must create manually. On 13

Re: Why the default Django transaction way doesn't work?

2008-01-12 Thread Alex Koshelev
Transaction behaviour depends on database backend. What backend do you use and have you setup transaction support for it? On 12 янв, 20:45, pength <[EMAIL PROTECTED]> wrote: > At first, I tried to search in this group, but only got an un-answered > question similar to >

Re: How to cache pages with GET parameters like /some_page?page=2

2008-01-11 Thread Alex Koshelev
You can write your own middleware that will be fit all your requirements On 11 янв, 16:45, sector119 <[EMAIL PROTECTED]> wrote: > Hi All! > > In Django docs I read that the cache middleware caches every page that > _doesn't_ have GET or POST parameters. > But I want to cache pages which has GET

Re: Need a replacement of pyLucene :(

2008-01-11 Thread Alex Koshelev
http://xapian.org/ On 11 янв, 18:46, mamcxyz <[EMAIL PROTECTED]> wrote: > Hi, > > Because the issue > herehttp://www.opensolaris.org/jive/post!reply.jspa?messageID=192094 > I need a working & viable alternative to pyLucene that: > > - Work on Solaris & Windows (A must) and maybe linux > - Open

Re: Many to Many

2008-01-08 Thread Alex Koshelev
orm? > > On Jan 8, 10:01 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > My mistake, colon needed after "join" > > > {{game.platforms.all|join:", "}} > > > On 9 янв, 00:49, Darthmahon <[EMAIL PROTECTED]> wrote: > > > > Hi Al

Re: using filter on the queryset of generic views.

2008-01-08 Thread Alex Koshelev
There is no way to do it in urls.py. But you may write wrapper view that will filter queryset and then pass it to generic view. On 9 янв, 01:19, "Shishir Ramam" <[EMAIL PROTECTED]> wrote: > I'd like to pass a parameter from a url to a query set of a generic view. > > Something like the

Re: Many to Many

2008-01-08 Thread Alex Koshelev
t; Thanks for your reply, I've got this semi-working now, only problem is > it has an error. With DEBUG=True on it gives this: > > join requires 1 arguments, 0 provided > > Does this mean no results (platforms) are being passed through? > > On Jan 8, 9:35 pm, Alex Koshel

Re: Many to Many

2008-01-08 Thread Alex Koshelev
What are you want to do? Do you read docs? The view's code is very strange. So many times appears word "list". May be you what get all games with platforms, so def games(request): games = Game.objects.all() return render_to_response('games/games.html', { 'games':games },

Re: read only in Admin interface

2008-01-08 Thread Alex Koshelev
Look at the databrowse application http://www.djangoproject.com/documentation/databrowse/ On 8 янв, 19:17, Nader <[EMAIL PROTECTED]> wrote: > Hello, > > I have looked while for a answer to my problem but unfortunately I > haven't found a one, maybe I had to spend more time. However I have a >

Re: models and python circular import

2008-01-08 Thread Alex Koshelev
Its very strange that so "hard linked" applications can produce clean and logic architecture:) 1. Try to split your A's models.py into 2 files. A1, A2 in first file. A3 in second file. In first models file import second with wildcard(*). In B models.py import only second A file. It's only

Re: how strange this register module

2008-01-08 Thread Alex Koshelev
sword in the admin > site, so maybe auth_password_change links to the default template > file, but why login.htm can be customered with the same url > stucture. > > On 1月8日, 下午9时22分, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > Show code of 'password_change' view &

Re: how strange this register module

2008-01-08 Thread Alex Koshelev
Show code of 'password_change' view On 8 янв, 16:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > sorry, this is just the type error. > > it is still in strange after i changed to the correct url. > > On 1月8日, 下午9时13分, Alex Koshelev <[EMAIL PROTECTED]> w

Re: how strange this register module

2008-01-08 Thread Alex Koshelev
Your url conf says: r'^password_change/$', but you tries to check: /password/change/ Very strange, really? On 8 янв, 15:53, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > i have this in one urls.py: > url(r'^login/$', auth_views.login,{'template_name': 'registration/ >

Re: Modifing User.__unicode__

2008-01-08 Thread Alex Koshelev
Simpliest way is to patch model class at applications loading time: #somewhere in your own models.py file of some app from django.contrib.auth.models import User def user_unicode(self): return '%s: %s %s' % (self.username, self.first_name, self.last_name) User.__unicode__ = user_unicode

Re: syncdb fail. mysql.base?

2008-01-07 Thread Alex Koshelev
AIL PROTECTED]> wrote: > I did a recent svn checkout. Perhaps I should uninstall and try a > stable release > > On Jan 7, 2:18 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > mysql.base is internal django module that wraps work with MySQL > > backend. So y

Re: syncdb fail. mysql.base?

2008-01-07 Thread Alex Koshelev
mysql.base is internal django module that wraps work with MySQL backend. So you have to check your django installation I think. And that version of django do you use? On 7 янв, 23:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I think I have MySQL and MySQLdb installed properly. Both of

Re: How to bind data to a form, and not make the validation fire

2008-01-07 Thread Alex Koshelev
It depends on concrete design decisions. Form wide initial data have higher priority then the field's initial data. But if I don't want init some field every time at form instance creation time I can pass callable object to field declaration. On 7 янв, 12:59, Collin Grady <[EMAIL PROTECTED]>

Re: Should logic appear in views.py

2008-01-07 Thread Alex Koshelev
When model method gets 'request' parameter its 99.99% ill-formed design of application. All request/response handling and most of business logic have to be in views.py or similar but not in models.py. On 7 янв, 12:38, Darthmahon <[EMAIL PROTECTED]> wrote: > Hey, > > I've just started working on

Re: Getting current user id

2008-01-07 Thread Alex Koshelev
obj.user_id = request.user.id # this is too really? On 7 янв, 12:55, Collin Grady <[EMAIL PROTECTED]> wrote: > On Jan 6, 1:36 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > > > When I used request.user, it outputs the username of the currently > > logged in user. When I try and use this as part of

Re: Is there a way to limit the number of element in the template

2008-01-06 Thread Alex Koshelev
I'm realy glad:) On 7 янв, 03:15, "Alexandre Forget" <[EMAIL PROTECTED]> wrote: > you are right ! it works now, thanks > > django fresh from svn > > On Jan 6, 2008 7:10 PM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > > > No

Re: Is there a way to limit the number of element in the template

2008-01-06 Thread Alex Koshelev
Note you must delete *all* spaces in filter expression part.forum.thread_set.all|slice:":5" And what is your django version? On 7 янв, 02:55, "Alexandre Forget" <[EMAIL PROTECTED]> wrote: > I tried with and without... no difference > > On Jan 6, 2008 6:32

Re: Is there a way to limit the number of element in the template

2008-01-06 Thread Alex Koshelev
Have you put a space between "all" and filter mark? On 7 янв, 02:27, "Alexandre Forget" <[EMAIL PROTECTED]> wrote: > update: it doesn't work in the for loop. > > -- > TemplateSyntaxError at /parts/8051/ > > 'for' statements should use the format 'for x in y': for t in >

Re: Is there a way to limit the number of element in the template

2008-01-06 Thread Alex Koshelev
First of all, Part.objects.all()[:5] is still lazy. SQL query executes only when you try to iterate through items. And you can slice objects in template with "slice" filter {% for p in part.object.all|slice:":5" %} On 7 янв, 01:13, "Alexandre Forget" <[EMAIL PROTECTED]> wrote: > Hi, > > I need

Re: Getting current user id

2008-01-06 Thread Alex Koshelev
User id - request.user.id On 6 янв, 23:43, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi Guys, > > Been looking to get the current id of the user logged in everywhere > but can't seem to find how to do this. > > Basically in my views.py file I want to insert an entry into a table. > Part of this

Re: Trying to display a list

2008-01-06 Thread Alex Koshelev
{% if "book_list" %} - what is "book_list" ? It is string literal, so it is always True. You must write this: {% if book %} And if you want to print books: {{book|join:", "}} On 6 янв, 23:38, chiefmoamba <[EMAIL PROTECTED]> wrote: > I'm sure this will be very easy for most of you... > > I am

Re: How to bind data to a form, and not make the validation fire

2008-01-06 Thread Alex Koshelev
"Initial" parameter can be a callable object. So you can create "lazy getter" for your initial data On 6 янв, 19:27, shabda <[EMAIL PROTECTED]> wrote: > But I need the initial data to be dynamic, so I can't just do > text = forms.CharField(widget = forms.Textarea, initial = 'sometext') > > I

Re: Getting specific related objects via URL variable

2008-01-04 Thread Alex Koshelev
Select needed image object from base and pass it explicitly to template context On 4 янв, 23:43, Emil <[EMAIL PROTECTED]> wrote: > Greetings, fellow Djangonauts. > > Some background to my question: > I'm building a site where I have Products that each can have one or > more Images (related via a

Re: Getting Access to form.data from a template

2008-01-04 Thread Alex Koshelev
From the template you cannot call function with parameters so yoo must explicitly pass list to the template context. On 4 янв, 18:35, Paul Childs <[EMAIL PROTECTED]> wrote: > I am trying to get all the values from 'tail_number' in the form data > that gets passed to a template... > > form.data

Re: Accessing request object in templates

2008-01-03 Thread Alex Koshelev
No. RequestContext instance used to handle context processors. It doesn't pass request instance to the context. Request instance passed to template context only by "django.core.context_processors.request" if its installed. On 3 янв, 20:40, "venkata subramanian" <[EMAIL PROTECTED]> wrote: > Hi, >

Re: how to use random of Built-in filter reference in templates?

2008-01-03 Thread Alex Koshelev
> ./manage.py shell >>> from django.template.defaultfilters import random >>> l = [ 1, 2, 3, 4 ] >>> random( l ) 2 >>> random( l ) 1 >>> random( l ) 4 >>> random( l ) 2 >>> random( l ) 2 >>> random( l ) 3 In template context behaviour is the same. On 3 янв, 19:09, "jt.wang" <[EMAIL PROTECTED]>

Re: Templates with multiple repeating blocks

2008-01-02 Thread Alex Koshelev
Use the user defined inclusion template tag or {% include %} standard tag http://www.djangoproject.com/documentation/templates_python/#inclusion-tags On 3 янв, 01:52, stryderjzw <[EMAIL PROTECTED]> wrote: > Hi, > > I have the same situation as a thread (http://groups.google.com/group/ >

Re: Printable article page URLs?

2008-01-02 Thread Alex Koshelev
The second variant with GET query is the best. One resouce has one uri but with query you specify it's display properties. On 3 янв, 01:52, Mordy Ovits <[EMAIL PROTECTED]> wrote: > I really like Django's policy of readable URLs and one authoritative > page. My question is how do I do printable

Re: Shopping cart

2008-01-02 Thread Alex Koshelev
http://www.satchmoproject.com/ On 2 янв, 18:37, [EMAIL PROTECTED] wrote: > Hi all, > Is there a good python shopping cart that works well with django? > Thanks, > > Jorge Hugo Murillo > > > > Be a better

Re: get_foo_display doesn't work with integers?

2007-12-29 Thread Alex Koshelev
Error is in the way you use it. Please write full model and usage example. On 29 дек, 23:54, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > apollo13 pointed this out on the IRC channel: > If your choices use an integers, get_foo_display returns the integer > and not the "human readable"

Re: 'WSGIRequest' object has no attribute 'user'

2007-12-29 Thread Alex Koshelev
Is there 'django.contrib.auth.middleware.AuthenticationMiddleware' in your MIDDLEWARE_CLASSES ? On 29 дек, 18:10, Chris Haynes <[EMAIL PROTECTED]> wrote: > Thanks a lot, syncdb now works with the admin stuff, and > I entered the superuser account stuff when requested. > > After that I restart

Re: How autopostback from a select.

2007-12-28 Thread Alex Koshelev
You can try to use 'attrs' parameter of the widget constructor. http://www.djangoproject.com/documentation/newforms/#customizing-widget-instances Something like this: attrs = { "onchange" : "this.form.submit()" } On 29 дек, 02:46, mamcxyz <[EMAIL PROTECTED]> wrote: > Hi, > > I wanna autopostback

Re: Automatically hashed passwords

2007-12-28 Thread Alex Koshelev
What version of django do you use? In trunk there is classic password/ confirm schema. On 29 дек, 01:39, mickey ristroph <[EMAIL PROTECTED]> wrote: > Does anyone have a good way to have the replace the alg$salt$hexdigest > input for the Add User admin page with a more traditional password/ >

Re: how to deal with inherited template context variables?

2007-12-28 Thread Alex Koshelev
I use inclusion template tags. It is very easy and following DRY principle. And tags may be cached independently. On 28 дек, 10:26, Sam Lai <[EMAIL PROTECTED]> wrote: > New django user here, so if this has been covered already, I'd > appreciate a pointer to the right thread. > > I've been

Re: Cannot assign requested address

2007-12-27 Thread Alex Koshelev
Error is in your SMTP parameters in settings.py or something similar. Look at the traceback: 49. return send_mass_mail([[subject, message, from_email, > recipient_list]], fail_silently, auth_user, auth_password) > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ >

Re: no such table: django_content_type

2007-12-26 Thread Alex Koshelev
Add "django.contrib.contenttypes" to INSTALLED_APPS an run syncdb On 26 дек, 23:15, Chris Haynes <[EMAIL PROTECTED]> wrote: > I add 'django.contrib.auth', to my INSTALLED_APPS. This seems > necessary to use the admin interface, for I get prompted for the > superuser login and password when I run

Re: Grouping of records

2007-12-26 Thread Alex Koshelev
If "continents" is contex variable wich is Continent.objects.all() so: {% for continent in continents %} {{continent.name}} {% for country in continent.country_set.all %} - {{country.country_name}} ({{country.city_set.count}}) {% endfor %} {% endfor %} But this

Re: django_site doesn't exist error

2007-12-25 Thread Alex Koshelev
Execute "./manage.py syncdb" to create django_site table. Hint: read error message to find solution. On 25 дек, 20:03, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > While I was following the chapter 12 (Session, Users and Registration) > of the Django book, I got "ProgrammingError at

Re: what for is queryset._clone() ?

2007-12-24 Thread Alex Koshelev
It's is "protected" method. You don't have to use it. It used by django for chaining in query set lazy behavior. On 24 дек, 19:22, sector119 <[EMAIL PROTECTED]> wrote: > Hi, All! > > When and why I have to use _clone() on queryset? I notice that it > using in django.views.generic.object_list,

Re: 'User' object has no attribute 'get'

2007-12-23 Thread Alex Koshelev
What is UserForm? On 24 дек, 00:46, l5x <[EMAIL PROTECTED]> wrote: > Traceback: > File "/home/user/django_src/django/template/debug.py" in render_node > 71. result = node.render(context) > File "/home/user/django_src/django/template/debug.py" in render > 87. output =

Re: how to access a tuple in a template

2007-12-20 Thread Alex Koshelev
{{tuple.0}} {{tuple.1}} On 21 дек, 01:30, Julian <[EMAIL PROTECTED]> wrote: > hi, > > i am passing a tuple (1,2) to a template in a variable like this: > > render_to_response("template.html",{"tuple":(1,2)}) > > how can i access the single-values without a for-loop in the template?

Re: Are paginators lazy?

2007-12-18 Thread Alex Koshelev
Paginator is lazy. It loads only needed page. It uses slice syntax( [:] ) of query set On 18 дек, 16:26, shabda <[EMAIL PROTECTED]> wrote: > I am using the paginators(django.core.paginator) as describes > athttp://www.djangoproject.com/documentation/models/pagination/. > Are paginators lazy,

Re: Templates, filesystem, caching?

2007-12-17 Thread Alex Koshelev
http://www.djangoproject.com/documentation/cache/ On 17 дек, 23:49, "Rob Hudson" <[EMAIL PROTECTED]> wrote: > Howdy, > > A thought occurred to me today and I'm not 100% sure what Django does > by default... > > Similar to the idea that PHP parses scripts for each request and > having an opcode

Re: Is there a setting which will provide RequestContext to each view autmatically?

2007-12-16 Thread Alex Koshelev
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext On 16 дек, 20:41, shabda <[EMAIL PROTECTED]> wrote: > Since I need my logged in user to be available to each template, I > need to go and add context_instance=RequestContext(request) to each > view.

Re: How to get SQL "NOT IN" query from filter()

2007-12-16 Thread Alex Koshelev
Your objects aren't ids, so you must get ids explicitly. On 16 дек, 16:34, Michal Ludvig <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: > >> How can I retrieve all objects that are *not* in that list? > > >> Something like "Model.objects.filter(id__not_in = processed_ids)". > >> Unlike

Re: get_absolute_url not working as expected

2007-12-14 Thread Alex Koshelev
1) May be string is needed 2) Absolute url not uri. So domain name is not needed. On 15 дек, 01:29, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > I have two question regarding get_absolute_url: > > 1) I have the template code: > > {% for entry in object_list %} > {{ entry.title }} > {%

Re: Automatically create a UserProfile object when a User is created

2007-12-14 Thread Alex Koshelev
=signals.pre_save, > sender=User) > > There's a closed ticket for adding a flag to let you know if the > object was created or not, but I don't think this is included in the > trunk yet. Does anyone know when it will > be?http://code.djangoproject.com/ticket/4879 > > Udi

Re: Wrong id returned from a record in mysql

2007-12-10 Thread Alex Koshelev
And where is problem? This is normal behaviour. On 10 дек, 17:24, DierRe <[EMAIL PROTECTED]> wrote: > Hello! I have a weird problem. > This is the model, really simple. > > class Tags(models.Model): > tag_id = models.AutoField(primary_key=True) > name =

Re: Automatically create a UserProfile object when a User is created

2007-12-08 Thread Alex Koshelev
Use django signals infrastructure. Handle post_save and post_delete signal and add or delete profile. Example of creation: from django.contrib.auth.models import User from django.db.models import signals from django.dispatch import dispatcher def create_profile_for_user(sender, instance,

Re: Use dispatcher or override model's save method?

2007-11-29 Thread Alex Koshelev
No, there is no difference in your case On 30 нояб, 02:28, Ryan K <[EMAIL PROTECTED]> wrote: > I have a model called a course that when created needs to insert > several classes (another model) into the schedule model. Is it best to > override the course's save method or use the dispatcher? Is

Re: Does a model have a fields attribute?

2007-11-22 Thread Alex Koshelev
._meta.fields - list of model's fields instances ._meta.get_field - returns field instance with given name On 22 нояб, 22:07, Ken <[EMAIL PROTECTED]> wrote: > Does a Model have a fields dict attribute like a Form? I did a dir() > on a model and don't see one. I see, instead, that the model

Re: Request in a template

2007-11-21 Thread Alex Koshelev
You can use this context processor http://www.djangoproject.com/documentation/templates_python/#django-core-context-processors-request or pass request instance manually to template context in each view;) On 22 нояб, 00:56, Martin <[EMAIL PROTECTED]> wrote: > I have an parameter in my querystring

Re: Accessing request.user inside a model methods

2007-11-16 Thread Alex Koshelev
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 16 нояб, 20:07, "Dan-Cristian Bogos" <[EMAIL PROTECTED]> wrote: > Hello, > > Can anyone tell me if it is possible to access logged user instance > inside a model method, like save() is? > > I need to rewrite save() method, so I

Re: linking to external resources

2007-10-11 Thread Alex Koshelev
> open in the browser and just shows me lots of (IMHO) garbage it just binary data of your chm file. how do you serve static data? through apache or other? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: How to allow a ForeignKey field to be null

2007-10-11 Thread Alex Koshelev
You must recreate your database tables for this application. See docs for "manage.py reset" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: The signal is not working... I don't know what's wrong

2007-10-11 Thread Alex Koshelev
1. Related objects are deleted automatically 2. post_delete signal sends when object already is deleted. so it has no primary key(id=None) On 11 окт, 17:33, "Young Gyu Park" <[EMAIL PROTECTED]> wrote: > > def delete_comment_by_entry(sender, instance, signal, *args, **kwargs): > > entry =

Re: Multilanguage - I know what I want, should I do it this way?

2007-10-11 Thread Alex Koshelev
Look at this: http://code.google.com/p/django-multilingual/ --~--~-~--~~~---~--~~ 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

Re: Django-multilingual

2007-10-07 Thread Alex Koshelev
I've use django-multilingual in many projects and happy. It's simple to integrate and use. No other implementations can do it so transparent for developer and end user( django-multilingual extends admin edit page and allows edit entry in all languages very simple). Use it! Chris Hoeppner: > Hi

Re: Objects.get() need to limit 1 record

2007-10-01 Thread Alex Koshelev
user = User.objects.filter(email='[EMAIL PROTECTED]')[ 0 ] On 1 окт, 10:30, cschand <[EMAIL PROTECTED]> wrote: > Hello all, > I have a problem with get objects from User > > when i give > user = User.objects.get(email='[EMAIL PROTECTED]') > > if only one data is there it is executing ok... but

Re: about auth

2007-09-27 Thread Alex Koshelev
You may write special admin interface or wait when low-level permission will be placed in django. On 27 сент, 16:54, "Lic. Jos M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > hi people, I got a little question, how can I make some users add news > (model News), modify only news owned by him

Re: guid's in python

2007-09-25 Thread Alex Koshelev
http://www.djangosnippets.org/snippets/335/ On 25 сент, 00:52, Leo Shklovskii <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to represent an Active Directory's user guid in Django. In > AD, its a 128 bit integer that I can pull out with using the ldap > library. When I access the guid, python

Re: Design a model for a Blog

2007-09-24 Thread Alex Koshelev
No, you must set unique=True argument manual for slug field On 24 сент, 23:39, Florian Lindner <[EMAIL PROTECTED]> wrote: > Am Sonntag, 23. September 2007 schrieb Alex Koshelev: > > > Slug is very good when you want to create "fine" urls. You can convert > > (

Re: How does Django know the PK of the newly created object

2007-09-23 Thread Alex Koshelev
> > > The code: > > obj = Product(name='Apple') > > > obj.id will not be set until you either explicitly set it, or call > > save(), at which time django will utilize the lack of a pk (among > > other things) to determine whether or not to do an insert or update. &

Re: Design a model for a Blog

2007-09-23 Thread Alex Koshelev
Slug is very good when you want to create "fine" urls. You can convert (using prepopulate_from param) your title field of entry to slug and use it for entry's permalink. But of course you can use entry's id(integer value) for url mapping On 23 сент, 17:12, Florian Lindner <[EMAIL PROTECTED]>

Re: admin gives error on add or select item from list

2007-09-23 Thread Alex Koshelev
Check that your __str__/__unicode__ model's methods return strings On 23 сент, 17:41, paulh <[EMAIL PROTECTED]> wrote: > I select a model in the initial admin page and am offered a choice of > the available instances/rows to change. If I either select one of > these, or press the add button I

Re: QUERY

2007-09-23 Thread Alex Koshelev
If you want use django templates standalone read this: http://www.djangoproject.com/documentation/templates_python/#configuring-the-template-system-in-standalone-mode P.S. Why "query"? On 23 сент, 17:26, mayank bhargava <[EMAIL PROTECTED]> wrote: > when i type : >>>from django.template import

Re: How does Django know the PK of the newly created object

2007-09-23 Thread Alex Koshelev
I think that when you create Product object django inserts new row into database and retrieves with SELECT new id. On 23 сент, 16:00, Siah <[EMAIL PROTECTED]> wrote: > Hi, > > When in a model you run something like this: > > >> obj = Product(name='Apple') > >> obj.id > > 4 > > I realize the

Re: model objects question

2007-09-23 Thread Alex Koshelev
class Country(models.Model): #... class Meta: ordering = ('name','tour',) On 23 сент, 03:47, Oleg Korsak <[EMAIL PROTECTED]> wrote: > Hello. I have such models: > > class Country(models.Model): > name = models.CharField(_('name'), maxlength=32) > >

Re: shemas evolution

2007-09-23 Thread Alex Koshelev
There is limited functionality for ALTER in sqlite On 23 сент, 09:19, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 9/22/07, Alexandre Forget <[EMAIL PROTECTED]> wrote: > > > I wonder what people are using *right now* to evolve their data ? > > ALTER TABLE. > > No, really ;) > > -- >

Re: form variables in templates

2007-09-22 Thread Alex Koshelev
Yes. If you had request context processor installed you can access to variables like so {{request.POST.foo}} On 22 сент, 18:47, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > can I access form variables (like request.POST["foo"]) in a template? Without > writing them in the argument

Re: Getting an object's meta value

2007-09-18 Thread Alex Koshelev
MyModel._meta.verbose_name On 18 сент, 20:31, Rob Slotboom <[EMAIL PROTECTED]> wrote: > For a class method I want to use the value of the > Model>Meta>verbose_name. > Can someone tell me how to get this value? > > Thanks, Rob --~--~-~--~~~---~--~~ You received

Re: two questions about data model

2007-09-15 Thread Alex Koshelev
Thereis no `length` argument in Field constructor. Don't use it. Your User already has imagefiel_set attribute, so you have to define another related name for imagefile manager. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: ifequal function not working?

2007-09-13 Thread Alex Koshelev
Hmm... What is `recordset`? QuerySet? QuerySet doesn't have id attribute. {% for recod in recodeset %} {% ifequal record.id selected_id %} Selected! {% endifequal %} {% endfor %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: how to access the host-name in settings.py

2007-09-13 Thread Alex Koshelev
Where is no way to find host name in settings module. To solve the problem you can split your settings.py file into host-specified- settings.py and settings.py Into settings.py: from host-specified-settings import * So you can have one settings.py but many host-specified files at different

Re: FileInput widget and FileField

2007-09-10 Thread Alex Koshelev
Read the docs: http://www.djangoproject.com/documentation/db-api/#get-foo-filename On 10 сент, 11:19, Ronald <[EMAIL PROTECTED]> wrote: > Hi there, > > I need a little bit of help here. > > I want to let user to import a csv file which will be parsed into the > database. > I am thinking of using

Re: data manipulation in templates or views?

2007-09-07 Thread Alex Koshelev
Templates just represents data to the client, all calculations must by in views or model methods --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: adding field to model

2007-09-06 Thread Alex Koshelev
http://code.djangoproject.com/wiki/SchemaEvolution On 6 сент, 14:51, ksuess <[EMAIL PROTECTED]> wrote: > hi. I had to add a field to an existing model. how do i update the db? > (of course there is content.) --~--~-~--~~~---~--~~ You received this message

Re: How to add a non database item to a python model

2007-09-05 Thread Alex Koshelev
Show all exception dump --~--~-~--~~~---~--~~ 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

Re: existing tables

2007-09-04 Thread Alex Koshelev
Look this: http://www.djangoproject.com/documentation/django-admin/#inspectdb Creates django models from the existing db structure On 4 сент, 11:25, [EMAIL PROTECTED] wrote: > hello > > I am very new to django. > > What can I do to reach existing tables ? > > in examples I met, new tables have

Re: How to add a non database item to a python model

2007-09-04 Thread Alex Koshelev
http://www.djangoproject.com/documentation/models/custom_methods/ On 4 сент, 07:21, shabda <[EMAIL PROTECTED]> wrote: > I have a python model > > class MyModel(models.Model): > fld1 = models.TextField() > fld1 = models.TextField() > > I want to have a non database item in this

Re: Calling User data from within templates

2007-09-03 Thread Alex Koshelev
Yes. You have to use RequestContext. If you don't use it django will not execute context processors and user variable never be passed into context On 4 сент, 00:41, Robert <[EMAIL PROTECTED]> wrote: > I'm not sure that requestContext was what i needed... I need simply to > be able to get user

Re: Calling User data from within templates

2007-09-03 Thread Alex Koshelev
Check your TEMPLATE_CONTEXT_PROCESSOR setting. auth TCP must be installed http://www.djangoproject.com/documentation/templates_python/#django-core-context-processors-auth On 3 сент, 22:33, Robert <[EMAIL PROTECTED]> wrote: > Hi all, I'm new to Django and python in general, so please overlook my

Re: how to select posts in this situation?

2007-09-03 Thread Alex Koshelev
Something like this: from django.db.models import Q import operator query_set = Post.objects.all() users = [ Q( user = user) for user in [ user1, user2, user3 ] ] query_set = query_set.filter( reduce(operator.or_, users ) ) --~--~-~--~~~---~--~~ You received

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Alex Koshelev
Yes you can try to play with custom template tags or with context processors http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to convert a Django model item to the underlying python object

2007-09-03 Thread Alex Koshelev
Each field class has to_python() method: class MyModel( models.Model ): date = models.DateField() # field = MyModel._meta.get_field( "date" ) date_obj = field.to_python( "2007-09-03" )#date_obj is python Date instance --~--~-~--~~~---~--~~ You received

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Alex Koshelev
Please show your views code or tell what you pass into template context. --~--~-~--~~~---~--~~ 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

Re: Signals Question - Firing off an email after a save

2007-09-03 Thread Alex Koshelev
save() is method, so it must get at least one parameter - self. def save( self ): ... > > TypeError at /admin/envwork/environment/12/ > save() takes no arguments (1 given) > > Any thoughts? > --~--~-~--~~~---~--~~ You received this message because you are

<    1   2   3   4   >