Sphinx code validation for Django projects

2012-10-17 Thread Martin Winkler
I have a Django project with a couple of apps - all of them with 100% coverage unit tests. Recently I started documenting the whole thing in a new directory called "docs" using reST and Sphinx. I create the html files using the normal approach: make html. Since there are a couple of code snip

Forms with dynamic *fields*

2009-03-02 Thread Martin Winkler
Hi all, I want to create a form with dynamic fields. That is, I want to add the fields using the __init__ method of my form: 1 class MyForm(forms.Form): 2 def __init__(self, fieldnames=(), *args, **kw): 3 for fieldname in fieldnames: 4 self.XXXfieldnameXXX = forms

Re: ImageField upload_to Parameter Problem

2007-07-04 Thread Martin Winkler
Am Wed, 04 Jul 2007 01:19:16 -0700 schrieb lastmohican <[EMAIL PROTECTED]>: > The Problem is, I want a dynamic image > storage path, something like MEDIA_ROOT+"images/" wont work with > hundreds of galleries, [...] Since your primary concern seems to be too many files in one directory, did you c

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Martin Winkler
Am Tue, 3 Jul 2007 17:34:33 +0200 schrieb Martin Winkler <[EMAIL PROTECTED]>: > If you have binary data, why don't you use FileField and ImageField? > That way you'd store the large data in the filesystem and only have a > reference to the file in the database. M

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Martin Winkler
Am Tue, 03 Jul 2007 15:07:14 - schrieb "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>: > We are using mysql 5.0.42 and are getting this error when trying to > insert records of over 5M. I may sound nosy, and apologize for that. But don't you think that you have a software design bug when one record

Re: Graphs and django

2007-06-20 Thread Martin Winkler
Am Wed, 20 Jun 2007 16:26:24 +0100 schrieb "Gerry Steele" <[EMAIL PROTECTED]>: > My needs are to create line, bar and pie charts. One fast way for line graphs would be plain PIL (http://www.pythonware.com/products/pil/) module. But the results are usually not really pretty: No antialiasing of li

Re: Survey: FileBrowser and FancyUpload

2007-06-16 Thread Martin Winkler
Hi Patrick, Am Sat, 16 Jun 2007 12:47:46 +0200 schrieb patrickk <[EMAIL PROTECTED]>: > > I usually don´t like the idea of using a js-framework for the > filebrowser. > nevertheless, today I´ve seen this: > http://digitarald.de/project/fancyupload/ I tried it too, and just after finishing the

Re: Generic Views: "Could not parse the remainder: % object.title %"

2007-06-15 Thread Martin Winkler
Am Thu, 14 Jun 2007 14:53:42 -0700 schrieb "Evan H. Carmi" <[EMAIL PROTECTED]>: > {{% object.title %}} > {{% object.body %}} this is a syntax error and should be: {{ object.title }} {{ object.body }} They are variables, and not tags. just check http://dja

Re: Captcha module Version 1.1 ready for testing

2007-06-15 Thread Martin Winkler
Am Fri, 15 Jun 2007 14:53:59 +0800 schrieb "Nimrod A. Abing" <[EMAIL PROTECTED]>: > I will be downloading your module and testing it out soon. Cool! I'd love to get some feedback especially with different setup than I have. > If I have patches for your module, do I send it here on django-users

Re: Captcha module Version 1.1 ready for testing

2007-06-15 Thread Martin Winkler
Am Thu, 14 Jun 2007 15:51:10 -0400 schrieb Forest Bond <[EMAIL PROTECTED]>: > You can do it without external persistence (sessions and/or database > table) by encrypting the correct response in the image filename. So when the request to get the image is sent to django, we have to decrypt the sol

Re: Captcha module Version 1.1 ready for testing

2007-06-14 Thread Martin Winkler
Am Thu, 14 Jun 2007 12:00:11 +0800 schrieb "Nimrod A. Abing" <[EMAIL PROTECTED]>: > Are you planning to implement a configuration to allow in-memory > images? One thing that annoys me with in-memory images is that you have to change your urls.py, and I want the CaptchaField as unobtrusive as pos

Re: Captcha module ready for testing

2007-06-13 Thread Martin Winkler
Am Wed, 13 Jun 2007 18:47:10 - schrieb JustJohnny <[EMAIL PROTECTED]>: > I just installed your captcha module. I'm not sure if it was me, my > setup or the code but I kept getting a 'help_text' error. That is very strange - help_text is part of django's newforms fields. I tried to reproduce

Re: Bug in django related to sqlite3?

2007-05-14 Thread Martin Winkler
Hi Francesco, Am Mon, 14 May 2007 12:44:46 - schrieb cesco <[EMAIL PROTECTED]>: > query = """SELECT id FROM my_table \ > WHERE my_table.some_id IN %s""" > cursor.execute(query, [(1, 2, 3)]) why are you diving so deep? can't you just use myobjects = MyTable.objects.filter(so

Re: Transaction Support in Models

2007-05-07 Thread Martin Winkler
> do models support transactions? Yes, with the TransactionMiddleware. And it's well documented: http://www.djangoproject.com/documentation/transactions/ > can we have multiple orders in our models(getting /fetching) records > from our backend DB? Sure. default ordering is defined in the model

Re: Primary ForeignKey create try

2007-05-05 Thread Martin Winkler
Am Sat, 05 May 2007 10:22:14 -0700 schrieb Heit <[EMAIL PROTECTED]>: > TYPE_CHOICES = (('user', 'USER'),('serve', 'SERVE')) > class Person(models.Model): > ... > type = models.CharField(maxlength=30, unique=True,choices= >TYPE_CHOICES, default='user') > ... So you can ha

Re: Deos Django have Java Servlet's Listener like thing?

2007-05-05 Thread Martin Winkler
Am Fri, 04 May 2007 21:06:52 -0700 schrieb Mambaragi <[EMAIL PROTECTED]>: > Is there anything like Servlet Listener in django,python? not easily if you use mod_python, because for every apache thread a new python instance is being generated. but it should be easy using fastcgi, since it uses a

Re: Django Accessibility

2007-05-04 Thread Martin Winkler
Hi Allessandro, > Is Django framework ready to get Web Content Accessibility Guidelines > - v 1.0 (WCAG 1.0) of WAI, and Section 508 paragraph 1194.22 of > Rehabilitation Act? > > I need to make a website that is conform to those specs, and I need > to know If the admin section and newforms are

Re: Page Not Found 404

2007-03-06 Thread Martin Winkler
Am Tue, 06 Mar 2007 15:29:06 - schrieb "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>: > I am making simple blog for myself using Django. After made models and > create necessary urls, I run the application and got: Page Not Found. > [...] > >>> from mysite.blog.models import Post > >>> Post.objects

Re: applying a patch in windows ???

2007-03-06 Thread Martin Winkler
Am Tue, 6 Mar 2007 17:37:21 +0530 schrieb "MacH G" <[EMAIL PROTECTED]>: > i do [not] know how to apply > it in windows could somebody tell me the command to apply it . If you are comfortable with the unix command line, install cygwin (http://www.cygwin.com/). You'll get a full unix shell environ

Re: newforms: comparing fields during validation

2007-03-06 Thread Martin Winkler
Hi "ezln23", > I am using the newforms functionality, but I am having trouble > validating my form when two fields are needed to create the validation > rule. try this: class CreateAccountForm(forms.Form): name = forms.CharField(max_length=50) name_phonetic = forms.CharField(max_length=50

Re: 2 QA Consultants available immediately

2007-02-22 Thread Martin Winkler
Some spammer wrote: > · Over Eight Years of Experience [...] Applications using > QuickTestPro,WinRunner, LoadRunner, and Test Director. --^^ hehe, I am an experienced Lode Runner player too :) too bad that Google groups do not filter out all spam mails... --~-

Re: creating custom "filter_*" methods for objects

2007-02-11 Thread Martin Winkler
Am 11 Feb 2007 04:07:03 -0800 schrieb "[EMAIL PROTECTED]" > > On 11 Lut, 12:32, Martin Winkler <[EMAIL PROTECTED]> wrote: > > One (quite non-elegant) way would be adding a method to the class > > Manager in django.db.models.manager like this: > > > &g

creating custom "filter_*" methods for objects

2007-02-11 Thread Martin Winkler
Hi all, many of my models have a boolean field "is_active". Now I'd like to implement a convenience method that automatically uses this field when accessing my models. What is the best way to implement something like MyModel.objects.filter_active()? One (quite non-elegant) way would be adding

Detection of "tainted" fields

2007-01-16 Thread Martin Winkler
Hi all, I need to check if a certain field in my model has changed before saving: -- model MyModel(models.Model): mypic = models.ImageField() def save(self): if self.mypic.tainted: # do some work because the image has changed super(MyModel, self).save() -- So I o

Re: What IDE do you use? (semi-OT)

2006-10-08 Thread Martin Winkler
> I'd like to know what editor/IDE Django users (and developers) uses on > daily basis, I love Vim (Linux and if necessary Windows) since about 4 years. Main reasons: * super fast because of the sophisticated motion keys and multi-line editing (visualmode I) * filetype plugins for django-html

Re: Count clicks

2006-10-07 Thread Martin Winkler
Hi, > In my model i have an IntegerField called "count". What would be a > good way to increment the post with post_id=1 when someone > accesses "http://www.mysite.com/news/1";? Resp. where do i put my code? I can see here two issues: It's generally a bad idea to update anything in the database

Re: long-running process. how to do it?

2006-10-05 Thread Martin Winkler
Hi Gabor, There is also the possibility to use the "at" daemon instead of cron. e.g. at now "/var/foo/barbaz.py" of course the user has to have permissions to use the at command, and the atd daemon must be running. br, Martin Am Thu, 05 Oct 2006 16:02:42 +0200 schrieb Gábor Farkas <[EMAIL PRO