Re: django Object not iterable error

2015-06-15 Thread Shekar Tippur
> > Thank you! Thank you! Thank you! Sometimes I miss the most obvious things. Thanks again. - Shekar -- 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: Add multiple objects of same model at the same time in admin

2015-06-15 Thread Robin Lery
Thank you. On Mon, Jun 15, 2015 at 10:37 PM, carlos wrote: > Hello, use two model and the second model inline one model example > > class ModelA(...): > name = charfield(...) > > class ModelB(): > fk(ModelA) >image = imagefiel(...) >caption = bla bla

Re: django Object not iterable error

2015-06-15 Thread James Schneider
That is what I meant, but the extra code is quite helpful. In your urls.py file you have this: url(r'^product/$', productviews, productviews.ProductList.as_view()), when you probably want this: url(r'^product/$', productviews.ProductList.as_view()), You have an extra reference to

Re: django Object not iterable error

2015-06-15 Thread Shekar Tippur
Here my urls.py urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^product/$', productviews, productviews.ProductList.as_view()), url(r'^product/(?P[0-9]+)$', productviews.ProductDetail.as_view()), ] *productviews.py* from product.models import Product from

Re: django Object not iterable error

2015-06-15 Thread Vijay Khemlani
No, you need to post the parts of your code that may have triggered the error. In this case, your urls.py and the method in your views.py that handles the request probably. On Mon, Jun 15, 2015 at 9:32 PM, Shekar Tippur wrote: > James, > > Is this what you mean? > > - Shekar

Re: django Object not iterable error

2015-06-15 Thread Shekar Tippur
James, Is this what you mean? - Shekar > Environment:Request Method: POSTRequest URL: > http://127.0.0.1:8000/product/Django Version: 1.8.2Python Version: > 3.4.3Installed Applications:('django.contrib.admin', 'django.contrib.auth', > 'django.contrib.contenttypes',

Re: django Object not iterable error

2015-06-15 Thread James Schneider
Can you post the entire stack trace? You may have to run a bit up the chain in the race to track down the problem. -James On Jun 15, 2015 2:40 PM, "Shekar Tippur" wrote: > > > > Hello, > > This maybe a generic question. How do I troubleshoot something like this. > The

Re: Django plugin

2015-06-15 Thread Mario Gudelj
You can use celery and periodic tasks to scan for new orders every 5 minutes and send email notification of the new order is there. On 12 Jun 2015 6:59 pm, "'Tom Evans' via Django users" < django-users@googlegroups.com> wrote: > On Thu, Jun 11, 2015 at 8:02 PM, Andreas Kuhne >

django Object not iterable error

2015-06-15 Thread Shekar Tippur
Hello, This maybe a generic question. How do I troubleshoot something like this. The stacktrace is not really helpful as it does not point to the code that is causing this issue. TypeError at /product/ 'function' object is not iterable Request Method:POSTRequest

Re: Add multiple objects of same model at the same time in admin

2015-06-15 Thread carlos
Hello, use two model and the second model inline one model example class ModelA(...): name = charfield(...) class ModelB(): fk(ModelA) image = imagefiel(...) caption = bla bla bla date = datefield and them in admin.py class ModelBInline(admin.TabularInline): model =

Re: Get the first image src from a post

2015-06-15 Thread Robert librado
very nice work On 6/15/15, Vijay Khemlani wrote: > If the description is stored as HTML I guess you could use something like > BeautifulSoup or pyquery to parse it and find the tag > > from bs4 import BeautifulSoup > > soup = BeautifulSoup(blog.description) > image_src =

Re: Squashed migration

2015-06-15 Thread aRkadeFR
Great. Thanks for the feedback :) On 06/15/2015 02:18 PM, Cherie Pun wrote: Hi, So the original problem was that I was running in the repo which didn't have the squashed migration. Django does know when to switch to the squashed migrations when you have both squashed and unsquashed

Re: Get the first image src from a post

2015-06-15 Thread Vijay Khemlani
If the description is stored as HTML I guess you could use something like BeautifulSoup or pyquery to parse it and find the tag from bs4 import BeautifulSoup soup = BeautifulSoup(blog.description) image_src = soup.find('img')['src'] On Mon, Jun 15, 2015 at 8:59 AM, Robin Lery

Re: Squashed migration

2015-06-15 Thread Cherie Pun
Hi, So the original problem was that I was running in the repo which didn't have the squashed migration. Django does know when to switch to the squashed migrations when you have both squashed and unsquashed migration files coexist in the folder. As for the syntax error it was because python

Get the first image src from a post

2015-06-15 Thread Robin Lery
I have a model to write blogs. In that I'm using a wysiwyg editor for the Blog's descritpion, through which I can insert an image within the description. class Blog(models.Model): title = models.CharField(max_length=150, blank=True) description = models.TextField() pubdate =

Re: potential bug

2015-06-15 Thread Mark Nesterovych
Forgot about ModelChoise. Thank you. On Sunday, 14 June 2015 22:37:26 UTC+3, Tom Evans wrote: > > On Sun, Jun 14, 2015 at 3:24 PM, Mark Nesterovych > wrote: > > Hello. > > I've just finished small django site, and keep going on creating tests. > > I've found and issue

Re: Squashed migration

2015-06-15 Thread aRkadeFR
Thanks for the good explanation as always :) From the documentation plus the explanation of the problem, I wanted to know if by deleting the old migration it would still run the old migrations. Do we know the end of the story? Where it comes from? Thanks On 06/12/2015 05:42 PM, Carl Meyer

Re: Running DJango with uWSGI with a user that has sudo access?

2015-06-15 Thread Avraham Serour
I think a more common case is programmer error, you may yourself harm the system because of a bug you introduced, I once deleted a folder one level too high (deleted the parent folder of the folder I intended to delete) if the user only had permissions to only what it is supposed to do I would