Modifying a field in another model

2013-04-21 Thread Vittorio
My (newbye) problem is as follows:

Suppose

class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
address = models.CharField(max_length=100)


class Lent_Book(models.Model):
title = models.CharField(max_length=100)
to_whom = models.ForeignKey(Person)
last_known_address= HERE I WOULD LIKE TO SHOW AND, IF NECESSARY, MODIFY 
Person.address

In a nutshell, my problem is: when I run admin and open Lent_book I would like 
to have a changeable field 'last-know_address' that  modifies Person.address in 
one shot (without having to open Person).

Is that possible and how?

An example would be highly appreciated.

Ciao from Rome
Vittorio
 

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread sparky
Thanks for the responses it's very helpful.

You are right, I won't have 100,000 tasks every seconds it's just a huge 
batch I have to send which at the moment would be 100,000 tasks.

But just to be clear:

Loop each contact in my DB:
   TASK: SEND 1 SMS FOR CONTACT

I'm use Amazon SQS for the broker. 

Each task currently takes around 5 seconds to complete, If I remove the 
task it's less that a second per SMS. meaning it would take 100+ hours to 
send all my messages, far, far to long!




-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread sparky
One last thing to add, the task it's self does not seems to be the issue, 
'got message from broker'  is the 3-4 second wait I can see.

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread sparky
Maybe SQS is the issue here have a read: 
http://dataexcursions.wordpress.com/2011/12/15/amazon-sqs-vs-rabbitmq/

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread Michael Hernandez
I have been working with heavy reporting and analytics lately. I would
suggest use thread queuing with many farming threads. I use python thread
but Greenlets it some else should be better
On Apr 21, 2013 5:48 AM, "sparky"  wrote:

> One last thing to add, the task it's self does not seems to be the issue,
> 'got message from broker'  is the 3-4 second wait I can see.
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread Michael Hernandez
Sorry darn phone changed daemon to farming
On Apr 21, 2013 9:39 AM, "Michael Hernandez" <
michael.hernandez1...@gmail.com> wrote:

> I have been working with heavy reporting and analytics lately. I would
> suggest use thread queuing with many farming threads. I use python thread
> but Greenlets it some else should be better
> On Apr 21, 2013 5:48 AM, "sparky"  wrote:
>
>> One last thing to add, the task it's self does not seems to be the issue,
>> 'got message from broker'  is the 3-4 second wait I can see.
>>
>> --
>> 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.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




SQLite database module name???

2013-04-21 Thread Kakar
I am in settings.py and  using SQLite3, but when i run manage.py syncdb it 
tells me: " Value Error: Empty module name." Please help me with this, i 
didn't undesrtood this part.

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




SQLite3 database error!!!

2013-04-21 Thread Kakar
I am in settings.py and using SQLite3. But when i execute manage.py syncdb, 
it gives me error: "Value error: Empty module name" I didn't understood 
this part. Plz help me guyz.

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread Michael Hernandez
you should try to not use Task Dispatching. Rather if you are doing this 
once a day, have a periodic task run every 24 hours. In the same module as 
the thread try doing something like what is at the bottom of this page 
http://docs.python.org/2/library/queue.html . It is a queue thread daemon 
architecture. You will process a 100k in no time at all. Make sure to have 
proper exception handling and recovery however. And as always just use the 
docs to learn from but know there are better ways to go about it and 
improve the threading model.

On Sunday, April 21, 2013 9:40:29 AM UTC-4, Michael Hernandez wrote:
>
> Sorry darn phone changed daemon to farmingn
> On Apr 21, 2013 9:39 AM, "Michael Hernandez" <
> michael.hernandez1...@gmail.com> wrote:
>
>> I have been working with heavy reporting and analytics lately. I would 
>> suggest use thread queuing with many farming threads. I use python thread 
>> but Greenlets it some else should be better
>> On Apr 21, 2013 5:48 AM, "sparky"  wrote:
>>
>>> One last thing to add, the task it's self does not seems to be the 
>>> issue, 'got message from broker'  is the 3-4 second wait I can see.
>>>
>>> -- 
>>> 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.
>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>  

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SQLite database module name???

2013-04-21 Thread yati sagade
Hi Kakar, I can't say what is the problem with your environment with the
little info you have provided, but I feel this question can help you:
http://stackoverflow.com/questions/3384576/problems-setting-up-django-valueerror-empty-module-name
If that does not solve your problem, post the detailed stack-trace and your
settings.py file(with any sensitive info deleted, of course) so we can have
a look.

Cheers


On Sun, Apr 21, 2013 at 7:28 PM, Kakar wrote:

> I am in settings.py and  using SQLite3, but when i run manage.py syncdb it
> tells me: " Value Error: Empty module name." Please help me with this, i
> didn't undesrtood this part.
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Yati Sagade

Software Engineer at mquotient 


Twitter: @yati_itay  | Github:
yati-sagade

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SQLite3 database error!!!

2013-04-21 Thread Brad Pitcher
Can you post the rest of the traceback?
On Apr 21, 2013 7:06 AM, "Kakar"  wrote:

> I am in settings.py and using SQLite3. But when i execute manage.py
> syncdb, it gives me error: "Value error: Empty module name" I didn't
> understood this part. Plz help me guyz.
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How many workers do you run on one machine using django celery?

2013-04-21 Thread Scott Anderson
You can't test a system like this by sending one message: you're just 
testing the latency, not throughput. Latency is the end-to-end time it 
takes for a single message to make its way through the system. Throughput 
is the number of total messages per second that can make their way through. 
As long as your tasks are not sensitive to delays (SMS messages are not, 
generally), a queueing system can help greatly increase the overall 
throughput.

Queueing systems are for spreading work around so they can be completed *in 
aggregate* more quickly and reliably. They're not for reducing the latency 
of a single message.

SQS in particular is architected for massive scale and reliability. To 
achieve this the latency for a single message is very high, but it can 
handle millions and millions of messages per second overall.

If you test with a single thread feeding and a single thread reading (as in 
the amazon-sqs-vs-rabbitmq blog) you're strictly testing queue latency, not 
throughput.

Time taken to process all of the messages will look something like this, 
where:

Nm= number of messages
Ts = SQS latency, or 3 to 4s from your tests
Te = time to process a message for enqueuing
Td = time to process a dequeued task
Ne = number of enqueue workers
Nd = number of dequeue workers

*As long as Ne * Te <= Nd * Td (ie. the enqueue workers can keep up with 
the dequeuing workers)*, the total time to process Nm messages will look 
like this:

Te + Ts + (ceil(Nm / Nd) * Td)

Or: 


You can starve a queueing system on the front as well as the back (which is 
what that blog post does).

So here's a more appropriate test:
Nm = 100,000 messages
Ts = 4s
Te = 20ms, time to ready a message to send
Td = 200ms, time for the task to process a message
Ne = 1 thread putting messages on the queue
Nd = 10 threads pulling messages from the queue

You'll probably find that the entire thing will take this much time:

20ms + 4s + (ceil(100,000 / 10) * 200ms), or just over 2004s.

Up the enqueue threads to 10, and dequeue workers to 100:

20ms + 4s + (ceil(100,000 / 100) * 200ms), or just over 204s.

Note that the SQS latency is a constant, however.

In other words, it will take 3-4 seconds to get a message through the 
queue, and then whatever your task execution time is, all for any 
individual message. But you'll be processing 10 at a time through this 
pipeline. Increase the number of enqueuers and dequeuers and your 
throughput will scale linearly, assuming you spread the workers amongst 
enough EC2 instances to handle the load of the tasks themselves. You're 
trading end-to-end latency for higher throughput.

If you only send 1 message though, it looks like this with 1, 10, and 100 
dequeue workers:

20ms + 4s + (ceil(1 / 1) * 200ms) == 4020ms + (1 * 200ms) == 4.22s
20ms + 4s + (ceil(1 / 10) * 200ms) == 4020ms + (1 * 200ms) == 4.22s
20ms + 4s + (ceil(1 / 100) * 200ms) == 4020ms + (1 * 200ms) == 4.22s

So, at a single message you're testing latency only, not throughput.

For the visual folk out there, in this amazingly well-rendered ASCII 
representation of a parallel communication system each line is a message, 
the distance between Start and End is the latency, and the height of the 
stack is throughput, and the distance from the first start to the last end 
is the amount of time it takes to process all of the messages.

What you tested:

(Start == End)
< 4s >

What you would test with 5 workers enqueuing and dequeuing in parallel:

(Start == End)
 (Start == End)
  (Start == End)
   (Start == End)
(Start == End)
 (Start == End)
<- 4s + N >

Where N is based on the parallel execution time of individual tasks by the 
dequeue workers.

A single RabbitMQ system will have much lower latency but won't be able to 
handle the high aggregate throughput of SQS, and at higher message rates 
will fall behind.

(Start = End)(Start = End)(Start = End)
 (Start = End)(Start = End)(Start = End)
<-->

Obviously this is neither to scale nor truly representative, but hopefully 
it helps to illustrate the point. The takeaway is that the more dequeue 
workers you have, the more overall throughput a system like SQS can give 
you (modulus EC2 time for RabbitMQ vs. SQS costs, which is a completely 
different discussion).

That said if you feel like maintaining your own RabbitMQ cluster with the 
maintenance that it would entail, for lower message throughputs RabbitMQ 
may be cheaper for the same throughput.

Regards,
-scott

On Sunday, April 21, 2013 5:47:40 AM UTC-4, sparky wrote:
>
> One last thing to add, the task it's self does not seems to be the issue, 
> 'got message from broker'  is the 3-4 second wait I can see.
>

-- 
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: How many workers do you run on one machine using django celery?

2013-04-21 Thread sparky
wow, some good advice here thanks. I tested with RabbitMQ and its fast, all 
I can say is it seems to be SQS. My advice don't use it!

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django 1.5 not getting css

2013-04-21 Thread Carlos Aboim
Hi everyone.

Anybody can tell me why I can get css on my flatpage /home/ ?

http://dpaste.com/hold/1066757/  ->   this is the html of the page

http://dpaste.com/hold/1067747/  ---> this is the css styles 

http://dpaste.com/hold/1066760/   -->settings.py  

http://s22.postimg.org/78tbfibzl/Picture_2.png   -->  folder estruture

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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.5 not getting css

2013-04-21 Thread Rainy


On Sunday, April 21, 2013 11:18:22 AM UTC-4, Carlos Aboim wrote:
>
> Hi everyone.
>
> Anybody can tell me why I can get css on my flatpage /home/ ?
>
> http://dpaste.com/hold/1066757/  ->   this is the html of the page
>
> http://dpaste.com/hold/1067747/  ---> this is the css styles 
>
> http://dpaste.com/hold/1066760/   -->settings.py  
>
> http://s22.postimg.org/78tbfibzl/Picture_2.png   -->  folder estruture
>
> thank you
>


Comments above STATIC_ROOT explain what it should be set to.  -ak 

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




error and django forms

2013-04-21 Thread vijay shanker
hi

i have a django form like this:

class AddArtistForm(forms.Form):
fname = forms.CharField()
lname = forms.CharField()
profession = forms.CharField()
dob  = forms.DateField()

i want to display errors as this
  {% for field in form %}
{{field}}
#  error associated with above field
{% endfor %}

i want to know how can i get error message with associated field if i want 
to loop over forms field. 
thanks
   




 fields error if its not valid

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: error and django forms

2013-04-21 Thread Jesús Lucas Flores
You can get the errors of a field:


{% for field in form %}
{{field}}
{% for error in field.errors %}
 {{ error }}
  {% endfor %}
{% endfor %}




2013/4/21 vijay shanker 

> hi
>
> i have a django form like this:
>
> class AddArtistForm(forms.Form):
> fname = forms.CharField()
> lname = forms.CharField()
> profession = forms.CharField()
> dob  = forms.DateField()
>
> i want to display errors as this
>   {% for field in form %}
> {{field}}
> #  error associated with above field
> {% endfor %}
>
> i want to know how can i get error message with associated field if i want
> to loop over forms field.
> thanks
>
>
>
>
>
>  fields error if its not valid
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
-

Jesús Lucas Flores
*Administrador de Sistemas y Programador Web*
*PortfolioJLucas.LibreSysTeam.com *
*Blog:   jesuslucas.com*
Twitter: @jelukas89 
-

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Aggregate on part of a date field?

2013-04-21 Thread dan
Please do not license your code with GPL.

On Thursday, September 9, 2010 12:38:19 AM UTC+2, sebastien piquemal wrote:
>
> I created a library to address this kind of problems : 
> http://code.google.com/p/django-cube/ 
>
> It bases the aggregation on a multidimensional view of your data (a 
> cube), so basically you can group_by in any way you want ("any way you 
> want" = "on all the dimensions that you want", so you have to declare 
> a cube and its dimensions). 
>
> Furthermore, if I understood your query, you want to group by  year> (which is not possible in Django yet), and this is something I 
> implemented in "django-cube". 
>
> However, the fact that it is based on something that you have to 
> declare (in a very similar fashion to declaring Django models), 
> introduces a small overhead, which means that it might not be a good 
> solution if you are not going to calculate more aggregations than this 
> single one with it (it was originally meant for data visualization 
> purposes). 
>
> This is still beta, and the documentation is unclear, so if you want 
> to use it, feel free to ask me any question. 
>
> Yours, 
>
> Sébastien 
>
>
> On Sep 7, 6:51 pm, Don  wrote: 
> > I need to create a query that aggregates values by the year of a date 
> > field. I have not been able to discover a way to do this yet, perhaps 
> > someone can help. I can issue the following raw query, which gives the 
> > results I want: 
> > 
> > cursor.execute("""SELECT year(oac_date) as year, month(oac_date) as 
> > month, sum(oac_actualconsumption) as consumption 
> >  FROM actualconsumption 
> > WHERE oac_object = %s AND oac_commodity = %s AND 
> > year(oac_date) = %s 
> > GROUP BY year(oac_date), month(oac_date) 
> > ORDER BY month(oac_date)""", [object_id, commodity, year]) 
> > 
> > Where oac_object is the pk for the table. 
> > 
> > This summarizes the oac_actualconsumption by year. Does anyone have an 
> > idea how to do this without resorting to a raw query? I have not been 
> > able to get the aggregates to work over parts of a date field in the 
> > database, only on the whole field. 
> > 
> > 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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: error and django forms

2013-04-21 Thread vijay shanker


On Sunday, April 21, 2013 10:58:47 PM UTC+5:30, vijay shanker wrote:
>
> hi
>
> i have a django form like this:
>
> class AddArtistForm(forms.Form):
> fname = forms.CharField()
> lname = forms.CharField()
> profession = forms.CharField()
> dob  = forms.DateField()
>
> i want to display errors as this
>   {% for field in form %}
> {{field}}
> #  error associated with above field
> {% endfor %}
>
> i want to know how can i get error message with associated field if i want 
> to loop over forms field. 
> thanks
>
 

> introspecting fields it doesn have errors attribute, so this cnat be it   
> 
> >>> 
> dir(addform.fields['fname'])
>
 

> ['__class__', '__deepcopy__', '__delattr__', '__dict__', '__doc__', 
> '__format__', '__getattribute__', '__hash__', '__init__', '__module__', 
> '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
> '__sizeof__', '__slotnames__', '__str__', '__subclasshook__', 
> '__weakref__', 'bound_data', 'clean', 'creation_counter', 
> 'default_error_messages', 'default_validators', 'error_messages', 
> 'help_text', 'hidden_widget', 'initial', 'label', 'localize', 'max_length', 
> 'min_length', 'prepare_value', 'required', 'run_validators', 
> 'show_hidden_initial', 'to_python', 'validate', 'validators', 'widget', 
> 'widget_attrs' 
>  fields 
> error if its not valid
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: error and django forms

2013-04-21 Thread Vijay Shanker
yess that does it.
thanks


On Sun, Apr 21, 2013 at 11:57 PM, vijay shanker  wrote:

>
>
> On Sunday, April 21, 2013 10:58:47 PM UTC+5:30, vijay shanker wrote:
>>
>> hi
>>
>> i have a django form like this:
>>
>> class AddArtistForm(forms.Form):
>> fname = forms.CharField()
>> lname = forms.CharField()
>> profession = forms.CharField()
>> dob  = forms.DateField()
>>
>> i want to display errors as this
>>   {% for field in form %}
>> {{field}}
>> #  error associated with above field
>> {% endfor %}
>>
>> i want to know how can i get error message with associated field if i
>> want to loop over forms field.
>> thanks
>>
>
>
>> introspecting fields it doesn have errors attribute, so this cnat be it
>>
>> >>>
>> dir(addform.fields['fname'])
>>
>
>
>> ['__class__', '__deepcopy__', '__delattr__', '__dict__', '__doc__',
>> '__format__', '__getattribute__', '__hash__', '__init__', '__module__',
>> '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
>> '__sizeof__', '__slotnames__', '__str__', '__subclasshook__',
>> '__weakref__', 'bound_data', 'clean', 'creation_counter',
>> 'default_error_messages', 'default_validators', 'error_messages',
>> 'help_text', 'hidden_widget', 'initial', 'label', 'localize', 'max_length',
>> 'min_length', 'prepare_value', 'required', 'run_validators',
>> 'show_hidden_initial', 'to_python', 'validate', 'validators', 'widget',
>> 'widget_attrs'
>>  fields
>> error if its not valid
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/RvJXXj-Yb2A/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to link different kinds of objects?

2013-04-21 Thread Bastian
Hi group,

In a Django project I would like to create feeds of objects (could be text like 
in twitter or other kind of content, don't know yet, not relevant anyway). Each 
user could create new feeds and each user could also create new objects to put 
in those feeds. I am thinking about creating 2 simple models, one for the feeds 
and one for the objects. And I would like to be able to link any object to one 
or more feeds so a feed would display that object if it is linked to it. Maybe 
the word 'link' is misused here but I think you understand my point. Just an 
example to make it clear: a user could create a feed for posting thoughts about 
Django and decide that some of these thoughts would fit well in another feed 
about coding. How could I do it on the database level?
I don't know what is the best approach for this. The contenttypes framework 
maybe?

Thanks for your light!
Bastian

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: logging within celery processes

2013-04-21 Thread Ask Solem


On Sunday, April 21, 2013 5:51:06 AM UTC+1, Mike wrote:
>
> I'm trying to get logging to work from within my celery process.  I have 
> set:
> CELERY_SEND_TASK_ERROR_EMAILS = True
> in settings.py
>
> within the process I am logging to level INFO:
>
> logger.info('some info')
>
> I launch the process using supervisor:
>
> python manage.py celery worker --loglevel=ERROR
>
> The problem is, I'm getting emails from the INFO level messages even 
> though I specified ERROR on the command line.  Is this a bug?
>


CELERY_SEND_TASK_ERROR_EMAIL is not connected to logging,
so if you receive "some info" by mail, then it's not being sent by celery, 
you must
have configured something else to send that mail!

 

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to link different kinds of objects?

2013-04-21 Thread Bastian
In the mean time I will try with a many to many field. That's probably more 
than enough. 

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




css for flatpages

2013-04-21 Thread Carlos Aboim
Hi

tell me, where should live css files for flatpages,
these need a special folder for server to find them as for apps for example?

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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to link different kinds of objects?

2013-04-21 Thread Avraham Serour
If I could understand you right, a m2m field is exactly what you are
describing. an object may belong to one or more feeds.
Feed an object have an relation, The question if an object have to belong
to a feed or not necessarily? does an object always have a related feed?
does a feed always have a related object?


On Sun, Apr 21, 2013 at 11:42 PM, Bastian wrote:

> In the mean time I will try with a many to many field. That's probably
> more than enough.
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: css for flatpages

2013-04-21 Thread Michael Hernandez
Sorry what do you mean by flat. Do you mean that they dont import css files 
into them. As in mobile optimized? You would just create file in a 
templates directory and include it in any flat pages. It would be fully 
rendered on the server side, and no extra browser calls to grab the files.

On Sunday, April 21, 2013 4:53:40 PM UTC-4, Carlos Aboim wrote:
>
> Hi
>
> tell me, where should live css files for flatpages,
> these need a special folder for server to find them as for apps for 
> example?
>
> 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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Need good image on the fly resizing

2013-04-21 Thread frocco
Can someone point me to a good package?

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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: IDE to practice django template language

2013-04-21 Thread frocco
PyCharm is what I use and recommend.

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.5 not getting css

2013-04-21 Thread Carlos Aboim
ok I understand that, but I am using the development server.

any other clues?
thanks

Domingo, 21 de Abril de 2013 17:44:46 UTC+1, Rainy escreveu:
>
>
>
> On Sunday, April 21, 2013 11:18:22 AM UTC-4, Carlos Aboim wrote:
>>
>> Hi everyone.
>>
>> Anybody can tell me why I can get css on my flatpage /home/ ?
>>
>> http://dpaste.com/hold/1066757/  ->   this is the html of the page
>>
>> http://dpaste.com/hold/1067747/  ---> this is the css styles 
>>
>> http://dpaste.com/hold/1066760/   -->settings.py  
>>
>> http://s22.postimg.org/78tbfibzl/Picture_2.png   -->  folder 
>> estruture
>>
>> thank you
>>
>
>
> Comments above STATIC_ROOT explain what it should be set to.  -ak 
>

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




a wired problem with Debug for django1.5.1

2013-04-21 Thread liu li
Hi 

When Debug = False, all of things are working fine,

when Debug = True, browser got an error with 500

so do you know why?

I am using nginx to handle all of static files like css,img 

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




debugging with pycharm

2013-04-21 Thread Mark Lybrand
I can't get PyCharm to break at breakpoints when debugging a django app.
what is the magic incantation i neec to invoke to make this happen
regardless of where i am in code (views, urls, models, templates, etc)

-- 
Mark :)

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Need good image on the fly resizing

2013-04-21 Thread yati sagade
Check PIL out:
http://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio


On Mon, Apr 22, 2013 at 6:05 AM, frocco  wrote:

> Can someone point me to a good package?
>
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Yati Sagade

Software Engineer at mquotient 


Twitter: @yati_itay  | Github:
yati-sagade

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869

-- 
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




password_change redirect to user profile page

2013-04-21 Thread Nora Olsen
Hi,

I have the following urlConf for password change:

 url(r'^users/(?P\d+)/$', UserProfile.as_view(), name='user_profile'),
 url(r'^password_change/$', auth_views.password_change, 
name='password_change'),

I can't figure out to redirect to the user profile page by using 
post_change_redirect?

Do I have to create an intermediate view and then do another 
HttpResponseRedirect 
in that view?

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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.