Re: very light weight django task queues

2014-04-06 Thread Russell Keith-Magee
Hi,

Another option to throw onto the pile:

https://github.com/bretth/django-pq

This was recommended to me by Jannis Leidel (jezdez), who used it on
caniusepython3.com.

Yours,
Russ Magee %-)



On Sun, Apr 6, 2014 at 6:33 PM, TinyJaguar  wrote:

> I've been using both django-huey and celery as task queues with varying
> success in other projects.
> see (https://www.djangopackages.com/grids/g/workers-queues-tasks/)
>
> Most of the task queues are redis based. They seem to be overkill for our
> current situation and add another layer of system maintenance (i.e a redis
> instance) and we want/need to have a minimum of packages on our micro
> instances (currently just django, postgres, nginx and a few tiny packages)
>
> Our typical background tasks occur once or twice a week! and may take
> about 30 minutes to a few hours to process.
> What I'm looking for is a very very simple task queue that does not use
> redis or any other 'external' database. Just a bunch of tables in the
> current app's database would be fine.
>
> what would you suggest?
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/22067995-cdb5-42ed-bb9e-4d8a80b2fc4d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84_QqCSgyFShDec2%3Dx_NE1YXAPaz0Dx36RTkzx7QCzaM%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving forms with ManyToMany relationships

2014-04-06 Thread Camilo Torres
On Saturday, April 5, 2014 10:12:36 PM UTC-4:30, Jason S wrote:
>
> I've seen quite a few examples showing various ways to create a form using 
> manytomany relationships and save the data, but i'm still missing a key 
> piece of the puzzle.
> I've created a form and it "works", meaning the form creates a new Item 
> object and associates the user.
> However i'm not sure how to go about saving the item category and item 
> components selected in the form.
>
> I've tried quite a few things over the last week and i know its quite 
> easy, but just haven't quite gotten there yet and would appreciate some 
> guidance.
>
> FORM:
> class NewItemForm(ModelForm):
>
> class Meta:
> model = Item
> fields = ('name', 'desc', 'img','category','components')
>
> def save(self, user, component commit = True):
> """Append the component list to the item"""
> new_item = super(NewItemForm, self).save(commit = Fals
>
> if commit:
> new_item.save()
> #new_item.save_m2m()
> new_item.user.add(user)
> if component != "none":
> new_item.category.add(new_item)
> new_item.components.add(new_item)
>
> return new_item
>
> VIEW:
> def create_item(request):
>
> if request.method == "POST":
> form = NewItemForm(request.POST, instance=item())
> if form.is_valid():
> form.save(request.user, "none")
> return HttpResponseRedirect(reverse('nav.views.dashboard'))
> else:
> form = CategoryForm(instance=item())
> return render_to_response('objects/create_item.html', 
> {'item_Form': form}, context_instance=RequestContext(request))
>
> MODEL:
> class Item(models.Model):
> # 
> def __unicode__(self):  # Python 3: def __str__(self):
> return self.name
>
> name  = models.CharField(max_length=32)
> desc  = models.CharField(max_length=254)
> img   = models.CharField(max_length=32)
> user  = models.ManyToManyField(User) 
> components = models.ManyToManyField(component)
> category  = models.ManyToManyField(Category)
>
Hello,

1. This code does not compiles, only to note in case you already didn't 
tested

2. In your view: why do you instantiate a different form for POST request 
and any other kind of requests: NewItemForm in one case, CategoryForm in 
the rest.

3. In your view: You are using the string "none" instead the built-in None. 
I recommend you to use Python built-in None.

4. ModelForm's save method actually saves the related many to many data. 
Why are you doing these?
new_item.category.add(new_item)
new_item.components.add(new_item)

You are adding a Item where a component and a Category is expected. This 
does not make sense. You add(new_item) where you should be add(component()) 
or something.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bede4d94-15c7-40ff-a8ca-f2dfb642f50f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error with GeoDjango serializer and ForeignKey field

2014-04-06 Thread Jorge Arevalo
(Sorry for the cross posting. I'm not sure about the best place to put my 
question. So, I put it in StackOverflow too. And I know that a post that 
contains just a link to another page can be considered spam. So, I C the 
content here)

I have a problem with *Django 1.5.4*. I put the question in StackOverflow 
instead ofhttp://gis.stackexchange.com/ because I'm almost 100% sure is not 
a GIS related problem.

Here is my set up:

My *models.py*

from django.contrib.auth.models import Userfrom django.contrib.gis.db import 
models as gismodels
# This models a region of interest, using a polygonclass ROI(gismodels.Model):
label = models.CharField(max_length=256, default='ROI')
area = models.FloatField(default=0.0)
geom = gismodels.PolygonField(srid=4326)
when = models.DateTimeField(default=datetime.now())
user = models.ForeignKey(User, null=True)

objects = gismodels.GeoManager()

def __unicode__(self):
return unicode(self.label)

class Meta:
ordering = ['when']

class Indicator(models.Model):
name = models.TextField()
color = models.TextField()
measurement_units = models.CharField(max_length=100)
algorithm = models.CharField(max_length=256)
data_origin = models.TextField()

class Series(models.Model):
roi = models.ForeignKey(ROI)
indicator = models.ForeignKey(Indicator)

As you can see, *Series model contains a reference to ROI model*

My *settings.py*

SERIALIZATION_MODULES = {
'geojson': 'djgeojson.serializers'}

I'm using django-geojson 
 to *serialize my ROI objects into GeoJSON*. I want to use this serializer 
to send a GeoJSON to my clients. So, my views.py looks like this

My *views.py*

@login_requireddef get_rois(request):
rois_query = ROI.objects.filter(user=request.user)

polygons = json.loads(serializers.serialize('geojson', rois_query))

return HttpResponse(json.dumps(polygons), mimetype='application/json')

The problem: *I'm getting this error in serialize call*

AttributeError: 'ROI' object has no attribute 'roi'

The *relevant part of the error stack* is this

File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/serializers/__init__.py",
 line 122, in serialize
s.serialize(queryset, **options)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 349, in serialize
self.serialize_queryset(queryset)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 321, in serialize_queryset
self.handle_reverse_field(obj, field, field_name)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 243, in handle_reverse_field
values = [reverse_value(related) for related in getattr(obj, 
field_name).iterator()]

Looking at the stack, looks like there's a problem resolving the *reverse 
reference* of ROI to Series. Series has a roi field pointing to ROI, and I 
think the serializer thinks the roi field belongs to ROI class (incorrect) 
instead of to Series (correct). The expression *infinite loop* comes to my 
mind.

Besides, *if I delete the roi field from Series model class, it works*

I'm not sure about if it's a bug of django-geojson plugin (using the last 
version) or something wrong with my code (most likely). I've tried with the 
default json serializer, and still getting the same error. And also tried 
to inherit all model classes from gismodels instead of models. No effect.

Any clues?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0a7a029-c1c6-4b1d-8901-90efde84e72e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django - How to add inline object to the parent object via shell command or scripts

2014-04-06 Thread H. Pham
Apr 5

Daniel, Thank you very much for your response.  I have been reading the 
tutorial and practicing.  This is my practicing project.

With your help, I make a couple adjustments and have it working.

Thanks again,

On Saturday, April 5, 2014 12:07:00 PM UTC-4, Daniel Roseman wrote:
>
> On Saturday, 5 April 2014 09:21:38 UTC+1, H. Pham wrote:
>>
>> I am trying to learn how to use Django. 
>>
>
> Then you should read the tutorial. 
>
>  
>
>> I created 2 very simple models:
>>
>> models.py
>>
>> class Course(models.Model):
>> name = models.CharField(max_length=100)
>> instructor = models.CharField(max_length=100)
>>
>> student = models.ForeignKey('Student', null=True, blank=True)
>>
>
> This is wrong. This means each course can only have one student. The 
> ForeignKey should be on Student, pointing to Course. Or, more likely, you 
> should have a ManyToManyField, since Courses can have many students, and 
> Students can have many classes.
>  
>
>> def __str__(self):
>> return (self.name)
>>
>> class Student(models.Model):
>> name = models.CharField(max_length=100)
>> courses = RelatedObjectsDescriptor()
>>
>
> Is this from the genericm2m project? If so, you should say so. But there's 
> no need for it here: a simple ManyToManyField is what you need.
>  
>
>> def __str__(self):
>> return (self.name)
>>
>> forms.py
>>
>
>> class CourseInline(admin.TabularInline):
>> model = Course
>> form = CourseForm
>> extra = 3
>>
>> class StudentAdmin(admin.ModelAdmin):
>> form = StudentForm
>> search_fields = ('name', )
>> fields = ('name', )
>> ordering = ('name',)
>>
>> inlines = [CourseInline]
>>  
>> admin.site.register(Student, StudentAdmin)
>>
>
> This stuff should be in admin.py
>  
>
>>  
>
>> with this setup, I can add student then add courses to the student.
>>
>> What I am trying to do is to use script to enter the known records:
>>
>> student = Student(name 
>> ='student1') 
>>
>> - This work
>> course = Course(name='Math101", instructor="Smith", 
>> student=student)- This work, but when I view the student 
>> record via admin page, the course does not show up as an inline object
>>
>>
> You've confused yourself by trying to use that genericm2m project. Stick 
> to the standard classes for now.
>
> course = Course.objects.create(name="math101', instructor='Smith')
> course.students.add(student)
>
> This is all well covered in the tutorial, which you should read rather 
> than relying on random blog posts.
>
> --
> DR. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09df3180-5dfa-4495-bb33-8209ae0c8dc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: very light weight django task queues

2014-04-06 Thread Arnold Krille
On Sun, 6 Apr 2014 03:33:30 -0700 (PDT) TinyJaguar
 wrote:
> I've been using both django-huey and celery as task queues with
> varying success in other projects.
> see (https://www.djangopackages.com/grids/g/workers-queues-tasks/) 
> 
> Most of the task queues are redis based. They seem to be overkill for
> our current situation and add another layer of system maintenance
> (i.e a redis instance) and we want/need to have a minimum of packages
> on our micro instances (currently just django, postgres, nginx and a
> few tiny packages)
> 
> Our typical background tasks occur once or twice a week! and may take
> about 30 minutes to a few hours to process.
> What I'm looking for is a very very simple task queue that does not
> use redis or any other 'external' database. Just a bunch of tables in
> the current app's database would be fine.
> 
> what would you suggest?

django-extensions allows to define scripts for
cron.[hourly|daily|weekly], you just have to make cron call them.

But that assumes that your tasks don't have to run asap after being
scheduled.

- Arnold


signature.asc
Description: PGP signature


Re: if statement in django

2014-04-06 Thread Keith Edmiston
It appears that you might have an indentation problem within the else:
statement of calc_total_price function.


On Sun, Apr 6, 2014 at 12:57 AM, Anthony Smith
wrote:

> thanks now  but getting the following error
>
> File "/home/tony/Documents/stockapp/stock/models.py" in save
>   128. self.total_price = self.calc_total_price()
> File "/home/tony/Documents/stockapp/stock/models.py" in calc_total_price
>   124. amount_price = (self.estimated_total_weight * self.sale_kg)
>
> have attached the code if you have time if not dont worry
>
> def calc_estimated_total_weight(self):
> amount = 0
> if self.sale_head <= 0:
> amount = (self.number * self.estimated_weight_hd)
> return amount
>  def save(self):
> self.estimated_total_weight = self.calc_estimated_total_weight()
> super(SaleNote, self).save()
>
> def calc_total_price(self):
> amount_price = 0
> if self.sale_head > 0:
>amount_price = (self.number * self.sale_head)
>return amount_price
> else:
>  amount_price = (self.estimated_total_weight * self.sale_kg)
> return amount_price
>
> def save(self):
> self.total_price = self.calc_total_price()
> super(SaleNote, self).save()
>
>  def __unicode__(self):
> return self.buyer
>
> cheers
>
> anthony
>
>
> On Sun, Apr 6, 2014 at 3:20 PM, Jay Lozier  wrote:
>
>>
>> On 04/05/2014 11:08 PM, Anthony Smith wrote:
>>
>>> Hi
>>>
>>>
>>>
>>> I have a small project and I have been unable to get the following
>>> statement to work. Any help would great.User inputs can either
>>> self_sale_head which is a $ value,if a $ value is not add a
>>> self.estimated_weight_hd is used to get the total weight, the code below
>>> should return a estimated_weight_total which can be used for the total sale
>>> price. All works when I add the estimated_weight_total manually. I am lost
>>> as why.
>>>
>>> |def  calc_estimated_weight_total(self):
>>>  if  self.sale_head<=  0:
>>>  amount=  (self.number*  self.estimated_weight_hd)
>>>  return  amount
>>>
>>> def  save(self):
>>>  self.estimated_total_weight=  self.calc_estimated_weight_total()
>>>  super(SaleNote,  self).save()|
>>>
>>>
>>>
>>>  Anthony,
>>
>> In your first function, when the if condition evaluates to False it not
>> return anything.
>>
>> A possible version is:
>>
>> def calc_estimated_weight_total(self):
>> if self.sale_head <= 0:
>> amount = self.number * self.estimated_weight_hd
>> else:
>> amount = 0  # (or your default value or other code to calculate
>> amount)
>> return amount
>>
>> Another version
>>
>> def calc_estimated_weight_total(self):
>> amount = 0
>> if self.sale_head <= 0:
>> amount = self.number * self.estimated_weight_hd
>> return amount
>>
>> Both versions will return a value not matter whether the test condition
>> evaluates to True or False. The second version assumes the default value is
>> 0
>>
>>
>> --
>> Jay Lozier
>> jsloz...@gmail.com
>>
>> --
>> 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/irveWPRuvCY/unsubscribe.
>> 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.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/5340E423.2070700%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACJNqTXNbBvLnJAJZ%3DOiDt4npqwvfgHeU4YDX1KZ6Ajp02WRyg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Keith Edmiston
(512)970-7222

-- 
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.
To view this discussion on the web visit 

Re: very light weight django task queues

2014-04-06 Thread Derek
Maybe have a look at these ideas:

http://themattreid.com/wordpress/2011/01/20/simple-python-a-job-queue-with-threading/

https://www.jeffknupp.com/blog/2014/02/11/a-celerylike-python-task-queue-in-55-lines-of-code/


On Sunday, 6 April 2014 12:33:30 UTC+2, TinyJaguar wrote:
>
> I've been using both django-huey and celery as task queues with varying 
> success in other projects.
> see (https://www.djangopackages.com/grids/g/workers-queues-tasks/) 
>
> Most of the task queues are redis based. They seem to be overkill for our 
> current situation and add another layer of system maintenance (i.e a redis 
> instance) and we want/need to have a minimum of packages on our micro 
> instances (currently just django, postgres, nginx and a few tiny packages)
>
> Our typical background tasks occur once or twice a week! and may take 
> about 30 minutes to a few hours to process.
> What I'm looking for is a very very simple task queue that does not use 
> redis or any other 'external' database. Just a bunch of tables in the 
> current app's database would be fine.
>
> what would you suggest?
>
>  
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d26a19c8-cd4d-49f8-a98f-9206cef00ae8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


very light weight django task queues

2014-04-06 Thread esatterwh...@wi.rr.com
Django ztask is a pretty good solution for what you are describing 

https://github.com/dmgctrl/django-ztask

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0dff7d7c-f5dc-411a-9f14-0b8e1e5df11d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add poll to the django tutorial polls

2014-04-06 Thread Camilo Torres
On Saturday, April 5, 2014 8:13:04 AM UTC-4:30, Christo bale wrote:
>
> I would like to make it possible to add a poll on the index.html, so one 
> don't need the admin. 
> I added a forms.py.
> Right now when I click enter after typing the new poll, the sites goes 
> blank and I need to refresh it. And no polls have been added. I am pretty 
> new to django, so I hope that you can help me.  
>
> forms.py
> class ComposePoll(forms.ModelForm):
> class Meta:
> fieldsets = [
> (None,   {'fields': ['question']}),
> ('Date information', {'fields': ['pub_date'], 'classes': 
> ['collapse']}), 
> ]
>
> index.html
>
>  {% csrf_token %}
> {{ form.add_poll }}
> 
> 
>
> views.py
> class IndexView(generic.ListView):
> template_name = 'polls/index.html'
> context_object_name = 'latest_poll_list'
>
> def get_queryset(self):
> """
> Return the last five published polls (not including those set to be
> published in the future).
> """
> return Poll.objects.filter(
> pub_date__lte=timezone.now()
> ).order_by('-pub_date')[:5]
> 
> add_poll = ComposePoll(request.POST or None)
> if add_poll.is_valid():
> create_poll = Poll.save(commit=False)
> create_poll.sent = datetime.datetime.now()
> create_poll.save()
> return HttpResponseRedirect('/polls/')
> 
> poll = Poll.objects.filter()
> 
> return render_to_response('polls/index.html', locals(), 
> context_instance=RequestContext(request))
>
Hello,

You should add a 'post' method to your view to get the data from the form 
and store it in your models.

Regards,

Camilo.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ce00fee-daf9-498e-b502-46c68b62f95d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


very light weight django task queues

2014-04-06 Thread TinyJaguar
I've been using both django-huey and celery as task queues with varying 
success in other projects.
see (https://www.djangopackages.com/grids/g/workers-queues-tasks/) 

Most of the task queues are redis based. They seem to be overkill for our 
current situation and add another layer of system maintenance (i.e a redis 
instance) and we want/need to have a minimum of packages on our micro 
instances (currently just django, postgres, nginx and a few tiny packages)

Our typical background tasks occur once or twice a week! and may take about 
30 minutes to a few hours to process.
What I'm looking for is a very very simple task queue that does not use 
redis or any other 'external' database. Just a bunch of tables in the 
current app's database would be fine.

what would you suggest?

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22067995-cdb5-42ed-bb9e-4d8a80b2fc4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MultiValueDictKeyError in Admin on Save - after updating to Django 1.6.2 from 1.5.5

2014-04-06 Thread Mike Dewhirst
Looking through the 1.6 release notes I couldn't see anything obvious 
but I tried putting select_on_save = True in the meta options for all 
the models but that made no discernable difference.


There appears to be lots of different ways to get this error if closed 
tickets and admin template tweaks revealed by google are anything to go 
by eg., 
http://stackoverflow.com/questions/19741314/multivaluedictkeyerror-in-django-admin


Does anyone have any advice?

Thanks

Mike

Environment:


Request Method: POST
Request URL: http://localhost:8000/admin/substance/substance/17/

Django Version: 1.6.2
Python Version: 2.7.6
Installed Applications:
(u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.messages',
 u'django.contrib.admin',
 u'django.contrib.admindocs',
 u'django.contrib.staticfiles',
 u'common',
 u'company',
 u'workplace',
 u'substance')
Installed Middleware:
(u'django.middleware.cache.UpdateCacheMiddleware',
 u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.locale.LocaleMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.transaction.TransactionMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.doc.XViewMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'django.middleware.cache.FetchFromCacheMiddleware')


Traceback:
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\core\handlers\base.py" 
in get_response
  114. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\contrib\admin\options.py" 
in wrapper
  432. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\decorators.py" in 
_wrapped_view

  99. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\views\decorators\cache.py" 
in _wrapped_view_func

  52. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\contrib\admin\sites.py" 
in inner

  198. return view(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\decorators.py" in 
_wrapper

  29. return bound_func(*args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\decorators.py" in 
_wrapped_view

  99. response = view_func(request, *args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\decorators.py" in 
bound_func

  25. return func(self, *args2, **kwargs2)
File "C:\Users\mike\env\xxdx\lib\site-packages\django\db\transaction.py" 
in inner

  339. return func(*args, **kwargs)
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\contrib\admin\options.py" 
in change_view

  1229. if all_valid(formsets) and form_validated:
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\formsets.py" 
in all_valid

  415. if not formset.is_valid():
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\formsets.py" 
in is_valid

  292. err = self.errors
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\formsets.py" 
in errors

  267. self.full_clean()
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\formsets.py" 
in full_clean

  314. form = self.forms[i]
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\functional.py" in 
__get__
  49. res = instance.__dict__[self.func.__name__] = 
self.func(instance)
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\formsets.py" 
in forms
  133. forms = [self._construct_form(i) for i in 
xrange(self.total_form_count())]
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\models.py" 
in _construct_form
  848. form = super(BaseInlineFormSet, self)._construct_form(i, 
**kwargs)
File "C:\Users\mike\env\xxdx\lib\site-packages\django\forms\models.py" 
in _construct_form

  564. pk = self.data[pk_key]
File 
"C:\Users\mike\env\xxdx\lib\site-packages\django\utils\datastructures.py" in 
__getitem__

  301. raise MultiValueDictKeyError(repr(key))

Exception Type: MultiValueDictKeyError at /admin/substance/substance/17/
Exception Value: "u'uses-0-id'"

--
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.
To view this discussion on the web visit