cache large files

2010-01-21 Thread Hinnack
Hi, I am using memcached for caching my sites. The documentation says when not to use it: http://code.google.com/p/memcached/wiki/WhyNotMemcached one point is output larger 1 MB I have a site producing pdf files only, where size can easily go over 1 MB. As the docs above mention mogilefs as an

Re: Cannot convert float to Decimal. First convert the float to a string Error

2010-01-21 Thread Karen Tracey
On Fri, Jan 22, 2010 at 1:13 AM, grp25 wrote: > got error: > Cannot convert float to Decimal. First convert the float to a string > > our code is: > usr.ratings=usr.ratings-0.5 > usr.save() > > 'usr.ratings' is a float field. > Are you absolutely sure of that? It

Cannot convert float to Decimal. First convert the float to a string Error

2010-01-21 Thread grp25
got error: Cannot convert float to Decimal. First convert the float to a string our code is: usr.ratings=usr.ratings-0.5 usr.save() 'usr.ratings' is a float field. Help resolve it... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Import problem on the attempt to use {% url %}

2010-01-21 Thread Karen Tracey
On Thu, Jan 21, 2010 at 9:28 PM, Felipe wrote: > Hello Friends, > > Someone here know what this error mean? > > http://www.catojo.com.br/contact/ > > This generally happens when I try to use something like {% url %} tag. > > But I've been ensured that the view

Import problem on the attempt to use {% url %}

2010-01-21 Thread Felipe
Hello Friends, Someone here know what this error mean? http://www.catojo.com.br/contact/ This generally happens when I try to use something like {% url %} tag. But I've been ensured that the view 'home.views' exists and it is placed in blog.home.views directory, however, by some unknown issue

Re: Multiple icontains using OR - Is it possible?

2010-01-21 Thread tm
This worked! Thank you On Dec 15 2009, 11:27 pm, HARRY POTTRER wrote: > you're going to need the Q object, it seems. > > from django.db.models import Q > MyModel.objects.filter(Q(summary__icontains=q) | Q > (title__icontains=q)) > > On Dec 15, 10:32 pm, tm

django-authopenid user timeout

2010-01-21 Thread Rachel Willmer
I've just installed django-authopenid in a project, and it seems to be working just fine, apart from one minor issue. (The creator of django-authopenid isn't maintaining the project any more, and there isn't a mailing list, hence why I'm asking this question here rather than elsewhere.) So, as I

newline in GET data

2010-01-21 Thread Sumanth
Hi , I am having newlines in GET data , but when the data comes to server newline chars are removed. Is that any way I can retain new line chars ? Thanks Sumanth -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Making InlineModelAdmin objects required.

2010-01-21 Thread iliveinapark
Thanks mate, I'll look into that at some point. It's not a major requirement of the project, so I'll put it on the backburner for now. Cheers, Brenton. On Jan 21, 5:21 pm, "mattimust...@gmail.com" wrote: > Hi, > > Take a look

Re: ChoiceField

2010-01-21 Thread pinco
The code {% for choice_value, choice_text in myform.fields.choicefieldname.choices %} choice_value: {{ choice_value }} choice_text: {{ choice_text }} {% endfor %} gives the choices text and values associated to each choice, but actually do not

Re: How to Model a relationship on a constrained subset of the foreign key.

2010-01-21 Thread Wolf Halton
@Taliesin Remember we are all volunteers, here. -wolf sent from the research lab at http://networksecuritynews.net On Jan 21, 2010 3:35 AM, "taliesin" wrote: taliesin wrote: > > HI. I have a newbie-ish question, if that's alright. I don't know how to model a... Okay,

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Ramiro Morales
On Thu, Jan 21, 2010 at 5:31 PM, Walt wrote: > Okay... The latest release of django that I downloaded has this: > > > A previous version that is currently working is this: > > > How can I modify or specify that path? And why would it have > changed? Because in the

Re: django utf-8 Error; field.get_default? I don't think the string I feed to Location should be signed to field.get_default

2010-01-21 Thread Karen Tracey
2010/1/21 iasybvm > I have created an object Location: > class Location(models.Model): >city = models.CharField(max_length=50) >state = models.CharField(max_length=50) >... > I think you've left out a key bit here. The traceback you include shows the problem

Re: I'm wanting to modify Django CMS so I can restrict the content I make to particular users site side?

2010-01-21 Thread ojo
On 21 Sty, 12:15, littlejim84 wrote: > I have content that I've created in Django CMS that I then want to > restrict access to on the site site (not the editing side, like with > the CMS_PERMISSIONS option in Django CMS). I've been told that I can > use either

django utf-8 Error; field.get_default? I don't think the string I feed to Location should be signed to field.get_default

2010-01-21 Thread iasybvm
I have created an object Location: class Location(models.Model): city = models.CharField(max_length=50) state = models.CharField(max_length=50) ... But I can't initialize it with either unicode data or utf-8 data. I created a record by hand in my postgresql database. I can now read it

Re: Analyzing modules before application start

2010-01-21 Thread Matt Schinckel
On Jan 22, 12:00 am, Filip Gruszczyński wrote: > I would like to go through all registered apps before server is > started and check if certain modules (and then process them). I guess > this mechanism is similar to the one, which looks for models or tests > in django

unicode LookupError with Django + mod_wsgi

2010-01-21 Thread Kevin L
Hi all, I also asked this on the mod_wsgi list but it seems like it may be being caused by Django so I figured this might help. Sorry if it turns out to not be Django-related, but the exception is getting raised by Django code. So I'm running into some strange errors with Django + mod_wsgi.

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Okay... The latest release of django that I downloaded has this: A previous version that is currently working is this: How can I modify or specify that path? And why would it have changed? Thanks, Walt -~ -- You received this message because you are subscribed to the Google Groups "Django

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
That line is there, but for some reason *that* is the broken link! That at least gives me something to track down... Thank you for your help! Walt -~ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Daniel Roseman
On Jan 21, 5:51 pm, Walt wrote: > Okay, we're getting somewhere. It can find the JS file(s) just fine > and I see that the calendars are added dynamically. However, I'm > have found that it is generating a javascript error when the page > loads: > > Error: gettext is not

Re: ChoiceField

2010-01-21 Thread Daniel Roseman
On Jan 21, 3:59 pm, Shawn Milochik wrote: > > I think there might be a terminology issue here. I suspect the OP is > > looking for all the possible value of a model field with `choices` > > set. Which, is not easily possible from a template (although you can > > do it in

Re: about django 1.2 alpha release

2010-01-21 Thread James Bennett
On Thu, Jan 21, 2010 at 12:09 PM, rodel bosque wrote: > is django 1.2 alpha release support python version 3? As the main Django documentation page suggests, it's a good idea to consult the FAQ:

about django 1.2 alpha release

2010-01-21 Thread rodel bosque
hi, is django 1.2 alpha release support python version 3? 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-us...@googlegroups.com. To unsubscribe from this group, send email to

Best Practice for developing djangoapp in a repository

2010-01-21 Thread Julian
Hello, my problem is maybe not very specific but more a problem with an approach. Let's say I want to work on a djangoapp (in this case django- tagging, the famous tagging app). I'm not very satisified with the code and want to simplify it. if I clone the repository I have a folder

GET request breadcrumbs

2010-01-21 Thread Meenal
So far I have seem template inheritance based examples for breadcrumbs in django. However for a project I am working on that does not quite work because all templates inherit from base. For eg. templates/base.html common/ a.html, b.html, c.html myapp/ m.html, n,.html,

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Okay, we're getting somewhere. It can find the JS file(s) just fine and I see that the calendars are added dynamically. However, I'm have found that it is generating a javascript error when the page loads: Error: gettext is not defined Source File: http://tachamber.org/media/admin/js/calendar.js

FormWrapper in django1.1

2010-01-21 Thread goome
Hello any substitute for forms.FormWrapper in django1.1. ? sorry for my poor english 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-us...@googlegroups.com. To unsubscribe from this group, send

Django custom fields and generic relationships

2010-01-21 Thread dystopia
Hi, I'm struggling to find any useful tutorials on how best to achieve this so a nudge in the right direction would be greatly appreciated. I've set up a model which references django_content_type. My idea is to use this model to reference other models so that they can be marked as "featured"

Re: Should a decorator be used here or should I do something else.

2010-01-21 Thread Bill Freeman
A decorator is certainly a clean way to apply consistent checking to a bunch of views. But it is primarily useful if the selection of the view function by the urlconf gives you all you need to know about for what age groups the *CONTENT* is appropriate. If, on the other hand, different rows in

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Carl Zmola
Make sure you can download the JS file. It could be a permissions problem, or your static content server is down. Walt wrote: On Jan 21, 10:28 am, Daniel Roseman wrote: Do you have TinyMCE on the same admin page? And are you using Firefox 3.5+? If so it might be

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
On Jan 21, 10:28 am, Daniel Roseman wrote: > > Do you have TinyMCE on the same admin page? And are you using Firefox > 3.5+? If so it might be this bug:http://code.djangoproject.com/ticket/11967 No, I don't think this is the problem. First, I'm not using TinyMCE on the app

Re: Table with 4 Milions of rows

2010-01-21 Thread Carl Zmola
I'm a little late, but if you create the correct indexes on the table, you will be fine. Also, use unique id fields as much as possible for linking your tables. Carl nameless wrote: Hi at all. I have a project with 2 applications ( books and reader ). Books application has a table with 4

Setting a user to have particular permission group when registering with django-registration?

2010-01-21 Thread littlejim84
I'm using django-registration and want to set a user to have a paricular permission group when they sign in. What is the best way to implement this without messing with the source of the actual app? Any information at all would be good. I'm having no luck at all on the IRC chat group. James --

Finding the Min time_of_day from a date field (in a query set)

2010-01-21 Thread Carl Zmola
I am starting to understand aggregation and annotation in django, but I am having a hard time translating the following sql select au.username as 'user name', count(1) as event_count , min(time(log.start_date)) as min_tod, max(time(log.start_date)) as max_tod from log as log join

Re: Templating problem: equal symbol "=" escaped to "=3D"

2010-01-21 Thread Enrico Sartorello
Ok maybe I got it. I found those "=3D" symbols just looking at the output of the Python SMTP server that simulates the email process. I think that those mime escaped characters will be correctly converted back to "=" symbols when processed by a mail client. Am I correct? On Thu, Jan 21, 2010

Re: ChoiceField

2010-01-21 Thread Shawn Milochik
>> > > I think there might be a terminology issue here. I suspect the OP is > looking for all the possible value of a model field with `choices` > set. Which, is not easily possible from a template (although you can > do it in Python: MyModel._meta.get_field_by_name('myfield') > [0].choices) >

Re: Templating problem: equal symbol "=" escaped to "=3D"

2010-01-21 Thread Enrico Sartorello
You're right, it's the mime escaping! In order to send emails I simply use: render_to_string(file) send_mail() How can I send plain text messages with '=' symbols without getting it escaped? On Thu, Jan 21, 2010 at 4:20 PM, Malcolm Box wrote: > Are you sure it's

Re: ChoiceField

2010-01-21 Thread Daniel Roseman
On Jan 21, 2:14 pm, Shawn Milochik wrote: > What did you try? > > I found it easily. > > First: > print dir(myform) > #I found that myform has a 'fields' attribute. > > Second: > print dir(myform.fields['choicefieldname']) > > #found myform.fields['choicefieldname'].choices >

Re: Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Daniel Roseman
On Jan 21, 3:23 pm, Walt wrote: > Hi all, > > I don't know of any changes I've made recently other than > checking out the latest django code but the date picker / > popup on all admin datefields has suddenly disappeared. > > Any clues as to how to get this back or what

Admin calendar popups on datefield suddenly missing

2010-01-21 Thread Walt
Hi all, I don't know of any changes I've made recently other than checking out the latest django code but the date picker / popup on all admin datefields has suddenly disappeared. Any clues as to how to get this back or what might have caused it to disappear in the first place? Thanks, Walt

Re: Templating problem: equal symbol "=" escaped to "=3D"

2010-01-21 Thread Malcolm Box
Are you sure it's django templates that are doing the escaping? =3D is the mime escaping for = - could it be something else in your email processing chain that's escaping the sign? Malcolm On 1/21/10, Enrico Sartorello wrote: > Hi, > i'm using Django template system

Templating problem: equal symbol "=" escaped to "=3D"

2010-01-21 Thread Enrico Sartorello
Hi, i'm using Django template system to render some text files (not HTML pages) that I use to send emails. I have a problem: in a template file, any occurence of the "=" symbol is escaped to "=3D" no matter what is placed before or after it. '=' is strangely escaped to '=3D' even if autoescape is

Re: ChoiceField

2010-01-21 Thread Shawn Milochik
What did you try? I found it easily. First: print dir(myform) #I found that myform has a 'fields' attribute. Second: print dir(myform.fields['choicefieldname']) #found myform.fields['choicefieldname'].choices Third: print myform.fields['choicefieldname'].choices #got all the nice options I

view_form for class ModelAdmin

2010-01-21 Thread Massimiliano della Rovere
Has anybody ever implemented an extension to class ModelAdmin to add "view_form" function and templates? I'm in a situation where the logged user can list both draft and published files. With ModelAdmin.queryset i filter the files the user is allowed to list in "change_list" view, but those files

Analyzing modules before application start

2010-01-21 Thread Filip Gruszczyński
I would like to go through all registered apps before server is started and check if certain modules (and then process them). I guess this mechanism is similar to the one, which looks for models or tests in django application. Is there any easy way to do this and where should inject such code?

Re: Problem with Django

2010-01-21 Thread esatterwh...@wi.rr.com
these error messages seem to rather explanatory. you are trying to serialize data that the serializer you are using can not serialize. you will have to convert the data into a format that is serializeable before hand and then send it. On Jan 21, 3:16 am, Meenu

Creating a dashboard item

2010-01-21 Thread dystopia
Hi, I've created a little to-do list model. I'm trying to get a list to appear on the dashboard (like the history list) with a tickbox next to each item. Would I need to change a template somewhere (i.e. code something to render the list like this: http://www.djangobook.com/en/beta/chapter18/)

I'm wanting to modify Django CMS so I can restrict the content I make to particular users site side?

2010-01-21 Thread littlejim84
Hello. I'm not really an expert in Python or Django, but am looking for a solution to this problem. I've had no luck with this in the Django CMS mailing list or IRC and it's really more about Django and how to mod things generally so I can have more control over things. I'm not wanting to mod the

Re: Django and caching when data is updated

2010-01-21 Thread Russell Keith-Magee
On Thu, Jan 21, 2010 at 6:00 PM, Malcolm Box wrote: > Hi, > > On Thu, Jan 21, 2010 at 7:35 AM, Russell Keith-Magee > wrote: >> >> On Thu, Jan 21, 2010 at 7:47 AM, Malcolm Box >> wrote: >> > >> > I've got a simple question

Re: Django and caching when data is updated

2010-01-21 Thread Malcolm Box
Hi, On Thu, Jan 21, 2010 at 7:35 AM, Russell Keith-Magee wrote: > On Thu, Jan 21, 2010 at 7:47 AM, Malcolm Box > wrote: > > > > I've got a simple question that I can't find the answer to: if the data > > that a view depends on changes, does

Re: Problem with Django

2010-01-21 Thread Meenu
My form contains date of birth and total income field. I am getting following errors: datetime.date is not json serializable decimal is not json serializable. On Jan 21, 11:06 am, Prashanth wrote: > Hi, > > On Thu, Jan 21, 2010 at 10:53 AM, Meenu

Re: How to Model a relationship on a constrained subset of the foreign key.

2010-01-21 Thread taliesin
taliesin wrote: HI. I have a newbie-ish question, if that's alright. I don't know how to model a particular relationship in Django. I have an Account model which represents a customer account - billing address, balance and all that. And I have a Contact model, which represents actual people

Re: Easy database modeling question

2010-01-21 Thread Waqqas Jabbar
If you want to add a profile for each user, check out http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/ the key in django is reusing existing "applications" maybe this might help http://code.google.com/p/django-messages/ On Thu, Jan 21, 2010 at 6:16 AM,