Re: Can't do any manipulation on a db object

2008-10-21 Thread Malcolm Tredinnick
On Tue, 2008-10-21 at 23:33 -0700, guruyaya wrote: > This is actually worse You mean top-posting? Yes, it's a terrible habit and you should stop doing it. > > blog/models.py > > from django.shortcuts import render_to_response as RenderToResponse > from myblog.blog.models impor

Re: Can't do any manipulation on a db object

2008-10-21 Thread guruyaya
Sorry if it appears twice. My message seem to have vanished. What I said was that this is even worse blog/views.py -- from django.shortcuts import render_to_response as RenderToResponse from myblog.blog.models import Post def listposts(request): a = Post.objects.all()

Re: Can't do any manipulation on a db object

2008-10-21 Thread guruyaya
This is actually worse blog/models.py from django.shortcuts import render_to_response as RenderToResponse from myblog.blog.models import Post def listposts(request): a = Post.objects.all() a = list(a) a[0].title = 'hihi' a[0].content = 'haha'

Re: Timing is everything

2008-10-21 Thread Daniel Roseman
On Oct 22, 5:26 am, Info Cascade <[EMAIL PROTECTED]> wrote: > Hey, > > I'm new to Django.  Be nice! > Is there some simple way to time the whole Django process, request to > response? > PHP has something like that. > I'd like to include that information in the response. > > Any ideas? > > Liam Yo

Re: Can't do any manipulation on a db object

2008-10-21 Thread Malcolm Tredinnick
On Tue, 2008-10-21 at 22:30 -0700, guruyaya wrote: [...] > blog/views.py > --- > from django.shortcuts import render_to_response as RenderToResponse > from myblog.blog.models import Post > def listposts(request): > a = Post.objects.all() > a[0].title = 'hihi' > a[0

Can't do any manipulation on a db object

2008-10-21 Thread guruyaya
I'm kinda new to django, and python, so I'm probably gonna make myself look a bit stupid. Here goes anyway: As a simple django (1.0) project, (using python 2.6) I've decided to write a blog application. Here it goes: blog/urls.py -- from django.conf.urls.defaults import * urlpatterns

Reverse error in contrib.comments

2008-10-21 Thread Brandon Taylor
Hi everyone, I'm using Django 1.0 and I'm attempting to add comments to a blog, following along in the "Practical Django Projects" book. The error is: Reverse for '' with arguments '()' and keyword arguments '{}' not found. when {% comment_form_target %} is present in the template. 'django.con

S3Storage, Models, and Files...is this obvious?

2008-10-21 Thread Info Cascade
Hi -- Again, I'm new to Django (and for that matter, Python). I am using the S3Storage module (and currently set default_storage to S3Storage). My model has a FileField which should store the file using S3 (because S3Storage is the default). I am creating an mp3 file using Popen, which is retur

Timing is everything

2008-10-21 Thread Info Cascade
Hey, I'm new to Django. Be nice! Is there some simple way to time the whole Django process, request to response? PHP has something like that. I'd like to include that information in the response. Any ideas? Liam --~--~-~--~~~---~--~~ You received this message b

Error in django.contrib.comments with {% comment_form_target %}

2008-10-21 Thread Brandon Taylor
Hi everyone, I'm using Django 1.0 and I'm attempting to add comments to a blog, following along in the "Practical Django Projects" book. The error is: Reverse for '' with arguments '()' and keyword arguments '{}' not found. when {% comment_form_target %} is present in the template. 'django.con

Re: admin.site.register errors (due to user mistake)

2008-10-21 Thread Malcolm Tredinnick
On Tue, 2008-10-21 at 19:51 -0700, [EMAIL PROTECTED] wrote: > If you make a boneheaded move such as creating a ModelAdmin class for > a model that you forgot to include in your admin.py's model import > statement, you get an error. But it's not the error you might expect. > What happens is you ge

admin.site.register errors (due to user mistake)

2008-10-21 Thread [EMAIL PROTECTED]
If you make a boneheaded move such as creating a ModelAdmin class for a model that you forgot to include in your admin.py's model import statement, you get an error. But it's not the error you might expect. What happens is you get the "model already registered exception", citing the first model re

Re: Import error exception "No module named urls" when running from eclipse

2008-10-21 Thread DragonSlayre
Thanks for your help, It turns out that it was a problem to do with the renaming functionality not working properly in eclipse. I tried renaming my package - and that doesn't work for some reason, and then my hack around caused a problem when I created a new package, which ultimately stuffed up

Re: callable upload_to problem

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 7:42 PM, Brot <[EMAIL PROTECTED]> wrote: > > Is there nobody who can help me with my problem? Is this a bug and > should I open a ticket or is it my fault? > > It's either a bug or behavior that needs more explicit documentation. The problem is that upload_to is called whe

Re: Import error exception "No module named urls" when running from eclipse

2008-10-21 Thread Jeff Anderson
DragonSlayre wrote: > Hi, I'm new to django/python, and I'm testing out eclipse for > development. > > I'm using pydev, and managed to run my app, but then when I go to the > web page, I get: > > ImportError at /time/ > No module named urls > You'll need to include the code for the view that is

Re: Django on Apache (mod_python) administration cookie problem

2008-10-21 Thread Graham Dumpleton
On Oct 22, 10:52 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Hi Daniel, > > I am also facing the same problem. I really can't understand the > technicalities of the solution offered in this thread. Since you seemed > to have solved the problem, can you please give a little more details on > how

Import error exception "No module named urls" when running from eclipse

2008-10-21 Thread DragonSlayre
Hi, I'm new to django/python, and I'm testing out eclipse for development. I'm using pydev, and managed to run my app, but then when I go to the web page, I get: ImportError at /time/ No module named urls Request Method: GET Request URL:http://localhost:8080/time/ Exception Type: ImportError

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread ro60
Also you may want to look at this one... Seems pretty good as well (haven't used it personally though). http://www.djangosnippets.org/snippets/884/ On Oct 21, 1:20 pm, ro60 <[EMAIL PROTECTED]> wrote: > I've been working on an acts_as_list implementation for Django > recently. I know gasp... I

Re: Django on Apache (mod_python) administration cookie problem

2008-10-21 Thread M.Ganesh
Hi Daniel, I am also facing the same problem. I really can't understand the technicalities of the solution offered in this thread. Since you seemed to have solved the problem, can you please give a little more details on how to do it Thanks in advance Regards Ganesh Daniel bodom_lx Grazioti

Re: callable upload_to problem

2008-10-21 Thread Brot
Is there nobody who can help me with my problem? Is this a bug and should I open a ticket or is it my fault? ~Bernd On 20 Okt., 22:05, Brot <[EMAIL PROTECTED]> wrote: > Hello, > > I am using the latest svn-revision 9236 and tried to use a callable in > the upload_to parameter of the ImageField.

Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Graham Dumpleton
On Oct 21, 10:51 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Ulf Kronman schrieb:> I'm using Django trunk and I have set the > MaxRequestsPerChild 1 > > directive in httpd.conf. I'm running on Windows XP (sp3?). > > Here a guess: > > Apache creates several threads (or worker processes) and a

Re: Difficulty getting Django working with Apache and mod_python

2008-10-21 Thread Graham Dumpleton
On Oct 22, 2:23 am, projecktzero <[EMAIL PROTECTED]> wrote: > On Oct 20, 4:17 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > > > On Mon, Oct 20, 2008 at 5:15 PM, projecktzero <[EMAIL PROTECTED]>wrote: > > > I'm pretty new to Django. I'm having trouble getting my Django > > > app/web-site to

Re: Getting latest ManyToMany related model

2008-10-21 Thread Charlie Gunyon
Nevermind, I think I figured it out. On Oct 21, 3:13 pm, Charlie Gunyon <[EMAIL PROTECTED]> wrote: > Hey everyone.  Is there a way to get the latest ManyToMany related > model?  My models.py looks like this: > > class Conference(models.Model): >     name = models.CharField(max_length=30, unique=T

Re: what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 2:35 PM, bobhaugen <[EMAIL PROTECTED]> wrote: > > On Oct 21, 12:34 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > Well then the next step I would try is testing out the current patch for > > general model validation, which is ticket #6845: > > > > http://code.djangoproje

Re: File upload progress bar for Django?

2008-10-21 Thread john
On Oct 20, 2008, at 12:22 PM, M Godshall wrote: > Is anyone familiar with a django or python tutorial that shows how > to implement > some kind of file upload progress bar? Ideally I'd like to use > jquery, but I'm open to anything at this point. Any links or code > examples would be greatly

Permissions in template tags

2008-10-21 Thread [EMAIL PROTECTED]
Simple question: is it possible to access all user permissions in template tags just as in regular templates through the {{ perms }} context variable or do I need to manually pass the permissions are template tag params? By default the perms map does not seem to work in tags. --~--~-~--~--

Getting latest ManyToMany related model

2008-10-21 Thread Charlie Gunyon
Hey everyone. Is there a way to get the latest ManyToMany related model? My models.py looks like this: class Conference(models.Model): name = models.CharField(max_length=30, unique=True) class Team(models.Model): name = models.CharField(max_length=30, unique=True) conferences = mod

Named URLs for Flatpages?

2008-10-21 Thread erikcw
Hi all, I'm working on a project that uses flatpages pretty heavily. I was wondering if there was a way to use named urls with flatpages so that I can use reverse() in my other views and {% url flat_privacy_policy %} in my templates. I haven't been able to find anything helpful in the docs so f

Re: Creating a system with multiple types of users

2008-10-21 Thread Mozey
Well, django user auth has groups implemented. "It handles user accounts, groups, permissions and cookie-based user sessions." (http://docs.djangoproject.com/en/dev/topics/auth/? from=olddocs) How can you effectively separate their views. Separate your apps based on their nature, not based on wh

Creating a system with multiple types of users

2008-10-21 Thread itsnotvalid
I am going to help some people making a website that has a few admins, a crowd of service providers (individuals) and customers. There could be agents who invites people to become service providers or customers as well. Looking at the user system provided by django, and as a new programmer to dja

Re: File upload progress bar for Django?

2008-10-21 Thread john Moylan
There are working examples around. Basically get your server to report the upload status to a javascript ui at intervals. Try searching the djangoproject trac server - there is a link from there to a django uploader project on google code that I have used in the past. I think it uses JQuery. I'd s

Re: login_required for imported apps

2008-10-21 Thread bruno desthuilliers
On 21 oct, 16:40, Heather <[EMAIL PROTECTED]> wrote: > I completely agree. Even the middleware solution doesn't seem quite > right as it will check each page/request. Well, that's the whole concept of middlewares, isn't it ?-) > I've been thinking about > this a lot and I wonder if maybe the on

Re: Setting up Django on CentOS5 with flup and fastcgi

2008-10-21 Thread Adam Nelson
I've had great luck with wsgi. http://code.djangoproject.com/wiki/django_apache_and_mod_wsgi http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango This article relates how to reverse proxy that with Nginx if you're interested (for speed, isolation): http://vizualbod.com/articles/nginx-fas

Better attack handling on Apache(wsgi)/Django servers

2008-10-21 Thread adamiis111
I'm starting a new project on Django 1.0/Pinax and I'm noticing that these silly IIS attacks that I used to see in my previous logs show up in a much more cluttered way through Apache(wsgi)/Django. Is there a best practices way to handle these types of attacks so that the attack is logged (or not

problem testing application named "core"

2008-10-21 Thread reyjexter
When running manage.py test core, the test seem to run but no test suite is executed. but when using plain manage.py test its okay. Is this problem caused by the naming? thanks rey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: GeoDjango - Difficulty placing vector marker from DB

2008-10-21 Thread Ariel Mauricio Nunez Gomez
There are many ways to fix the projection issue, this is one (probably not the best) On your view code: sites_list=sites_list.transform(900913) Best, Ariel. On Tue, Oct 21, 2008 at 1:57 PM, Alfonso <[EMAIL PROTECTED]> wrote: > > Hey, > > Having great trouble getting geodjango/openlayers to disp

GeoDjango - Difficulty placing vector marker from DB

2008-10-21 Thread Alfonso
Hey, Having great trouble getting geodjango/openlayers to display vector markers propery - everything I try positions the sample point off the coast of Africa (no matter if I change the vector position in geoadmin). Here's what I'm working with - any help appreciated!: var lon = -2.900; var lat

Re: what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread bobhaugen
On Oct 21, 12:34 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Well then the next step I would try is testing out the current patch for > general model validation, which is ticket #6845: > > http://code.djangoproject.com/ticket/6845 > > Status on this was most recently reported here, I think: >

Re: Name of button pressed not in request.POST

2008-10-21 Thread Glen
I know this is an old thread. However, I found it when searching online when I had the same problem. I did quite a bit of other searching before I finally realized what was happening. Yes, I see the same behavior where the 'submit.x' and 'submit.y' values were in the request.POST dictionary, but

Re: File upload progress bar for Django?

2008-10-21 Thread jonknee
On Oct 20, 7:15 pm, Sascha Brossmann <[EMAIL PROTECTED]> wrote: > > Is anyone > > familiar with a django or python tutorial that shows how to implement > > some kind of file upload progress bar? > > Sorry, but the main magic in those uploaders is done via flash, not > via js or php. AFAIK there is

Re: Setting up Django on CentOS5 with flup and fastcgi

2008-10-21 Thread [EMAIL PROTECTED]
yes i have read that.. it seems that the .fcgi file does not read correctly. it just returns the actual text in the fcgi file. and when i try and run a development server you just get a timeout. On Oct 21, 5:05 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 21, 2008 at 11:50 AM, [EM

Re: what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 12:36 PM, bobhaugen <[EMAIL PROTECTED]> wrote: > > On Oct 21, 10:59 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > Have you tried whatever scenario you are particularly interested in on > 1.0 > > or current code? > > > > Though general model validation did not make it in

Re: Updating path and filename of ImageFieldFile

2008-10-21 Thread Jon Biddle
This code should work with Django 1.0 : from django.db import models from PIL import Image class Photo(models.Model): related_entry_id = models.ForeignKey(MyBlogEntryModel) # Use your model object photo = models.ImageField(upload_to="my_upload_path/") # Point to your upload directory (No

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread ro60
I've been working on an acts_as_list implementation for Django recently. I know gasp... I will prob be strung up by my toes for it. I work with Rails and Django both and like the way that the acts as list stuff works in Rails. The code is untested and there are some gaps that still need to be fil

Disable i18n for certain templates

2008-10-21 Thread Armandas
Hi, I am using internationalization on my project. Recently I found out that output from date filter is not in english. The point is, that I use this to construct pubDate for my rss, like this: {{ post.date|date:"D, d M Y H:i:s" }} GMT and i18n just screws things up here. Is there any proper (n

Re: what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread bobhaugen
On Oct 21, 10:59 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Have you tried whatever scenario you are particularly interested in on 1.0 > or current code? > > Though general model validation did not make it into 1.0, checking of unique > and unique_together was added in changeset [8805]. It m

Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Ulf Kronman
Hi Thomas, > Apache creates several threads (or worker processes) and after one > request the thread/process gets killed. But the other are still alive and > have the old code loaded. > > Maybe you could try mod_wsgi. It is much more flexible. Thanks for the tip. It seems as this could be the ca

Re: PIL with python 2.5 on Leopard - [Solution]

2008-10-21 Thread Heather
Have you tried Macports? If not, you should check it out. On Oct 20, 2:11 pm, Francis <[EMAIL PROTECTED]> wrote: > I had trouble installing PIL on my Mac with 10.5 Leopard. > > I always got an : "Upload a valid image. The file you uploaded was > either not an image > or a corrupted image." > > I

Re: Setting up Django on CentOS5 with flup and fastcgi

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 11:50 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote: > > Hello, > > I am a webhosting provider that is trying to set up django on my > server so that my clients can utilise it for their own programs. > > Although we do not allow ssh access our only ability to allow them >

Setting up Django on CentOS5 with flup and fastcgi

2008-10-21 Thread [EMAIL PROTECTED]
Hello, I am a webhosting provider that is trying to set up django on my server so that my clients can utilise it for their own programs. Although we do not allow ssh access our only ability to allow them access is to use fastcgi Although i am having trouble with doing so. Is there any tutorials

Re: what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 11:39 AM, bobhaugen <[EMAIL PROTECTED]> wrote: > > I mean the normal displayable and user-correctable form validation > errors, not the fatal database IntegrityError. > > I found > http://groups.google.com/group/django-users/browse_thread/thread/f0e245366b02411b/df6d03f32eb

Re: Security Trimming and Roles

2008-10-21 Thread killer barney
awesome! thanks On Oct 21, 6:20 am, "Dj Gilcrease" <[EMAIL PROTECTED]> wrote: > http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#id6http://docs.djangoproject.com/en/dev/topics/auth/#the-permission-requ... > > might be a good place to start reading > > Dj Gilcrease > OpenRPG Develope

Re: comparing from two models in the same function (view) ?

2008-10-21 Thread Net_Boy
def comp(request): form = ItemForm() if request.method=="POST": form = ItemForm(request.POST, request.FILES) if form.is_valid(): if item.price >= old.price and item.pub_date <= old.pub_date item = form.save(commit=False) item.seller = request.u

Re: MySQL to Oracle db engine

2008-10-21 Thread Ian
On Oct 21, 3:55 am, mbdtsmh <[EMAIL PROTECTED]> wrote: > Hi All - I'm having trouble going from using a mysql database to an > oracle database. The MySQL db settings work fine and I can validate & > syncdb my tables into the database. However, when I change my > settings.py to point to an oracle d

what is the status of inline unique_together non-fatal error messages?

2008-10-21 Thread bobhaugen
I mean the normal displayable and user-correctable form validation errors, not the fatal database IntegrityError. I found http://groups.google.com/group/django-users/browse_thread/thread/f0e245366b02411b/df6d03f32eb37f93 and http://www.djangosnippets.org/snippets/338/ both more than a year old.

comparing from two models in the same function (view) ?

2008-10-21 Thread Net_Boy
Hi, I am trying to make a view function to get the posted values and make some comparison (if x.value >= y.value).. where x is the model that I got it's values from the post and y is the other model . so if anyone know how to do that I would be grateful :) regards.. --~--~-~--~

Re: Difficulty getting Django working with Apache and mod_python

2008-10-21 Thread projecktzero
On Oct 20, 4:17 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Oct 20, 2008 at 5:15 PM, projecktzero <[EMAIL PROTECTED]>wrote: > > I'm pretty new to Django. I'm having trouble getting my Django > > app/web-site to run under Apache2 and Mod_Python. I'm running Django > > 0.96. I installe

Re: login_required for imported apps

2008-10-21 Thread Heather
I completely agree. Even the middleware solution doesn't seem quite right as it will check each page/request. I've been thinking about this a lot and I wonder if maybe the only part that should be reusable is the models? I don't know. But since there is no way (that I know of) to use inheritan

Re: File upload progress bar for Django?

2008-10-21 Thread varikin
On Oct 20, 6:15 pm, Sascha Brossmann <[EMAIL PROTECTED]> wrote: > > Is anyone > > familiar with a django or python tutorial that shows how to implement > > some kind of file upload progress bar? > > Sorry, but the main magic in those uploaders is done via flash, not > via js or php. AFAIK there

ordering edit inlines in admin

2008-10-21 Thread patrickk
does anyone know about a clean way to order edit-inlines using the admin-interface? 1. I´ve seen this and other javascript-based snippets: http://simonwillison.net/2008/Sep/13/django/ ... it´s quite simple, but it doesn´t really work. for example, if the formset isn´t valid, the order is lost. ev

filtering pulldowns in django admin

2008-10-21 Thread Matt Berg
I realize there is probably a very simple solution for this but it has been bothering me. How do I filter a pulldown in the admin. If I have an inline form, for example, I want to be able to limit results in a pulldown to the parent object/form. Thanks for the help. Matt --~--~-~--~---

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread shabda
Ordering: qs = Model.objects.filter(...).order_by('ordering_field') ord_list = [el for el in qs] Versioning: code.google.com/p/django-rcsfield (There are a few others, cant remember the names offhand.) On Oct 21, 12:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 21 oct, 08:37, Dan

Re: Query: Field of model "not defined", but existing

2008-10-21 Thread Karen Tracey
On Tue, Oct 21, 2008 at 6:55 AM, Micha Pietsch <[EMAIL PROTECTED]> wrote: > > Hi, > I've got a model "Note" with a DateTimeField "updated". I ran dbsync and > entered some data but making the query > "n = Note.objects.filter(owner=request.user.id > ).exclude(updated__tle=datetime.datetime.now())"

Re: referencing the slug of parent ('self')

2008-10-21 Thread coderb
thanks Daniel. On Oct 21, 2:09 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Oct 21, 1:13 pm, coderb <[EMAIL PROTECTED]> wrote: > > > def category(request, myslug): > >     category_list = get_list_or_404(Category, parent=myslug) > > get_list_or_404(Category, parent__slug=myslug) > -- > DR.

Re: Accessing Sessions in Custom Tags

2008-10-21 Thread Daniel Roseman
On Oct 21, 7:58 am, "Eugene A." <[EMAIL PROTECTED]> wrote: > Thanks for post, I searched this solve too long. > > But: > > I added in settings.py > TEMPLATE_CONTEXT_PROCESSORS = ( >          'django.core.context_processors.request', > ) > and it doesn't work, raises 'Failed lookup for key [request

Re: Security Trimming and Roles

2008-10-21 Thread Dj Gilcrease
http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#id6 http://docs.djangoproject.com/en/dev/topics/auth/#the-permission-required-decorator might be a good place to start reading Dj Gilcrease OpenRPG Developer ~~http://www.openrpg.com --~--~-~--~~~---~--~-

i18n translation in forms?

2008-10-21 Thread chris
Hi there, I am trying to get I18N working for a website. So far the language selection, custom messages and their translation in templates using {% trans "" %} etc. works like a charm. However I can't quite figure out how to get things like the Paginator (it displays and such stuff) or field n

Re: referencing the slug of parent ('self')

2008-10-21 Thread Daniel Roseman
On Oct 21, 1:13 pm, coderb <[EMAIL PROTECTED]> wrote: > def category(request, myslug): >     category_list = get_list_or_404(Category, parent=myslug) get_list_or_404(Category, parent__slug=myslug) -- DR. --~--~-~--~~~---~--~~ You received this message because you

Comments in reversed order

2008-10-21 Thread jrivero
Is possible obtain the comments of django.contrib in reversed order? In old version: {% get_free_comment_list for workgroups.workgroup group.id as comment_list reversed %} But in new version the templatetag not have control of this parameter. The method for order is other? Regards --~--~---

Security Trimming and Roles

2008-10-21 Thread killer barney
Loving django 1.0! But one thing I notice they don't seem to have is security trimming (where you can hide certain links based on the role permissions of a user) or any sort of roles security. Is there any solid way at going about this that already exists in the django framework or is this somet

referencing the slug of parent ('self')

2008-10-21 Thread coderb
hi, I know this is probably easy, but ... I have a category model: class Category(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) parent= models.ForeignKey('self',blank=True,null=True)

Re: Python on Windows re-using old .pyc files?

2008-10-21 Thread Thomas Guettler
Ulf Kronman schrieb: > I'm using Django trunk and I have set the MaxRequestsPerChild 1 > directive in httpd.conf. I'm running on Windows XP (sp3?). > Here a guess: Apache creates several threads (or worker processes) and after one request the thread/process gets killed. But the other are still

Re: i18n all languages not displayed

2008-10-21 Thread bluefireredsky
Great! It works like a charm! Thank you. On Oct 21, 12:33 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-10-21, o godz. 09:30, przez Jarek Zgoda: > > > > > > >> gettext = lambda s: s > > >> LANGUAGES = ( > >>            ('en', gettext('English')), > >>            ('t

Spliting a single result from a db

2008-10-21 Thread [EMAIL PROTECTED]
HI all, I've just starting using django and am really impressed. In my simple app I want to retrieve a single "article" from a db and then display it broken into reasonable length pages (either based on word count or a specific markup in the text). I'd really appreciate any pointers on how I mi

Re: Accessing Sessions in Custom Tags

2008-10-21 Thread Eugene A.
Thanks for post, I searched this solve too long. But: I added in settings.py TEMPLATE_CONTEXT_PROCESSORS = (         'django.core.context_processors.request', ) and it doesn't work, raises 'Failed lookup for key [request] in u"[{'sess': 'hello', 'mods': [, ]}]"' So 'request' field isn't in cont

Query: Field of model "not defined", but existing

2008-10-21 Thread Micha Pietsch
Hi, I've got a model "Note" with a DateTimeField "updated". I ran dbsync and entered some data but making the query "n = Note.objects.filter(owner=request.user.id).exclude(updated__tle=datetime.datetime.now())" tells me that "updated" is "not defined". Without the exclude statement it works, I

Can't validate a datetime ...

2008-10-21 Thread dbee
Getting an error when i try to validate a datetime ... help ! Table "public.tarait1_teleint" Column | Type | Modifiers -+-- +--

Re: cheeserater css reference

2008-10-21 Thread coderb
nevermind, solved - using djangos - serving static pages - work around On Oct 18, 1:22 am, coderb <[EMAIL PROTECTED]> wrote: > forgot to mention that I did actually change the template css > references to match settings.py, but obviously still got it wrong. I'm > using django 1.0 on win XP. > >

Re: is it possible to run 0.96 and 1.0 in parallel?

2008-10-21 Thread Rachel Willmer
Virtualenv - great, just what I've been looking for :-) Thanks Rachel --~--~-~--~~~---~--~~ 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 unsubs

Re: How to save/link/rename thumbnail in model

2008-10-21 Thread mcordes
Hello, I'd suggest you also consider this app: http://code.google.com/p/sorl-thumbnail/ . It makes it very simple to have thumbnails of various sizes associated with your image fields. -Matt On Oct 21, 2:10 am, krylatij <[EMAIL PROTECTED]> wrote: > You can define image upload path at runtime (

MySQL to Oracle db engine

2008-10-21 Thread mbdtsmh
Hi All - I'm having trouble going from using a mysql database to an oracle database. The MySQL db settings work fine and I can validate & syncdb my tables into the database. However, when I change my settings.py to point to an oracle database then I get the following error (I have cx_Oracle instal

Adding a custom permission to the User model

2008-10-21 Thread Benedict Verheyen
Hi, I'm trying to specify a custom permission on the User model. I would use it to delegate control to users over certain models. I have an admin.py file where i add this: from django.contrib.auth.models import User ... class UserAdmin(admin.ModelAdmin): class Meta: permissions = (

Re: login_required for imported apps

2008-10-21 Thread bruno desthuilliers
On 20 oct, 01:33, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sun, Oct 19, 2008 at 2:10 PM, bruno desthuilliers > > <[EMAIL PROTECTED]> wrote: > > Indeed. But , OTHO, having to copy/paste a whole urls.py just to a add > > a simple decorator on the view functions is not really DRY. > > Person

Authenticating static files against Django Auth with FastCGI

2008-10-21 Thread MrJogo
Hi, I am using Django on my university webspace. I set it up by following (and slightly modifying) the instructions on this page: http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache Now I would like to protect certain static file

Re: i18n all languages not displayed

2008-10-21 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-21, o godz. 09:30, przez Jarek Zgoda: >> gettext = lambda s: s >> >> LANGUAGES = ( >>('en', gettext('English')), >>('ta', gettext('Tamil')), >>('hi-IN', gettext('Hindi')), >> ) >> >> My folder structure on the locale is as foll

Re: i18n all languages not displayed

2008-10-21 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-21, o godz. 07:46, przez bluefireredsky: > I am implementing an i18n for a web application. The customer requires > support for certain Indian languages such as Hindi and Tamil. I had > refered to http://www.i18nguy.com/unicode/language-identifiers.html > for i

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread [EMAIL PROTECTED]
On 21 oct, 08:37, Daniel Roseman <[EMAIL PROTECTED]> wrote: > > acts_as is a Ruby design pattern rather than a Python one. However, > for the specific higher/lower functionality, look into > django-mptt:http://code.google.com/p/django-mptt/ Very good. Do you know something to do : * ordered l

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-21 Thread James Bennett
On Tue, Oct 21, 2008 at 12:45 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In Elixir, when I add acts_as_list(qualifier=qualify) in Model I can > use move_higher, move_lower ... methods. Be careful about confusing multiple things here; there are applications available for Django which add f