Re: Django custom middleware question

2008-06-25 Thread csmith
Hey guys, thanks for the help. I actually got it working like this: class AliasMiddleware(object): def process_request(self, request): assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES

Need help with django poll tutorial (poll form doesn't work)

2008-06-25 Thread Mog
I'm new to Django and I've been able to get to the end of the Django tutorial using localhost as my server. for some reason I can't get the form poll to recognize my choices. Regardless whether I click on the radio buttons and click vote or if I just click vote without selecting, I always get the

Re: Add filters to the Users List/Page in the admin app

2008-06-25 Thread Rishabh Manocha
Anybody got any ideas here?? I could really use some help with this problem. Thanks, Rishabh On Tue, Jun 24, 2008 at 9:49 AM, Rishabh Manocha <[EMAIL PROTECTED]> wrote: > Ok, so I need a bit more direction here. I've got newforms-admin setup and > working as far as displaying the various FK

Re: Django custom middleware question

2008-06-25 Thread Alex Ezell
On Tue, Jun 24, 2008 at 11:14 PM, csmith <[EMAIL PROTECTED]> wrote: > > How can I add an attribute or variable? to the request object in > middleware, where I can use it in other views via the request object. > This is my custom middleware code so far: > > class AliasMiddleware(object): >def

Re: authenticating rest request

2008-06-25 Thread Malcolm Tredinnick
On Wed, 2008-06-25 at 17:19 -0700, crybaby wrote: > How does one go about authenticating rest request? The question could have many interpretations, but let's give it a try. Strictly speaking, REST-ful access over HTTP means authentication is going to be done via HTTP headers, in particular,

Displaying sets of data in-line together

2008-06-25 Thread truebosko
This may be kind of hard to explain but what I am trying to accomplish in Django is this: I have 2 possible sets of data (It can also be one, depending on what's easiest) #1 is Reviews where FOO = X #2 is Reviews where FOO = Y Each Review contains several category type fileds. Summary, Value,

Re: syncdb custom sql containing a create function (pgsql backend)

2008-06-25 Thread Malcolm Tredinnick
On Wed, 2008-06-25 at 08:49 -0700, [EMAIL PROTECTED] wrote: > 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

authenticating rest request

2008-06-25 Thread crybaby
How does one go about authenticating rest request? --~--~-~--~~~---~--~~ 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 unsubscribe from this

Re: django naming conventions ?

2008-06-25 Thread Alex Slesarev
http://www.djangoproject.com/documentation/contributing/ See "Coding Style" section. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: User Templates

2008-06-25 Thread Alex Slesarev
> 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 to do this. I want to > be careful since the data serve would come from my domain and thus be >

Re: problem with select_related?

2008-06-25 Thread bob84123
Thanks for the response. I'm using trunk. The documentation (http://www.djangoproject.com/documentation/db-api/ #select-related, under "new in development version" actually says: "You *can* refer to foreign keys that have null=True" (where 'can' is in italics) This is why I think the

Re: Creating test database with a complete SQL script

2008-06-25 Thread Russell Keith-Magee
On Wed, Jun 25, 2008 at 11:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > 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

Re: Some Model SQLite3 related questions/problems

2008-06-25 Thread Alex Slesarev
> Syncdb only does the initial table creation, it does note handle renaming, > adding, or deleting columns.  What you want is sometimes called "schema > migration" or "evolution".  Search this list and/or Google for pointers to a > few different external projects that are working on providing

Re: Damn unicode error

2008-06-25 Thread Alex Slesarev
Difficult to say there is the error exactly, but I can give few hints to avoid this error: 1. Define __unicode__() function for all your models, like this: class BookCategory(models.Model): shortname = models.CharField(max_length = 765, verbose_name =

Re: Django custom middleware question

2008-06-25 Thread Alex Slesarev
> How can I add an attribute or variable? to the request object in > middleware, where I can use it in other views via the request object. You can use threading.local() variables, like this: import threading _thread_locals = threading.local() def get_current_user(): return

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

2008-06-25 Thread Huuuze
Found the answer why BookForm wasn't validating. I needed to "exclude" the author field from BookForm. As soon as I did that, everything fell into place. Quick debugging tip for Django n00bs: I established that the missing author was the problem by executing this line of code: >> print

Re: Basic CRUD form with navigation layout

2008-06-25 Thread Antoni Aloy
Hi Leandro, I have updated the appfusedjango to show an example of grid with search and pagination using jqGrid with a minor patch to use it with Django. Hope it helps! -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~-~--~~~---~--~~

Re: Development environment

2008-06-25 Thread chris vigelius
Am Mittwoch, 25. Juni 2008 23:17:37 schrieb 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. Eclipse + Pydev + Aptana (for

Re: psycopg2

2008-06-25 Thread Michael Wieher
Well, I disagree. Not with the idea that a decent support site is good for software, but that you, or anyone, has any right whatsoever to expect anything at all from people who are taking their own time out of their lives to build & support pieces of software that they then give away. You make

Re: django naming conventions ?

2008-06-25 Thread James Bennett
On Wed, Jun 25, 2008 at 5:02 PM, PFL <[EMAIL PROTECTED]> wrote: > I have done some searching but could not find a set of standard naming > conventions that is recommended for Django objects: There's really not much that's Django-specific; as with most Python code, the recommendation is to follow

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 >

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: 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

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

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 [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

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

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

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"

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,

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

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

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

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

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}),

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

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: > >

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

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

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
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/

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

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

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

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

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

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: 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: 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,

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

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

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

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

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

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

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

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,

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

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

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

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

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: 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,

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

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

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

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]>

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

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: 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: 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: > >

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

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

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

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

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, > >

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

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)

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 -

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: 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: 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, --

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 >

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

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: 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

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

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,

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: 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: 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.

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: 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

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

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

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

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

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

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,

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

  1   2   >