Re: Raise validation error for empty formset

2011-12-23 Thread Martin Tiršel
Hi On Thu, 15 Dec 2011 12:52:44 +0100, Tom Evans wrote: On Wed, Dec 14, 2011 at 9:22 PM, Martin Tiršel wrote: Hi, I have a formset where I need to raise ValidationError if all forms in this formset are empty and submitted but I can not

Initial data for dynamic field

2011-12-23 Thread Martin Tiršel
Hello, I have: class SomeForm(forms.Form): ... def __init__(self, *args, **kwargs): ... super(SomeForm, self).__init__(*args, **kwargs) ... self.fields['starting_location'] = forms.TypedChoiceField( label=_('Starting location'),

Re: Initial data for dynamic field

2011-12-23 Thread Mengu
you need to set "initial" attribute of TypedChoiceField. On Dec 23, 10:34 am, Martin Tiršel wrote: > Hello, > > I have: > > class SomeForm(forms.Form): >      ... > >      def __init__(self, *args, **kwargs): >          ... >          super(SomeForm, self).__init__(*args,

Re: Ember.js or Backbone.js for Django?

2011-12-23 Thread Mengu
they both belong to the template concept of django. you can write down your front-end with ember or backbone and write your back-end with django models and views. it is all up to your tastes and requirements to use one of the two. On Dec 23, 2:05 am, Jesramz

Re: Running html files in /var/www alongwith Django over Apache

2011-12-23 Thread Mengu
hi nipun, please go read about the DocumentRoot directive [1] and VirtualHosts [2] in Apache. [1] http://httpd.apache.org/docs/2.2/mod/core.html#documentroot [2] http://httpd.apache.org/docs/2.2/vhosts/ On Dec 23, 8:06 am, nipun batra wrote: > Hi,I got my Apache

Re: Using filter for serialized model.Field's

2011-12-23 Thread jrief
Hi, as a workaround, I added an additional column (aka CharField) to store the hash of that JSON string. Then only the hashes have to be compared. Sure, this is not an elegant solution, as it adds redundant data to your database. If I would write SQL by hand, I could compare the JSON-string

Re: Initial data for dynamic field

2011-12-23 Thread Martin Tiršel
On Fri, 23 Dec 2011 09:42:37 +0100, Mengu wrote: you need to set "initial" attribute of TypedChoiceField. Thanks, I knew about the initial only on form instance and not on field :) On Dec 23, 10:34 am, Martin Tiršel wrote: Hello, I have: class

Standalone Django scripts

2011-12-23 Thread Ganesh Kumar
Hi guys, I am new to django, I trying to develop standalone script (shell script), it's working fine in development version, How to can I deploy host application to my server, any help guys. In development version I have used in one terminal start running using shell script, and another terminal

Re: Standalone Django scripts

2011-12-23 Thread Daniel Roseman
On Friday, 23 December 2011 11:22:55 UTC, Ganesh-Bugcy wrote: > > Hi guys, > I am new to django, I trying to develop standalone script (shell > script), it's working fine in development version, How to can I deploy > host application to my server, > any help guys. In development version I have

Re: Django 1.4 alpha 1 released

2011-12-23 Thread Mário Neto
Great, very very good! \,,/_ Congratulations!!! 2011/12/23 James Bennett > Tonight as part of the 1.4 development process, we've released the > first alpha for Django 1.4. You can read all about it on the blog: > >

Re: Weekly discussion/randoms thread..

2011-12-23 Thread Andre Terra
On Fri, Dec 23, 2011 at 12:27 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > I think the most important aspect is to keep this integrated into the > list, and not require the user to break off to another service. - It also > means that there's very little

Re: Generic views parameter 'extra_context' didn't use form class?

2011-12-23 Thread Andre Terra
You've defined a class named *DevSrcForm* and you're calling super on *DevForm*. Since you haven't provided a full traceback or even the code from DevForm, I can't exactly explain what's going on. "Anything can happen" pretty much sums it up. Cheers, AT 2011/12/23 郁夫 > hi,

Re: Compare two tables in a secondary database

2011-12-23 Thread Andre Terra
On Thu, Dec 22, 2011 at 11:33 PM, Edvinas Narbutas wrote: > I get this error. "not enough arguments for format string", which im > guessing the LIKE isnt working because this query works. > No, LIKE is working fine, it's your Python string that's broken.

Trying to create django app to view alarms

2011-12-23 Thread Jim
Hi- I'm new to Django and pretty basic with Python to be honest, but am trying to write a web tool that will let me upload 'before' and 'after' files of alarm logs and analyse the differences as follows: * alarms cleared during the period (in before, but not after) * alarms raised during

Re: Weekly discussion/randoms thread..

2011-12-23 Thread Cal Leeming [Simplicity Media Ltd]
Ultimately it would be down to the weekly contributors to pull in the info, if we make it an automated service then we could end up bloating the thread to the point where it feels like spam. I think that the concept of a weekly thread is for users to list their thoughts of what they feel is

Re: Which IDE should I use for Django?

2011-12-23 Thread Cal Leeming [Simplicity Media Ltd]
Good point :) An IDE really can just be a set of scripts and your environment, whatever allows the developer to get the best results in the most flexible and easiest way. I still think there is absolutely a call for a sublime text 2 style IDE, but that is a different conversation all together :)

Re: Standalone Django scripts

2011-12-23 Thread Python_Junkie
I am not exactly sure how extensive your question is about deployment. You can just copy the files associated with your local django project/ app to the server in the same exact directory structure, install the same modules that you had on your local computer and run the shell script, /manage.py

Re: Professional forum software that integrates with Django

2011-12-23 Thread Aizen
Hi...you could try looking at http://djangopackages.com/grids/g/forums/ if you haven't already done so. I recall using http://djangopackages.com/packages/p/djangobb/ for a code base I needed a while back. I think DjangoBB comes close to phpBB, so it's worth a try. -- You received this message

Re: Compare two tables in a secondary database

2011-12-23 Thread Edvinas Narbutas
You are right. Just as i got the same result I saw your post. And this: >        Second, MySQLdb quotes parameters before putting them into the > placeholder, so you'd end up with > > ... like ''something'%' I saw that happen in the query ^_^ This is the final code for it: class

How to handle callback urls

2011-12-23 Thread lankesh87
Hi, I am trying to handle a callback url. Following is the code in my urls.py file: -- urls.py:- -- from

Re: How to handle callback urls

2011-12-23 Thread Daniel Roseman
On Friday, 23 December 2011 17:17:50 UTC, lankesh87 wrote: > > Hi, > > I am trying to handle a callback url. Following is the code in my > urls.py file: > > -- > > > urls.py:- >

Re: How to handle callback urls

2011-12-23 Thread lankesh87
Thanks.. But now I have a new error: --- keyerror description:-

Re: am I understanding sessions correctly?

2011-12-23 Thread Stuart Laughlin
On Dec 22, 9:01 am, Chris Curvey wrote: > The short version:  when processing a request, does Django *always* > collect session information from the session store before starting the > view? > Yes. However note that django only saves to the session database when the session

Help me with this query

2011-12-23 Thread Babatunde Akinyanmi
Hello, How can I get the ORM to do the equivalent of this sql query with the result being a QuerySet: SELECT * FROM table LIMIT expr. I know I can use objects.raw() but I need to shuffle the results and RawQuerySet objects do not have __len__() making it impossible to random.shuffle. I actually

Re: Help me with this query

2011-12-23 Thread Nan
Try Python's slicing syntax. [1] [1] https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets On Dec 23, 2:16 pm, Babatunde Akinyanmi wrote: > Hello, > How can I get the ORM to do the equivalent of this sql query with the > result being a QuerySet: > >

Re: How to handle callback urls

2011-12-23 Thread Thomas
Hi, Am 23.12.2011 um 19:40 schrieb lankesh87: > Thanks.. > But now I have a new error: >

Re: Help me with this query

2011-12-23 Thread Babatunde Akinyanmi
X_X I can't believe I didn't even think of that. Thanks maiyte On 12/23/11, Nan wrote: > Try Python's slicing syntax. [1] > > [1] > https://docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets > > On Dec 23, 2:16 pm, Babatunde Akinyanmi

Re: Help me with this query

2011-12-23 Thread Sebastian Goll
On Fri, 23 Dec 2011 20:16:11 +0100 Babatunde Akinyanmi wrote: > I actually have a database with thousands of records from which I have > to randomly select just 10 records from the thousands during every > query. Because of efficiency, I use the normal select with limit

Re: Help me with this query

2011-12-23 Thread Python_Junkie
You can use the full functionality of sql and python by executing sql queries using the pyodbc module. The module is documented at this url http://code.google.com/p/pyodbc/ You can combine sql and python logic and not have to be constrained by the abstraction of raw sql or the ORM. in your

Re: Weekly discussion/randoms thread..

2011-12-23 Thread Russell Keith-Magee
On Fri, Dec 23, 2011 at 10:27 AM, Cal Leeming [Simplicity Media Ltd] wrote: > I'm thinking that if we keep this a strictly on-list event, it will > encourage people to get involved at any time, simply by replying to the > thread. > > We'd pick a day which

Re: Weekly discussion/randoms thread..

2011-12-23 Thread Mike Dewhirst
Have you considered The Python Papers? It is an edited journal with two streams: Industrial and Academic both of which are peer reviewed - to slightly different degrees of rigour. I'm sure the editors would be happy to add a Django "column" and indeed would welcome Django-gurus as specialist

Re: Help me with this query

2011-12-23 Thread Babatunde Akinyanmi
Thanks guys. The pyodbc option seems to be the best as i've discovered that QuerySet cannot also be random.shuffleD On Fri, Dec 23, 2011 at 11:09 PM, Python_Junkie < software.buy.des...@gmail.com> wrote: > You can use the full functionality of sql and python by executing sql > queries using the