Re: 'Session' object does not support item assignment

2007-06-17 Thread Vertigo
Thanks, Jeremy. Your piece of code works perfectly. I will think about suggestions for the documentation and open a ticket. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

can't use database IDs in filenames with ImageField

2007-06-17 Thread craig.ds
I have a model with an image field. I have overridden the default image field behaviour like so: class ImageField(models.ImageField): def get_directory_name(self): longid = str( model_instance_id_number ).zfill(6) directory = longid[0:2] + "/" + longid[2:4]

Re: Authentication expiration time

2007-06-17 Thread SmileyChris
On Jun 18, 3:02 am, itsnotvalid <[EMAIL PROTECTED]> wrote: > That works, but it changes the behavior of all cookies set in the > site. > What if I need to have different expiration times for different > cookies, or if I have to offer the user an option on how long the > cookies' kept? There's rece

Re: persistant dict

2007-06-17 Thread Malcolm Tredinnick
On Sun, 2007-06-17 at 20:52 -0500, Jeremy Dunck wrote: > On 6/17/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > ... > > > > Use the low-level caching API to store things like this. Write a short > > funciton that retrieves a value from the cache and regenerates it and > > stores it if it is n

Re: persistant dict

2007-06-17 Thread Jeremy Dunck
On 6/17/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: ... > > Use the low-level caching API to store things like this. Write a short > funciton that retrieves a value from the cache and regenerates it and > stores it if it is not in the cache. No extra work required. > > http://www.djangoproje

Re: persistant dict

2007-06-17 Thread Malcolm Tredinnick
On Sun, 2007-06-17 at 13:45 -0500, Carl Karsten wrote: > I have a function that takes a dict and a string, returns a list: > > def trie_search(trie, s): > ... > return res > > mk_trie(the_trie) takes 15 seconds to build from a static list of 750,000 > words.txt so I don't want to call

Re: request.POST.getlist('fieldname') / repeated rows of fields

2007-06-17 Thread David Priest
It also appears that a dashed name can cause problems in templates, as it is interpreted as minus sign. On 07-Jun-12, at 5:42 PM, David Priest wrote: > Well, now, that is an interesting find. > > It seems to me the upcoming prefix attribute should result in a > dotted name, not a dashed one,

Re: Authentication expiration time

2007-06-17 Thread rtconner
What about the "log user out after 30 minutes" part of my quesiton? On Jun 17, 2:11 am, "Chatchai Neanudorn" <[EMAIL PROTECTED]> wrote: > Rob > > You can control cookie expiration by setting SESSION_COOKIE_AGE. > Default value is 2 week (1209600 seconds). You can try 'remember' user login

User profile views - Does something like this make sense?

2007-06-17 Thread zenx
I want to show the user the latest users that have seen his profile. So everytime a logged user views another user's profile a ProfieView object is stored in the database (or the date is updated if the user that is viewing the profile has already viewed it before). I know this can make the databas

Re: relation-spanning lookups with generic relations?

2007-06-17 Thread [EMAIL PROTECTED]
It seems like it would make more sense to do something like: TaggedItem.objects.filter(book__writer="Dostoevsky") Unfortunately it looks like this constructs faulty SQL (the join statement in particular), although it appears like it _should_ work. Just try TaggedItem.objects.filter(alskdfjladf='d

Re: Textmate & Template Highlighting

2007-06-17 Thread Tom Davis
Okay, I figured this out. I had tried messing with the theme itself before, but this time I went in and poked around in the Bundle code for the HTML language for a while. Here's my solution for anyone as anal as me who was wondering how to do this. It may not be the only solution, or even the b

Re: persistant dict - using twisted

2007-06-17 Thread Carl Karsten
> > I am considering using twisted to create a little server that does nothing > but > host trie_search(s) (note the lack of trie.) I realize that it will have to > return a string - that is ok, it is just a list of words found in words.txt. > > But twisted seems like overkill. otoh, I do w

persistant dict

2007-06-17 Thread Carl Karsten
I have a function that takes a dict and a string, returns a list: def trie_search(trie, s): ... return res mk_trie(the_trie) takes 15 seconds to build from a static list of 750,000 words.txt so I don't want to call it every time I need to call trie_search(). So I want to build the_tr

Textmate & Template Highlighting

2007-06-17 Thread Tom Davis
This may be a bit of an odd question, but I'm wondering if anyone has found a way to make template variables in quotes properly colored. For instance, if you have something like , that template variable will not be properly highlighted because it's inside a string. Anyone know how to fix this? O

Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-17 Thread Florian Apolloner
I am not quite sure wheter my answer is correct, as you didn't post your view, but I think this is your problem (copy&paste from http://www.djangoproject.com/documentation/templates/#regroup): Note that {% regroup %} does not work when the list to be grouped is not sorted by the key you are groupi

Re: locale support - decimal point character

2007-06-17 Thread Eduardo Schettino
> This is the feature requested in #3940 and it's something I've been > looking at a bit recently to work out how we can make it work reasonably > smoothly. Ok Thanks. I did look for tickets but only looking for the word "locale". Eduardo On 6/17/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote

Yahoo! hits flack from shareholders www.aliozturk.blogcu.com

2007-06-17 Thread ALİ ÖZTÜRK Economist
Yahoo! hits flack from shareholders www.aliozturk.blogcu.com Canthe Church really sue Sony? www.aliozturk.blogcu.com Google and Intel pledge to go green www.aliozturk.blogcu.com Qassim Abdul-Zahra in Baghdad-Associated Press www.aliozturk.blogcu.com Thous ands Hail Bush in Visit to Albania www.a

template error

2007-06-17 Thread dailer
I"m trying to test mptt: http://code.djangoproject.com/wiki/ModifiedPreorderTreeTraversal I keep getting this error: 'module' object has no attribute '__path__' The error comes from: C:\Python25\lib\site-packages\django\template\__init__.py in get_library, line of code: mod = __import__(module

Re: Authentication expiration time

2007-06-17 Thread itsnotvalid
That works, but it changes the behavior of all cookies set in the site. What if I need to have different expiration times for different cookies, or if I have to offer the user an option on how long the cookies' kept? --~--~-~--~~~---~--~~ You received this message

Re: Unable to see user id

2007-06-17 Thread jeffhg58
That was the problem. Thanks so much! Jeff -- Original message -- From: Pedro Lima <[EMAIL PROTECTED]> > > Are you sending the RequestContext into the template? > > render_to_response('page.html', RequestContext(request,{}) > > > On Jun 17, 4:06 pm, jeffhg58 wrote

Re: Unable to see user id

2007-06-17 Thread Pedro Lima
Are you sending the RequestContext into the template? render_to_response('page.html', RequestContext(request,{}) On Jun 17, 4:06 pm, jeffhg58 <[EMAIL PROTECTED]> wrote: > I am having a problem seeing the user id on my web pages. Basically, I > am referencing > {{ user.username }} in my html tem

Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-17 Thread Nicolas Steinmetz
Hello, I have the following Model : class Summary(models.Model): who = models.ForeignKey(User, unique=True, verbose_name='Personne') job_profile = models.CharField('Profil de poste', maxlength=100) summary = models.TextField('Résumé',) intervention_level = models.ManyToManyFi

Unable to see user id

2007-06-17 Thread jeffhg58
I am having a problem seeing the user id on my web pages. Basically, I am referencing {{ user.username }} in my html template. In my views I have imported from django.contrib.auth.models import User and I am using the login decorator. I have no issues with logging in to the site, just can't seem t

Fwd: special session-time usecase

2007-06-17 Thread dummy
Hi all, I've asked the users about this last month. Today I read the SessionMiddleware code and I think I found an answer: settings.SESSION_SAVE_EVERY_REQUEST = True settings.SESSION_COOKIE_AGE = 20*60 # 20minutes settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = False should do what I want. I will t

Re: Authentication expiration time

2007-06-17 Thread Chatchai Neanudorn
Rob You can control cookie expiration by setting SESSION_COOKIE_AGE. Default value is 2 week (1209600 seconds). You can try 'remember' user login by closing browser without clicking 'Log out' button. Nex time your visite that page, you can access it without re-login. For security