Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Some Developer
On 08/02/13 14:08, Andre Terra wrote: Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer > wrote: I have a model for a Tag object with simply has two fields. A title (which has the unique

Re: django user model json

2013-02-08 Thread Anderson
Hi Jacob thanks for the tip but don't worry that is just a test script there are not real users and is running my local server that doesn't have any outside connection. Thanks anyway is always good to be careful. I am using django 1.4 so you telling me that parents classes cannot be serialized?

Re: django user model json

2013-02-08 Thread Jacob Kaplan-Moss
Hi Anderson -- First, I need to point out something: On Fri, Feb 8, 2013 at 2:07 PM, Anderson wrote: > 'password': > u'pbkdf2_sha256$1$ObXZ2yN3HATp$3ADUPZrzdvQCkPdJPCakfzILAIF8lPbKgAZLiXm54UI=', You just posted a password -- yours or one of your users -- on a

Pattern for Ajax Forms using Django ModelForm and Class Based Views.

2013-02-08 Thread Kelly Nicholes
What's the best practice for this? In my function based views, I'd check if the form is_ajax() and if so, validate the form, render_to_string it to a form template, and return that in a json dump along with a status code. Then I check the status code to see if there are errors. If so, I

django user model json

2013-02-08 Thread Anderson
Hi guys I have this class that extends from Class User class UserProfile(User): #timezone = models.CharField(max_length=50, default='America/Edmonton') activation_key = models.CharField(max_length=40) key_expires = models.DateTimeField() objects =

ValueError at /admin/flatpages/flatpage/1/

2013-02-08 Thread frocco
If I add a record and do not select the sites dropdown, I get ValueError at /admin/flatpages/flatpage/1/ Cannot use None as a query value Request Method:POSTRequest URL: http://127.0.0.1:8000/admin/flatpages/flatpage/1/Django Version:1.4.3Exception Type:ValueErrorException Value: Cannot use

Re: Any good books for learning django?

2013-02-08 Thread Young Park
Online document is the hero. Almost all the books are outdated for Django, unfortunately. On Thursday, February 7, 2013 9:49:36 AM UTC-8, frocco wrote: > > Hello, > Most of what I find are dated, 2008,2009. > Are these still good for learning django 1.4? > > Which books do you recommend? > >

Need to add to response object

2013-02-08 Thread Young Park
I'm using web socket (using gevent-socketio) and when any socket action is made, it gives me an error saying Attrbute Error: response.status_code == 404 > it gives me response has no status_code key... So to handle this I wanted to do something like this in my middleware class

Re: Replacing a model instance's __dict__

2013-02-08 Thread Daniel Roseman
On Friday, 8 February 2013 09:50:22 UTC-8, Tom Evans wrote: > Hi all > > I have a curious problem with a complex data replication issue. > > Basically, we use SalesForce as a CRM system. We also have a bunch of > users who aren't allowed a SF license due to cost reasons, and they > interact

Re: Tutorials for formsets using PKs as checkboxes

2013-02-08 Thread Rafael E. Ferrero
You can choose what widget use, one of them convert selectMultiple on checkboxes (checkboxSelectMultiple) Hope to help you See ya! 2013/2/8 David > Hi > > Does anyone know of

Re: Any good books for learning django?

2013-02-08 Thread frocco
I feel the book is fairly priced, and 12 dollars should not hurt anyone. It is sad, that most of the books out there are 2008,2009 publishing dates. If I am starting a new project, should I be using django 1.5 or wait til the final release? On Friday, February 8, 2013 12:28:53 PM UTC-5,

Replacing a model instance's __dict__

2013-02-08 Thread Tom Evans
Hi all I have a curious problem with a complex data replication issue. Basically, we use SalesForce as a CRM system. We also have a bunch of users who aren't allowed a SF license due to cost reasons, and they interact with SF via our own Django website that communicates to SF via an API. With

Re: Any good books for learning django?

2013-02-08 Thread Fabian Ezequiel Gallina
2013/2/8 Tom Evans : > On Fri, Feb 8, 2013 at 10:13 AM, vijay shanker wrote: >> do u have the pdf ? >> will u share it at some place (or please mail it to me deont...@gmail.com) > > Please don't use this list to arrange or ask others to pirate books.

Re: Any good books for learning django?

2013-02-08 Thread Yussi
On 08/02/13 16:54, Mike wrote: Thanks for the recommendation! I just bought it and spent five minutes browsing and already I learned a lot. Here's a few chapters that I'll read right away: Security best practices Django app design When to use function based views or class based views Deploying

Re: Any good books for learning django?

2013-02-08 Thread Mike
Thanks for the recommendation! I just bought it and spent five minutes browsing and already I learned a lot. Here's a few chapters that I'll read right away: Security best practices Django app design When to use function based views or class based views Deploying The book is currently in

Re: E-commerce framework for downloadable content

2013-02-08 Thread robertlnewman
Also there is Braintree and Stripe, which are not Django specific nor Python specific, but offer nice Python APIs. I have especially heard nice things about Stripe (http://www.kalzumeus.com/2012/08/06/stripe-and-ab-testing-made-me-a-small-fortune/ - ignore the fact that the post is about RoR,

Re: AccountDeletion remains after expunge_deleted

2013-02-08 Thread robertlnewman
Hi Paton, Not to be obtuse, but the question you are asking is actually unique to the Pinax project (http://pinaxproject.com/). AFAIK Django's manage.py doesn't have any expunge_deleted command (at least as far as my manage.py help output shows, and I am running the latest Django 1.4.2). You

Tutorials for formsets using PKs as checkboxes

2013-02-08 Thread David
Hi Does anyone know of any good tutorials or guides for using formsets, with PKs as checkboxes? Something not to dissimilar to the functionality found in the django admin when listing records belonging to a model. I have tried looking through Django's code but can't find what I need. Thanks

Re: How to create a Django Group in case of multiple databases.

2013-02-08 Thread laxmikant ratnaparkhi
I have not trimmed traceback. This is ouput came on python manage.py shell. And one more thing I modified save method This looks like this: def save(self): if not self.id: self.created_date_time = datetimeToUTC() self.modified_date_time = datetimeToUTC()

Re: post_save signal getting called twice !

2013-02-08 Thread vijay shanker
yes that was it. thanks a ton. ;) On Friday, February 8, 2013 5:21:19 PM UTC+5:30, Martin J. Laubach wrote: > > further, i tried putting a sender argument in receiver, but the sender , i >> found (by set_trace) is Cart_cartitems, how can i import this > 'shoppingcart.models.Cart_cartitems'> when

Re: Is there any way to apply a constraint on ForeignKey/OneToOneField being attached to any model based on some condition ?

2013-02-08 Thread vijay shanker
fortunately my case was really simple, i had to count number of m2m objects attached to my model and storing it as field, and had to make the decision of having a ForeignKey/OneToOne relation based on number of m2m objects attached.I was already using m2m_changed signal ( on post_add ), so i

Re: Set db connections manually for each request.

2013-02-08 Thread vijay shanker
write a custom manager and use it whenever you want to do use other database: https://docs.djangoproject.com/en/1.3/topics/db/multi-db/#using-get-query-set-with-multiple-databases On Thursday, February 7, 2013 7:08:40 PM UTC+5:30, girishms wrote: > > Hi All, > Is it possible to set db

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Andre Terra
Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer wrote: > I have a model for a Tag object with simply has two fields. A title (which > has the unique constraint) and a description. I also have a FormView based > view class which

Re: E-commerce framework for downloadable content

2013-02-08 Thread Avraham Serour
don't forget satchmo. In any case I believe all the shops have support for downloadable products, it it a fairly common case Usually the shops don't store cc info, they connect to some payment processor like paypal, or are flexible so you can implement your own like collect on delivery avraham

E-commerce framework for downloadable content

2013-02-08 Thread Carlos Edo Méndez
Hi! I'm looking for a django framework for e-commerce. I've been searching and i found LFS, Satchless, Plata... but I don't know which is the most suitable for my needs. My project is similar to iPhone's Appstore. The content to sell is downloadable and it is uploaded by third party developers

AccountDeletion remains after expunge_deleted

2013-02-08 Thread Paton Lewis
I started my project via: django-admin.py startproject --template=https://github.com/pinax/pinax-project-account/zipball/master myproject One of the features provided by the account system is delayed deletion of accounts. When you delete an account, it isn't actually deleted. Instead, an

Re: Any good books for learning django?

2013-02-08 Thread Mark Phillips
+1 to Tom Mark On Fri, Feb 8, 2013 at 5:58 AM, Tom Evans wrote: > On Fri, Feb 8, 2013 at 10:13 AM, vijay shanker wrote: > > do u have the pdf ? > > will u share it at some place (or please mail it to me > deont...@gmail.com) > > Please don't

Re: Any good books for learning django?

2013-02-08 Thread Tom Evans
On Fri, Feb 8, 2013 at 10:13 AM, vijay shanker wrote: > do u have the pdf ? > will u share it at some place (or please mail it to me deont...@gmail.com) Please don't use this list to arrange or ask others to pirate books. The author of any django book almost certainly is a

Re: post_save signal getting called twice !

2013-02-08 Thread Martin J. Laubach
> > further, i tried putting a sender argument in receiver, but the sender , i > found (by set_trace) is Cart_cartitems, how can i import this 'shoppingcart.models.Cart_cartitems'> when its only a intermediary model > that django's creating. I think you want Cart.cartitems.through

Re: Any good books for learning django?

2013-02-08 Thread yati sagade
You should read the Django tutorial and then maybe build an app that will make you more comfortable with Django. It may be any app - a notes taking app, for example. During the process, you'll pay a large number of visits to the wonderful Django docs and will come to appreciate them. There is The

Re: Any good books for learning django?

2013-02-08 Thread vijay shanker
do u have the pdf ? will u share it at some place (or please mail it to me deont...@gmail.com) On Thursday, February 7, 2013 11:40:01 PM UTC+5:30, Mayukh Mukherjee wrote: > > I'd recommend two scoops of django. > It's a little more intermediate level but it's a gem. > > Sent from my iPhone > > On

Re: post_save signal getting called twice !

2013-02-08 Thread vijay shanker
further, i tried putting a sender argument in receiver, but the sender , i found (by set_trace) is Cart_cartitems, how can i import this when its only a intermediary model that django's creating. On Friday, February 8, 2013 11:26:47 AM UTC+5:30, vijay shanker wrote: > > Thanks Evans.That was