Re: Tests in files other than tests.py and models.py

2008-06-25 Thread Ben Ford
The testrunner is probably the way to go! I do this: # somemod.test.py from somemod import testing as reg # testing is a package with various modules inside __test__ = { 'create_tracker': reg.process.create_tracker, 'create_new_user': reg.process.create_new_user, 'default_promo': reg.

Re: Do you code django with Komodo?

2008-06-25 Thread Jörn Paessler
Hi, on Windows I used to work with pydev/eclipse. Since it didn't run on Mac OS X so well, I switched to Komodo Edit first and purchased Komodo IDE later. The IDE offers support for Subversion and some class browsing functions. What I also appreciate is the code completion support for some

Re: Do you code django with Komodo?

2008-06-25 Thread Ben Ford
> BTW: would anybody be interested in contributing to a Komodo-Django > extension with shortcuts to manage.py etc., modeling wizards and so on? Hell yeah, is it relatively straightforward or very involved? I know python pretty well, but firefox/komodo extensions are a bit of a black art! Ben --

Adding fields to form in form.clean()

2008-06-25 Thread Thomas Guettler
Hi, depending on the values from form.cleaned_data, I want to present different input fields to the user. Example: The user chooses a country, and after submit (no ajax), the cities of this country should be in a drop down box. Since my setup is more complex, I don't want to use the uncleane

Re: Do you code django with Komodo?

2008-06-25 Thread Jörn Paessler
>> BTW: would anybody be interested in contributing to a Komodo-Django >> extension with shortcuts to manage.py etc., modeling wizards and so >> on? > > Hell yeah, is it relatively straightforward or very involved? I know > python pretty well, but firefox/komodo extensions are a bit of a > b

Re: How do you identify hidden form fields in a template

2008-06-25 Thread bruno desthuilliers
On 25 juin, 01:03, davenaff <[EMAIL PROTECTED]> wrote: > In a template, I'm using the equivalent of: > {% for field in form %} > {{ field.label_tag }}{{field}} > {% endfor %} > > However, the labels of my hidden fields appear. Is there an easy way > to test if the field is using the HiddenInput w

Re: Do you code django with Komodo?

2008-06-25 Thread ristretto . rb
Ok, lot's of research and asking in some other places and I think I've come down to the two front runners in the category of "coders-who-want-more-than-vi-can-give": Komodo IDE or WingIDE. I've now heard of and in some cases tried (I run Linux): Eclipse, IDLE, Eric, jEdit, gEdit, vi, emacs, and

Re: Data truncated for column change_message

2008-06-25 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 database charset was the problem. see http://code.djangoproject.com/ticket/5007 fixing the encoding in the database solved the problem. Stephan Jäkel wrote: | Hi, | | the Data truncated error is thrown for a django table. my models are ok, | i thin

Re: Do you code django with Komodo?

2008-06-25 Thread Andre Meyer
On Wed, Jun 25, 2008 at 9:21 AM, Ben Ford <[EMAIL PROTECTED]> wrote: > > BTW: would anybody be interested in contributing to a Komodo-Django >> extension with shortcuts to manage.py etc., modeling wizards and so on? > > > Hell yeah, is it relatively straightforward or very involved? I know python

Re: memchached issue on ubuntu

2008-06-25 Thread Amit Upadhyay
On Wed, Jun 25, 2008 at 2:30 AM, Alex Ezell <[EMAIL PROTECTED]> wrote: > If this is what is in your settings file exactly: > > CACHE_BACKEND = "memcached:///127.0.0.1:11211/" > > It looks to me like you have an extra slash there before your IP > address. Meaning that when this string gets parsed i

Pickle a django form

2008-06-25 Thread Rufman
I'm trying to create a little hack, so that i have dynamic django forms. So that i have the state of the form class i have created a helper function that takes a dictionary of django form fields, unpacks it and creates a form. So that i have the same blueprint for form validation in the request th

Re: ImageField

2008-06-25 Thread David Reynolds
On 24 Jun 2008, at 6:36 pm, Molly wrote: > Maybe my Python Imaging Library is in the wrong location?? Try this: $ python Python 2.5.2 (r252:60911, May 28 2008, 08:35:32) [GCC 4.2.4 (Debian 4.2.4-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveC

Re: many to many field

2008-06-25 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 'cause the current patch in the ticket doesnt seem to work perfect until now, i created a small hack http://steph.rdev.info/devel/m2m_custom_columnnames-r7732.patch example: class Article(models.Model): categories = models.ManyToManyField(

Re: Do you code django with Komodo?

2008-06-25 Thread Andre Meyer
On Wed, Jun 25, 2008 at 9:55 AM, ristretto. rb <[EMAIL PROTECTED]> wrote: > Has anyone used Komodo and Wing and can recommend one over the other? > Or are they about the same in general? i have indeed used them both and chosen Komodo IDE. used Komodo Edit, too, but prefer the added features of t

PIL 1.1.6, jpeg decoder error, going insane...

2008-06-25 Thread sparky
Hello all. I am writing a site that has profile functionality which uses the sorl.thumbnail app. When I try to view a single user profile the image (a jpeg using sorl.thumbnail) works, beautifully. However, when I try to view all user profiles I get the following error: IOError at /profile/all/

Re: Overwriting the delete() Method in a Model

2008-06-25 Thread Daniel Austria
Thanks Guys, for your responses. I used the pre_delete signal. When i delete a participant object via admin interface, the related Data Instances are also deleted and pre_delete is called. That work s for me pretty good. Many thanks, Dan --~--~-~--~~~---~--~~ You

Re: url views problem

2008-06-25 Thread sebey
yes i have that set up it now looks like this def show_page(request,show_feed): """this is where we take what we need form the rss feeds in the data base""" query = show.objects.filter(show_feed__contains="http://";) for s in query: podcast = feedparser.parse(s.show_feed)

Re: django template rendering

2008-06-25 Thread Matthias Kestenholz
On Tue, 2008-06-24 at 22:10 -0700, Djangofan wrote: > When rendering a django template on an HTML page, I can use: > > Field Name: "myFieldName" > Value: {{ row.myFieldName }} > > and it works just fine. However, I can't find a way to make it work > with a dynamic variable for the field name:

intercepting template admin/base_site.html

2008-06-25 Thread OliverMarchand
Hello, I want to customize my admin interface. For that I know I can create my *own* template admin/base_site.html. What I should really do is derive this from the *admins* base_site.html template. >From my understanding, I am intercepting the base_site.html template. But how do I specify the ad

Re: How to get ManyTomManyField‘s value?

2008-06-25 Thread Daniel Roseman
On Jun 25, 6:33 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Not ManyToManyFieldTags !!! > > Flowing: > > class Test(models.model): > . > tags = ManyToManyField(Tag) > . > >def save(self): > >super(Test,self).save() > >p

Re: Adding fields to form in form.clean()

2008-06-25 Thread Gregor Müllegger
Maybe you could use django's form wizard: http://www.djangoproject.com/documentation/form_wizard/ On Jun 25, 9:27 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Hi, > > depending on the values from form.cleaned_data, I want to present different > input fields to the user. Example: > The user

Re: intercepting template admin/base_site.html

2008-06-25 Thread Julien
What you need to do is to create an 'admin' folder at the root of your own template directory. Then, copy the files you want to override from django/contrib/admin/templates/admin. And make the changes in those copied files. They will be used in place of the standard ones. On Jun 25, 7:16 pm, Oliv

Re: Do you code django with Komodo?

2008-06-25 Thread Alaa Salman
On Jun 25, 11:23 am, "Andre Meyer" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 25, 2008 at 9:21 AM, Ben Ford <[EMAIL PROTECTED]> wrote: > > > BTW: would anybody be interested in contributing to a Komodo-Django > >> extension with shortcuts to manage.py etc., modeling wizards and so on? > > > Hell yea

Re: intercepting template admin/base_site.html

2008-06-25 Thread Alaa Salman
On Jun 25, 12:16 pm, OliverMarchand <[EMAIL PROTECTED]> wrote: > I want to customize my admin interface. > For that I know I can create my *own* template admin/base_site.html. > What I should really do is derive this from the *admins* > base_site.html template. > From my understanding, I am inter

upload file to specific directory/id?

2008-06-25 Thread stoKes
within django is it possible to customize upload_to in order to save the file into a /folder/id/category type situation? so far it just dumps everything into one directory. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Adding fields to form in form.clean()

2008-06-25 Thread Malcolm Tredinnick
On Wed, 2008-06-25 at 09:27 +0200, Thomas Guettler wrote: > Hi, > > depending on the values from form.cleaned_data, I want to present different > input fields to the user. Example: > The user chooses a country, and after submit (no ajax), the > cities of this country should be in a drop down

Re: How do you identify hidden form fields in a template

2008-06-25 Thread Malcolm Tredinnick
On Wed, 2008-06-25 at 00:42 -0700, bruno desthuilliers wrote: > On 25 juin, 01:03, davenaff <[EMAIL PROTECTED]> wrote: > > In a template, I'm using the equivalent of: > > {% for field in form %} > > {{ field.label_tag }}{{field}} > > {% endfor %} > > > > However, the labels of my hidden fields ap

Re: sending large downloads

2008-06-25 Thread John Hensley
If it doesn't require authorization (seems unlikely here), would a simple redirect to the tar file work? If it does, look into X-Sendfile if you're using Apache (you need mod_xsendfile) or lighty, or X-Accel-Redirect under nginx. You do only what you need to in the Django view and hand off

slightly off: icon for the google group

2008-06-25 Thread pihentagy
Hi all! Maybe it should sound a bit offtopic, but can I ask for a custom icon for the group? I have subscribed to a bunch of google groups, and many of them doens't use custom icon (many computer icons around). Using a custom icon will help people quickly find this group :) thanks Gergo --~--~--

Re: Problem logging in to admin using Safari

2008-06-25 Thread Pieter Claerhout
I think I got closer to the source of the problem. First of all, it's not client related. What I tried was the following: - Removed all the virtual hosting stuff and defined the complete web server to serve the django app. - Included django_test.local pointing to 127.0.0.1 in the hosts file. If

Re: upload file to specific directory/id?

2008-06-25 Thread Marty Alchin
On Wed, Jun 25, 2008 at 6:37 AM, stoKes <[EMAIL PROTECTED]> wrote: > within django is it possible to customize upload_to in order to save > the file into a /folder/id/category type situation? > > so far it just dumps everything into one directory. As stated in the FileField documentation[1], you

Re: url views problem

2008-06-25 Thread Jeff FW
You've now passed in the variable (which you can check by throwing a "print show_feed" at the top of the function), but now you actually need to *do* something with it. I'm assuming (not really knowing what you want out of this) that you'd want to add an order_by clause to order your podcasts (?)

Re: Basic CRUD form with navigation layout

2008-06-25 Thread Leandro Severino
Thanks Antoni, But I need of examples !. I'm a newbie in Django. Well, in my searchs I found the object Pagination that is the solution to my problem of a Navegation, but I need of all operations(new, delete, save and the navigations) in the same page. Any idea ? On 24 jun, 03

Re: django-registration with my custom user profile

2008-06-25 Thread pihentagy
Hi! I'm also trying to use django-registration. In my case the userprofile is mandatory, so I should create my own form. However, I would like to use ModelForms for the UserProfile part, but I should also provide room to enter username, and password. (and I also would like to store additional dat

Re: url views problem

2008-06-25 Thread sebey
sorry but I do not want to limit the results as I am useing a parser in the views.py but I want to get all of the urls and the first url show/1, the second url I want to give shows/2 and so on and so on On Jun 25, 1:48 pm, Jeff FW <[EMAIL PROTECTED]> wrote: > You've now passed in the variable (wh

Re: upload file to specific directory/id?

2008-06-25 Thread Thomas Guettler
stoKes schrieb: > within django is it possible to customize upload_to in order to save > the file into a /folder/id/category type situation? > Hi, I had this problem, too. For every object of a model class can have attachments. I don't need to store additional data for the files. I realized,

Re: ImageField

2008-06-25 Thread Molly
This is what I got: C:\>python Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Image Traceback (most recent call last): File "", line 1, in ImportError: No module named Image

Re: ImageField

2008-06-25 Thread Molly
Nevermind, I figured out how to import it.. it works now when I say import Image. When I go to run my app it does not work with that import. The import I added is: import PIL.image Thanks :) Molly On Jun 25, 9:19 am, Molly <[EMAIL PROTECTED]> wrote: > This is what I got: > > C:\>python > Pytho

Re: Basic CRUD form with navigation layout

2008-06-25 Thread Antoni Aloy
2008/6/25 Leandro Severino <[EMAIL PROTECTED]>: > > Thanks Antoni, > > But I need of examples !. I'm a newbie in Django. Go to appfusedjango project in google code http://code.google.com/p/appfusedjango/ perhaps it would help you, as I wrote a complete crud operation. Best regards, -- Anto

Re: ImageField

2008-06-25 Thread Molly
Solved. I had to import Image without the PIL On Jun 25, 9:24 am, Molly <[EMAIL PROTECTED]> wrote: > Nevermind, I figured out how to import it.. it works now when I say > import Image. > > When I go to run my app it does not work with that import. > The import I added is: > > import PIL.image > >

Re: Adding fields to form in form.clean()

2008-06-25 Thread Thomas Guettler
Hi Malcolm and others, my first to create a child form failed, because motherform.cleaned_data does not exist, if a validation error occurred. Now I populate the childform during motherform.clean() and it works. Thank you very much for all your great work Malcolm! Thomas Malcolm Tredinnick

Re: Some Model SQLite3 related questions/problems

2008-06-25 Thread Karen Tracey
On Wed, Jun 25, 2008 at 2:21 AM, haifischjunge <[EMAIL PROTECTED]> wrote: > > Ive set up the latest svn (because the stable had template problems on > 10.5) and ran into a couple of problems. > > most annoying problem is that if I rename or delete fields in the > model - even after a db sync - the

I have to filter ForeignKey

2008-06-25 Thread mariu
Hello friends This is my first django proyect and I have a problem. class Cliente(models.Model): nombre=CharField(max_length=80) Fecha_Vencimiento=DateField(null=True,blank=True,editable=False) class Personal_Cliente(models.Model): nombre=CharField(max_length=50) Client

Re: Multiple fields without manytomanyfield?

2008-06-25 Thread Xan
Yes, I'm looking for that but without defining the ManyToManyField. Could I wrote something like: > class A(models.Model): > integers = models.list(Integer, max=unlimited) Thanks, On Jun 23, 9:10 pm, "Richard Dahl" <[EMAIL PROTECTED]> wrote: > I am a bit confused, are you looking for this

Re: Multiple fields without manytomanyfield?

2008-06-25 Thread Xan
sorry models.list(integer, max=unlimited) On Jun 25, 5:37 pm, Xan <[EMAIL PROTECTED]> wrote: > Yes, I'm looking for that but without defining the ManyToManyField. > Could I wrote something like: > > > class A(models.Model): > >     integers = models.list(Integer, max=unlimited) > > Thanks, > > On

Re: Multiple fields without manytomanyfield?

2008-06-25 Thread Joel Bernstein
I don't suppose a CommaSeparatedIntegerField would work, would it? You'd lose some querying options that you'd have with a foreign key relationship, but that may not be important to you. On Jun 25, 10:37 am, Xan <[EMAIL PROTECTED]> wrote: > sorry models.list(integer, max=unlimited) > > On Jun 25

syncdb custom sql containing a create function (pgsql backend)

2008-06-25 Thread [EMAIL PROTECTED]
Hi all, on a custom SQL file I have a CREATE FUNCTION statement but apparently, when doing syncdb, the statement fails because the custom SQL file processor thinks the statement ends on the first ; it reads. Is this a limitation? Is there a workaround? TIA --~--~-~--~~~--

Creating test database with a complete SQL script

2008-06-25 Thread [EMAIL PROTECTED]
Hi everyone, I'm working on a project that has a very solid database design but many of the used features aren't supported by Django (for example, multiple column primary keys). The project has a complete database creation script but I haven't found a way to use it to create the test database wh

Re: psycopg2

2008-06-25 Thread Federico Di Gregorio
On Jun 24, 4:56 pm, Christian Joergensen <[EMAIL PROTECTED]> wrote: > The problem with SQL injections shouldn't IMHO be solved at driver > level, but is an application level problem. This is plain wrong, especially if you want to support more than a single backend in your application. The driver

Re: psycopg2

2008-06-25 Thread [EMAIL PROTECTED]
Why not put it up on Google Code? It's SVN so importing should be a breeze (if not, I'm sure the Google guys would be glad to lend a hand), you have a Wiki and a Bug tracker also. Just my 2c On Jun 24, 7:09 pm, Federico Di Gregorio <[EMAIL PROTECTED]> wrote: > Just to shed a bit of light: > > On

Re: Creating test database with a complete SQL script

2008-06-25 Thread phillc
i think i understand what youre saying? by test database, you mean you want to test django out but your declared models names dont match your db? there is a meta option for db table http://www.djangoproject.com/documentation/model-api/#db-table On Jun 25, 11:54 am, "[EMAIL PROTECTED]" <[EMAIL

Re: Support for MS SQL Server

2008-06-25 Thread Hernan Olivera
> After doing some search on Google, Django has some kind of backend > support for MS SQL server. But when I type ado_mssql in my setting.py > file while creating a simple application, it says ad_mssql is not an > avaliable option. Do I need any special patch or something to enable > this? Please

Re: How do you identify hidden form fields in a template

2008-06-25 Thread davenaff
Awesome, this is very helpful. Thanks! On Jun 25, 5:09 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-06-25 at 00:42 -0700, bruno desthuilliers wrote: > > On 25 juin, 01:03, davenaff <[EMAIL PROTECTED]> wrote: > > > In a template, I'm using the equivalent of: > > > {% for field

Re: I have to filter ForeignKey

2008-06-25 Thread phillc
i had a slightly hard time understanding your problem. are you asking for Personal_Cliente.contract_macro_set.all() http://www.djangoproject.com/documentation/db-api/#related-objects or are you asking for how to climb the tree the other way? On Jun 25, 10:02 am, mariu <[EMAIL PROTECTED]> wrote:

Re: Basic CRUD form with navigation layout

2008-06-25 Thread Leandro Severino
Thanks³ Antoni, This is a very good example and it can resolve my problem. []s Leandro. On 25 jun, 10:29, "Antoni Aloy" <[EMAIL PROTECTED]> wrote: > 2008/6/25 Leandro Severino <[EMAIL PROTECTED]>: > > > > > Thanks Antoni, > > > But I need of examples !. I'm a newbie in Djang

Re: problem with select_related?

2008-06-25 Thread phillc
yourversion of django before or after qsrf merge? select_related does not work well with relations that have null = True On Jun 24, 11:40 pm, bob84123 <[EMAIL PROTECTED]> wrote: > I'm having a problem with select_related; I'm not sure if it's a bug > or a problem with my understanding of how it'

Re: Creating test database with a complete SQL script

2008-06-25 Thread [EMAIL PROTECTED]
Hi, nope, model names match to the database but, for example, I haven't found a way to be able to create a pgsql function inside a custom script so some stuff, queries that invoke functions (stored procedures), cannot be tested. Also, given that the database SQL script is versioned, I'd really li

Re: Do you code django with Komodo?

2008-06-25 Thread Andre Meyer
this might be of interest: http://community.activestate.com/forum-topic/django-lexer-incomplete?destination=node%2F2497 cheers André On Wed, Jun 25, 2008 at 11:54 AM, Alaa Salman <[EMAIL PROTECTED]> wrote: > > On Jun 25, 11:23 am, "Andre Meyer" <[EMAIL PROTECTED]> wrote: > > On Wed, Jun 25, 200

Re: Do you code django with Komodo?

2008-06-25 Thread Brian Luft
I am the project owner - and yes nothing has been accomplished other than jotting down a few lofty ideas. I am just transitioning out of some extended traveling, settling in a new city, and starting on some new contracts. Making some progress on the django komodo utils is a high priority for me

Re: psycopg2

2008-06-25 Thread Kelvin Quee
Hi, To be honest, I would rather the developers concentrate on the code than on the website. I'm already very thankful that they're doing such fantastic work. I'm all for a simple solution like Google Code that takes care of everything. If it's at all possible, it would be nice if someone fr

Re: I have to filter ForeignKey

2008-06-25 Thread mariu
Thanks, I was looking at his suggestion, The problems is: class Contrato_Marco(models.Model): Cliente=ForeignKey('Cliente') Firma_Cliente=ForeignKey('Personal_Cliente',null=True,blank=True,limit_choices_to={'Cliente':Cliente_set.all()}) NameError: name Cliente_set is not definit a

wizard authentication

2008-06-25 Thread twenger26
I would like to use the @permission_required decorator with the "form wizard" to authenticate my users. Since views are not used with the wizard, how can I authenticate with it? I saw examples of wrappers used for generic views, but cannot figure how to do this with the wizard. Would you do som

Convert string to html

2008-06-25 Thread TigerHawk
Hello, This is my first post and I'm fairly new to Django/Python. I am having a little trouble getting a string converted to html. Here is my view code: def doPassageQuery(request): response_dict = {} options = {} options['include-short-copyright'] = 0 options['inc

Re: Basic CRUD form with navigation layout

2008-06-25 Thread Antoni Aloy
2008/6/25 Leandro Severino <[EMAIL PROTECTED]>: > > Thanks³ Antoni, > > This is a very good example and it can resolve my problem. > > []s > Glad to help. I suppose in few days I would finish an example using jQuery and jqGrid, but it would depen greatly on my free time. Best regrads, --

Re: Convert string to html

2008-06-25 Thread Brian Luft
http://www.djangoproject.com/documentation/templates/#automatic-html-escaping On Jun 25, 10:36 am, TigerHawk <[EMAIL PROTECTED]> wrote: > Hello, > This is my first post and I'm fairly new to Django/Python. I am having > a little trouble getting a string converted to html. > > Here is my view cod

Common data in templates

2008-06-25 Thread Juanjo Conti
I have this problem I'd like to share with you. Supose that the name of a web site is storage in the database (let's say you have the Config model). Config.objects.get(id=1).site_name How do you show that name in all your web pages? Do you have to pass it from all your views while render_to_re

Re: Convert string to html

2008-06-25 Thread TigerHawk
Thank you! I can't believe I missed that! I must have looked at that page 10 time today. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegr

Re: Common data in templates

2008-06-25 Thread Brian Luft
Try these links: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext http://www.djangoproject.com/documentation/templates_python/#writing-your-own-context-processors -Brian On Jun 25, 11:51 am, Juanjo Conti <[EMAIL PROTECTED]> wrote: > I have this pr

Re: PIL 1.1.6, jpeg decoder error, going insane...

2008-06-25 Thread Evert
> I am writing a site that has profile functionality which uses the > sorl.thumbnail app. When I try to view a single user profile the image > (a jpeg using sorl.thumbnail) works, beautifully. > > However, when I try to view all user profiles I get the following > error: > > IOError at /profile/al

python-admin.py startproject error

2008-06-25 Thread [EMAIL PROTECTED]
I'm going through the tutorial and after importing django and running the django-admin.py startproject command I get this error: >>> import django >>> django-admin.py startproject mkgps File "", line 1 django-admin.py startproject mkgps ^ SyntaxError: invalid

views.py: Always a simple return?

2008-06-25 Thread RossGK
In a simple XMLhttpRequest I can do an ajax request for some data, have django look something up and send it to my browser. Is the response from the views.py always just a single response return render_to_response('my_index.html', {'all_data': all_data}) or is there some means to do either

Re: Will Django be upgraded to Python 3.0 after the 1.0 release?

2008-06-25 Thread Dan
The right way to transition according to Guido is to port to 2.6, run with warnings on, cover everything with unit tests, check if everything works right, run 2to3 to convert, see if everything is still alright, fix problems in 2.6, rerun 2to3, etc... Since Django supports Python from 2.3, they'l

Re: User Templates

2008-06-25 Thread Dan
Bump! Does anyone have any pointers? On Sun, Jun 22, 2008 at 5:13 PM, Dan <[EMAIL PROTECTED]> wrote: > I am looking for a way to enable users to make template to control the > presentation of reports that they would require. I am looking for the > most flexible to them and most secure to me way

Re: python-admin.py startproject error

2008-06-25 Thread Tim Chase
import django django-admin.py startproject mkgps > File "", line 1 > django-admin.py startproject mkgps >^ > SyntaxError: invalid syntax Subtle difference between >>> django-admin.py startproject foo and bash$ django-admin.py startproject

Re: python-admin.py startproject error

2008-06-25 Thread Brian Luft
django-admin.py is a python script that should be run from the command line (not the Python interpreter) -Brian On Jun 25, 12:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm going through the tutorial and after importing django and running > the django-admin.py startproject command I

Re: psycopg2

2008-06-25 Thread cbmeeks
I agree with Will on this one. While it's not the site that makes the software, it sure as heck determines how many people (and companies) will take that first chance and use it. psycopg2 might be the best thing since sliced bread. I've always used MS SQL and MySQL. Recently, I've started lear

Django inserts an empty string into IntegerField?

2008-06-25 Thread Huuuze
I have defined a zip code field as follows in my Address model: zip = models.IntegerField(blank=True, null=True) Being a good Djangonaut, I'm using a ModelForm to convert my address model into HTML. Now this where things get dicey. As you can see in the model, zip code can except empty values.

Re: python-admin.py startproject error

2008-06-25 Thread [EMAIL PROTECTED]
Thanks for the help guys. On Jun 25, 12:58 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > import django > django-admin.py startproject mkgps > > File "", line 1 > > django-admin.py startproject mkgps > >^ > > SyntaxError: invalid syntax > > Subtle diffe

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Norman Harman
Huuuze wrote: > I have defined a zip code field as follows in my Address model: > > zip = models.IntegerField(blank=True, null=True) > > Being a good Djangonaut, I'm using a ModelForm to convert my address > model into HTML. Now this where things get dicey. As you can see in > the model, zip c

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Huuuze
Thanks for getting back to me. You're correct -- that article is not a one-for-one match when compared to my problem, so let me tweak my question. When I attempt to save (my_form.save()) and I leave the zip code field blank, I receive the following exception: DataError at /person/new/add/ inval

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Karen Tracey
On Wed, Jun 25, 2008 at 4:39 PM, Huuuze <[EMAIL PROTECTED]> wrote: > > Thanks for getting back to me. You're correct -- that article is not > a one-for-one match when compared to my problem, so let me tweak my > question. > > When I attempt to save (my_form.save()) and I leave the zip code field

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Huuuze
You're right -- I left out one detail. To ensure the zip code field renders in a more ideal manner, I added the following code to my ModelForm: >> zip = forms.CharField(max_length=5, widget=widgets.TextInput({'size':5}), >> required=False) Adding "null=True" here doesn't seem to work. Any tho

Re: views.py: Always a simple return?

2008-06-25 Thread Richard Dahl
Generally with HTTP, you would configure your server to continue to respond to requests;) Which is exactly what django does anyway. HTTP is a connection based (TCP) protocol, but the connection is closed once the return has been sent. Hence the need to store a 'session' variable in the server an

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Norman Harman
Huuuze wrote: > Thanks for getting back to me. You're correct -- that article is not > a one-for-one match when compared to my problem, so let me tweak my > question. > > When I attempt to save (my_form.save()) and I leave the zip code field > blank, I receive the following exception: > > DataE

Collapse an inline in newforms-admin

2008-06-25 Thread AmanKow
Is there anyway to collapse an inline edited model in the newforms- admin? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To un

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Huuuze
Between you and Karen, I've resolved the problem. I had a bug here: >> zip = forms.CharField(max_length=5, widget=widgets.TextInput({'size':5}), >> required=False) That code has been changed to: >> zip = forms.IntegerField(widget=widgets.TextInput({'size':5, >> 'maxlength':5}), required=Fals

Development environment

2008-06-25 Thread Fernando Rodríguez
Hi, I'm currently learning django on Ubuntu, but my background is Windows, so I'm not a VIM kind of guy. What kind of IDE do you guys use or recommend? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Development environment

2008-06-25 Thread Juanjo Conti
Fernando Rodríguez escribió: > Hi, > > I'm currently learning django on Ubuntu, but my background is Windows, > so I'm not a VIM kind of guy. What kind of IDE do you guys use or > recommend? > I use kate, it has python sintax highlighter and a very nice feature that guess the next word I am go

Re: Development environment

2008-06-25 Thread phillc
emacs does me well. On Jun 25, 5:23 pm, Juanjo Conti <[EMAIL PROTECTED]> wrote: > Fernando Rodríguez escribió: > > > Hi, > > > I'm currently learning django on Ubuntu, but my background is Windows, > > so I'm not a VIM kind of guy. What kind of IDE do you guys use or > > recommend? > > I use kate

Re: Development environment

2008-06-25 Thread ristretto . rb
If you like syntax colors and code intelligence features, try Komodo or WingIDE If you know django and python really well perhaps vi is worth a look If you have a favorite text editor, you might be able to build a suitable development editor by change preferences, and adding plugins. I'm curren

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Brian Luft
In response to your side question: http://www.djangoproject.com/documentation/model-api/#null -Brian On Jun 25, 2:12 pm, Huuuze <[EMAIL PROTECTED]> wrote: > Between you and Karen, I've resolved the problem.  I had a bug here: > > >> zip = forms.CharField(max_length=5, widget=widgets.TextInput({

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Collin Grady
Yes, an empty form field would be an empty string, not None, by design. Adding a null would be odd, but possible with custom clean behavior on a form :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

django naming conventions ?

2008-06-25 Thread PFL
After reviewing the code i have written for a non-trivial but still modest Django app, I realized that my names for Django objects followed no standard (case, plural, underscores, etc) - I discovered this when I wasted at least 30 minutes trying to figure out an error that was caused by a wrong c

How do I save records when using two forms joined by a foreign key?

2008-06-25 Thread Huuuze
For the sake of argument, I have two models: Book and Author. Book has many fields and has a foreign key relationship with Author. Author has two fields and no additional relationships. To stay DRY, I have BookForm and AuthorForm classes that I use to generate the HTML for each class. When I s

Re: How do I save records when using two forms joined by a foreign key?

2008-06-25 Thread [EMAIL PROTECTED]
What you would do is: book_form = BookForm(request.POST) book = book_form.save(commit=False) book.author = author book.save() what save(commit=False) does, is create a model instance with the data from the form, but doesn't save it to the db, then you can handle it like a regular model. On Jun

Re: Development environment

2008-06-25 Thread Antoni Aloy
2008/6/25 ristretto. rb <[EMAIL PROTECTED]>: > > If you like syntax colors and code intelligence features, try Komodo or > WingIDE > > If you know django and python really well perhaps vi is worth a look I used to work with Eclipse + PyDev, but on my computer, a 3 years old G5 2x2 GHz, 1 Gb RAM,

Re: How do I save records when using two forms joined by a foreign key?

2008-06-25 Thread Huuuze
Thanks for the tip. I've now run into another issue. My book isn't validating. Is there a quick way to figure out what field(s) are causing this error: The Book could not be created because the data didn't validate. On Jun 25, 6:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What yo

Re: Development environment

2008-06-25 Thread Gonzalo Delgado
El Wed, 25 Jun 2008 23:17:37 +0200 Fernando Rodríguez <[EMAIL PROTECTED]> escribió: > > Hi, > > I'm currently learning django on Ubuntu, but my background is Windows, > so I'm not a VIM kind of guy. What kind of IDE do you guys use or > recommend? > > Thanks in advance. > > I used Eclipse+

Re: psycopg2

2008-06-25 Thread Ed McCaffrey
Even if it had the most beautiful site in the world, and that was enough to get permission to use it, a responsible developer would write some unit tests and check the items that he asked in his original question. His highly-qualified scientists probably won't have any idea that a database driver

Re: views.py: Always a simple return?

2008-06-25 Thread Brian Luft
Have you thought about using comet? Here is a link to an example implementation using orbited: http://www.rkblog.rk.edu.pl/w/p/django-and-comet/ -Brian On Jun 25, 1:56 pm, "Richard Dahl" <[EMAIL PROTECTED]> wrote: > Generally with HTTP, you would configure your server to continue to respond > t

  1   2   >