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 dat

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 this

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 G

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
In list_events view you have to pass your polls list into context to. ... from mysite.polls.models import Poll ... def list_events(request): latest_event_list = Event.objects.all() latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] return render_to_response('events/ind

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 un

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 s

Re: newforms and DateField

2007-09-03 Thread Alex Koshelev
There is no way to use admin's calendar into regular pages with newforms. You have to implement it by yourself. On 3 сент, 11:07, picky <[EMAIL PROTECTED]> wrote: > That's what I was thinking. I try it but I don't fuind how to display > calendar button. > I don't see anything in http code of an a

Re: Sharing models between applications

2007-09-02 Thread Alex Koshelev
Just put the full import path to your app in INSTALLED_APPS. It's no mater where this application lies. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: truncating posts with markdown

2007-09-02 Thread Alex Koshelev
Markdown wraps all text in tag so truncate_html doesn't work --~--~-~--~~~---~--~~ 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 f

Re: problem with importing "Template" module

2007-09-01 Thread Alex Koshelev
In shell: export PYTHON_PATH=/path/to/dir/where/settings.py/script/lies/: $PYTHON_PATH export DJANGO_SETTINGS_MODULE=settings --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: send_mail() doesn't handle extra headers?

2007-08-31 Thread Alex Koshelev
Yes, you may use EmailMessage class that is more flexible then send_mail function http://www.djangoproject.com/documentation/email/#the-emailmessage-and-smtpconnection-classes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: DRY violation: site name in project files

2007-08-31 Thread Alex Koshelev
This is not site name, it is project name. This is a big difference. You can skip project name and write only app_name.module_name but this is not save and can cause name conflict. No, it doesn't make any difficult to move into another production environment. You can make application sets with som

Re: template context issue with "with"

2007-08-31 Thread Alex Koshelev
{%with%} tag creates only alias to variable. You cannot use it as parameter and "regular" context variable too. So you have to redesign you code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: problem with importing "Template" module

2007-08-31 Thread Alex Koshelev
You can do in django interactive shell. http://www.djangoproject.com/documentation/django-admin/#shell Or set DJANGO_SETTINGS_MODULE environment variabale ot your project settings.py http://www.djangoproject.com/documentation/templates_python/#configuring-the-template-system-in-standalone-mode R

Re: Collapse edit inline?

2007-08-30 Thread Alex Koshelev
No, you can not collapse edit inline block in admin. --~--~-~--~~~---~--~~ 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

Re: admin site and parent/child relationship

2007-08-30 Thread Alex Koshelev
There is no way to do so in django admin now. --~--~-~--~~~---~--~~ 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,

Re: Newbie with generic views

2007-08-30 Thread Alex Koshelev
What is field.choices ? object_list doesn't pass _field_ variable to context. http://www.djangoproject.com/documentation/generic_views/#django-views-generic-list-detail-object-list see Template context section --~--~-~--~~~---~--~~ You received this message becaus

Re: django.core.management changes

2007-08-30 Thread Alex Koshelev
try this: from django.core.management import call_command call_command( "reset", models.get_app('myapp'), interactive = False ) call_command( "load_data", [FIXTURE_PATH], verbosity = 0 ) --~--~-~--~~~---~--~~ You received this message because you are subscribed t

<    1   2   3   4