Template Caching with Messages

2013-04-24 Thread Venkatraman S
It looks to me that when i use a file based caching, and if append messages in my templates(based on user action), that particular page(with message) also gets cached. Since 'these' pages would never be created again, what is the best possible option? (Well, i just used file-based cache to quickly

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I mogodb to enter data in, can not pass data from csv into a model, you must be a Document -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr

Re: Upload csv file

2013-04-24 Thread abhijeet shete
Can you please briefly explain your model structure and how you are trying to save csv in MongoDB so that we can check whats going wrong. > Cheers. Abhijeet Shete -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
What I'm doing is the following link: http://plnkr.co/edit/hoaPt2ljRDZbw7XdW80Q I can input the registration, filling and pressing the add. But now, I wanted to select a csv file and insert the data. I'm trying the way the link is there, but do not know if it's correct, because I'm starting in

Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread slim
Hello everyone, I have this error since a long time but can't figure it out : *Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found* It happens in admin when I try to add or modify on one of my models (display works fine) This is the model: class

Re: Upload csv file

2013-04-24 Thread abhijeet shete
1. In your views.index function you have written something like this file = request.FILES for line in file: You cant use file object directly instead try some thing like this file = request.FILES['file'] for line in file.readlines(): line = line.split(';') 2. Y

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
Ok, I made the changes as you said. But when I choose the csv file and then I click the submit button, it gives me the following error has: *"Key 'Nome' not found in "* * * I do not know why* * -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Upload csv file

2013-04-24 Thread abhijeet shete
According to form you used in your template it will send only file {% csrf_token %} Submit -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-u

Choices with many to many

2013-04-24 Thread BOLKAN
Hi to all thi is my first post on django group. I'm new on django and I'm going crazy for a week on this question: I have these models: class Linea(models.Model): linea = models.CharField(unique=True, max_length=10, verbose_name = "Linea") class Meta: verbose_name_plural = "

django development server timeout too quick

2013-04-24 Thread Hadi Sunyoto
The problem is like this: i am using django admin, and in several forms, it might take around 10-20 minutes to fill up. By the time save button is pressed, i am always redirected to login page. The question is: how can i make the timeout longer (or maybe last forever) I set the cache to file an

Re: Upload csv file

2013-04-24 Thread abhijeet shete
According to form you used in your template it will send only csv file after clicking on submit button. {% csrf_token %} Submit If you want to access Nome and Sobrenome in views on submit button, then you need to pass these inputs in the same form you used for submit as {% csr

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
It was because I first had to enter the fields and now wanted by csv. So now I removed the fields, and only got the upload. How are here: http://plnkr.co/edit/hoaPt2ljRDZbw7XdW80Q And it's ok. Already inserting data from csv. Thank you for your help -- You received this message because you are

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I have a problem that I am not able to resolve. With the code I left in the previous post, you are entering data in csv db without problems, but for example the csv file looks like this: Name, Surname Rui Gomes Renato, Aimar And I just want it to be inserted into the db (Renato Gomes and Rui, Ai

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I have a problem that I am not able to resolve. With the code I left in the previous post, you are entering data in csv db without problems, but for example the csv file looks like this: Namo,Sobrenome Rui,Gomes Renato,Aimar And I just want it to be inserted into the db (Renato Aimar and Rui Gom

Re: Upload csv file

2013-04-24 Thread Shawn Milochik
http://docs.python.org/2/library/csv.html#csv.DictReader -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to th

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
Try iterating through your output in the view and look at field, field.content, and if field.help_text. Somewhere you have a null value which is None in Python. Since the traceback you posted (if it's complete) is all from Django's code and not yours, then the error must be in your data. -- You

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
That was it, I managed Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
That's what I was thinking,it's from the data But I dont know wich field and how to find out 2013/4/24 Shawn Milochik > Try iterating through your output in the view and look at field, > field.content, and if field.help_text. Somewhere you have a null value > which is None in Python. > > Since

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
See what I said above about iterating through the fields in your view. Use logging, print statements, or dump output to a file. On Wed, Apr 24, 2013 at 10:39 AM, Wissal Khadrouf WBC < wissal.khadr...@wbc.ma> wrote: > That's what I was thinking,it's from the data > But I dont know wich field and

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
it's the admin view you're telling me to modify I'm sorry I'm faily new to django and I'm afraid I will do something wrong! 2013/4/24 Shawn Milochik > See what I said above about iterating through the fields in your view. Use > logging, print statements, or dump output to a file. > > > On Wed,

handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-24 Thread sachin
Hello, I m extending my auth user model to add addition entries like phone numbers and emp_id. In the model I m marking both the fields as unique=True. Form generation is using UserCreationForm. But whenever I try to save same phone number or emp_id it throws *IntegrityError: (1062, "Duplicate

Django Documentation

2013-04-24 Thread Trevor Reed
Hello, I am relatively new to Django, but I love it so far. Is it possible to remove categories from the application documentation page, such as Tags, Filters, and Views. Thank You -- You received this message because you are subscribed to the Google Groups "Django users" grou

Remove Django Documentation Items

2013-04-24 Thread Trevor Reed
Hello guys, is it possible to remove entries from the Django generated Documentation? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsu

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
Ah, I missed that point. You could temporarily create an __init__ override in your model and put the code there. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Wissal Khadrouf WBC
I went the hard way and changed all the null values untill I found out which one caused a problem Thanks 2013/4/24 Shawn Milochik > Ah, I missed that point. You could temporarily create an __init__ override > in your model and put the code there. > > -- > You received this message because you a

Re: Using Django and R in a production environment?

2013-04-24 Thread Alex Mandel
There is another large potential gotcha, R is very memory heavy. I do think the route of using Celery or other job management tools makes sense, especially if you can use R across multiple backend machines. Would celery mean one rpy2 per celery? You don't really want all your users using the sa

Re: Admin pagination not digg-style

2013-04-24 Thread Andre Terra
Override the default template and add a for loop with {% forloop.counter %}'s from 0 to max-pages or whatever the variable is called. Assuming you're talking about the change form, please see this: http://stackoverflow.com/a/3729995/447485 Otherwise you can still probably work from the info provi

Django 1.5.1 and formsets with more than 1000 initials

2013-04-24 Thread Carsten Fuchs
Hi all, using Django 1.5.1, having read , I still have trouble creating a formset with more than 1000 initial forms: Following the example at that page, what I'd like to do is, with MyInitials b

Re: Using Django and R in a production environment?

2013-04-24 Thread lgautier
> (...) You don't really want all your > users using the same R session anyways. Particularly is users are allowed to run their own code, as the original post suggested it. A sandboxing+quota mechanism would also be necessary. L. On Wedn

Re: Abridged summary of django-users@googlegroups.com - 43 Messages in 19 Topics

2013-04-24 Thread Simon Pickles
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. V

performance of delete

2013-04-24 Thread Larry Martell
I have a table that has 2.5 million rows and 9 columns that are all int except for 2 varchar(255) - i.e. not that big of a table. I am executing this statement: Event_Message_Idx.objects.filter(event_id__in=event_ids).delete() Where event_ids has around 1,500 items in it. There is an index on eve

Re: performance of delete

2013-04-24 Thread Setiaman Lee
Larry, Avoid to use IN clause. I'd say to insert the events you want to delete into the temp table. You can put the session id or user id in temp table to differentiate set of data from other users. Then do the delete by joining the temp table to the Event_Message_ldx table. your sql might look l

Re: performance of delete

2013-04-24 Thread Larry Martell
I changed it to delete one row at a time and it's taking 3 minutes. On Wed, Apr 24, 2013 at 6:38 PM, Setiaman Lee wrote: > Larry, > > > Avoid to use IN clause. I'd say to insert the events you want to delete into > the temp table. You can put the session id or user id in temp table to > different

Re: performance of delete

2013-04-24 Thread Matt Long
I'm curious how long manually running a single delete query with the appropriate where clause would take. Surely there's a way to do that through the Django ORM without having to drop into raw SQL? That being said, there are limits to how long a given query can be, so the ORM would have to do s

Re: performance of delete

2013-04-24 Thread Nick Santos
Related to the use of IN, but not an answer, I've found this series of article from ExplainExtended to be super helpful in optimizing some of my DB queries. These two are for MySQL, but the author has versions for Postgres and SQL Server as well. I know this help is limited with an ORM, but maybe w

Re: Django 1.5.1 and formsets with more than 1000 initials

2013-04-24 Thread Xavier Ordoquy
Hi Carsten, When you create your FormSet with formset_factory, the max_number is set to the max of 1000 and max_num. The fact that you set a bigger number of initials doesn't affect this number. I'm not sure whether the FormSet could extends itself this number if the initial_data is larger than