Re: Good practise on Form logic

2015-07-18 Thread James Schneider
I personally try to keep everything contained in the form if possible. This (usually) makes the form the most portable across views (so that you aren't repeating yourself in the view logic). I would only place logic in the view for the following reasons: - The logic is specific to that view,

Re: Good practise on Form logic

2015-07-18 Thread Gergely Polonkai
Hello, whichever fits you. If you always and only do it before saving, you can integrate it in the form's save() method, for example. Another thing to consider is, what does some_logic do? If it works only with the form data (e.g. transposing it somehow, which new data may be used by others like

Good practise on Form logic

2015-07-18 Thread Aldo Suarez
Say for example you have a Form with its validator methods. Then, in the view you normally do: in forms.py, if form.is_valid(): > # do some logic / add to database > # redirect Now: Is it good practise to do that "post-logic" inside Form methods or should I do it on the view? i.e. in

Re: "RuntimeError: Error creating new content types."

2015-07-18 Thread Chris DiLorenzo
While poking around with this again, I noticed that the thing causing the error for me was a datamigration (being applied due to it being run in tests) which is (I believe) why I was seeing the issue when trying to run tests but not otherwise. I was trying to grab a contenttype using

Re: Interfacing Django Project with Python Script

2015-07-18 Thread Larry Martell
On Fri, Jul 17, 2015 at 12:55 PM, Jake Rudolph wrote: >> On Friday, July 17, 2015 at 5:12:51 AM UTC-7, larry@gmail.com wrote: >> >> On Thu, Jul 16, 2015 at 7:44 PM, Jake Rudolph wrote: >> > If I have a separate Python script that I want to interact

Re: Interfacing Django Project with Python Script

2015-07-18 Thread Andy Shapiro
For a standalone script (and django 1.7+), you'll need to add this at the top of your script: import django django.setup() https://docs.djangoproject.com/en/1.8/ref/applications/#django.setup https://docs.djangoproject.com/en/1.8/intro/tutorial01/#playing-with-the-api On Friday, July 17,

Re: Is there a plan to modernize Django-admin?

2015-07-18 Thread Stuart Longland
On 18/07/15 11:00, Ezequiel Bertti wrote: > Do you already see this project? > > https://github.com/sshwsfc/django-xadmin Unfortunately their homepage just swears at me in Chinese. -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere.

Re: Is there a plan to modernize Django-admin?

2015-07-18 Thread Tymoteusz Jankowski
Thanks for clarification, I'll check both: django-admin2 and django-xadmin. On Sat, Jul 18, 2015 at 2:04 AM Russell Keith-Magee wrote: > On Sat, Jul 18, 2015 at 2:54 AM, xliiv > wrote: > >> Hi! >> Like the topic, though I don't mean only

django sales and inventory project

2015-07-18 Thread Arindam sarkar
i am developing a sales and inventory app. can i get a reference to any open source code to look up... -- Regards, Arindam Contact no. 08732822385 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop