New tutorial added to Django by Example

2010-08-02 Thread Rainy
I've added a new tutorial: Calendar App to my Django by Example site. As always, feedback is appreciated. What would be a good tutorial to do next? http://LightBird.net/dbe/ -ak -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Need help setting up dynamic options for select (drop down) box of form.

2010-08-02 Thread Chris Seberino
I'm trying to make the options of a particular drop down box be determined at runtime. I added a __init__ constructor to my django.forms.Form subclass as follows... def __init__(self, data= None, error_class =

Re: Splitting LONGTEXT column to its own table?

2010-08-02 Thread Nick Arnett
On Mon, Aug 2, 2010 at 9:39 AM, Antoni Aloy wrote: > My first thought would be to backup the database, then put the project > under South control. Then create a one-to-one relation between models > and the possible create a upgrade script. > Then, if necessary, you could

Re: Splitting LONGTEXT column to its own table?

2010-08-02 Thread Nick Arnett
On Mon, Aug 2, 2010 at 2:34 PM, Steve Holden wrote: > > Another alternative would be to create a view of the joined tables using > SQL CREATE VIEW, then treat the view as a table in Django. You do have > to be careful that the view should be updatable, though. Ah... I

passing a keyword argument from form to a field in that form

2010-08-02 Thread Jim
Hello, I have a custom field whose behavior depends on a parameter show_all. (It makes the field pull from the database for display only those keywords where show=True.) class KeywordsField(forms.ChoiceField): def __init__(self, choices=(), required=True,

MultiPartParserError HTTP_CONTENT_LENGTH zero when uploading a file

2010-08-02 Thread Eric Chamberlain
We have an intermittent problem when uploading files. About one in five uploads fails, when the MultiPartParser receives an HTTP_CONTENT_LENGTH of zero. We are running Django with lighttpd and fastcgi, has anyone else encountered this problem? -- Eric Chamberlain -- You received this

Re: djangoproject.com inaccessible?

2010-08-02 Thread Steve Holden
On 8/2/2010 1:29 PM, creecode wrote: > Now working for me as well with no changes on my end. H.. > > On Aug 2, 9:42 am, Antoni Aloy wrote: > >> works for me! > > Toodle-lo.. > creecode > When is the Internet going to come with a

Re: Large static files served through django come out ~1kb short

2010-08-02 Thread ashwoods
try looking if there is something like that in the bugtracker, and if not, you can help a lot by filing a bug, if posible with some sample files. thx. cheers, ashley On Aug 2, 7:29 pm, Tom wrote: > I am using django.views.static.serve() from a fresh project. The only >

Re: Splitting LONGTEXT column to its own table?

2010-08-02 Thread Steve Holden
On 8/2/2010 12:39 PM, Antoni Aloy wrote: > 2010/8/2 Nick Arnett : >> I'm thinking that I could get a pretty good performance improvement on a >> couple of tables by moving their LONGTEXT columns into their own tables. >> Just wondering if there's anybody here who has done

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-08-02 Thread Steve Holden
Balu: This is not a Windows 7-specific issue. There are obviously differences between your Windows 7 and Windows XP environments that are cuasing you to see this message. As has already been pointed out, you need to make sure that the directory containing django-admin.py is on your PATH, and

using csrf with flash and ssl

2010-08-02 Thread ashaner
I have a django app with a particular view meant to receive file uploads via SWFupload. I've successfully used the trick of putting the csrf token in the post parameters and then copying that to the csrftoken cookie in the server code before the csrf middleware does its check. Over SSL it will

Indexing large CharFields with MySQL backend

2010-08-02 Thread Eric Chamberlain
Hello, In our model, we need to do lookups based on the user's XMPP JID. The JID can be up to 3071 characters long. The problem we have run into is that MySQL does not like to index columns that are that large. We are working on an implementation where we generate a hash and index the hash

Python question about subprocess.Popen() and stdout

2010-08-02 Thread Joshua Russo
I'm creating a wxPython application that the client can run to make sure the installation stack is functioning properly. I want to include the unit test processing in this application but I've run into some difficulties. An additional wrinkle I threw in was that I am using py2exe so they don't

Re: through/unique_together usage

2010-08-02 Thread Steve Holden
Yes. regards Steve On 8/2/2010 5:55 AM, Dave wrote: > Each patient can have multiple images. Each image can only be of a > single patient. Have I got the model wrong? Should it be a ForeignKey > in ImageRecord to Patient? > > On Jul 29, 6:06 pm, Dennis Kaarsemaker

Re: django_session not in "default" DB

2010-08-02 Thread Steve Holden
That was a simple typo in Dennis' reply. Use \ if model == 'Session' instead and that error will disappear. regards Steve On 7/30/2010 1:03 PM, Jocelo wrote: > Hi, Thanks for your previous reply. I'm still having problems... now > I'm getting the following error: > > NameError:

Large static files served through django come out ~1kb short

2010-08-02 Thread Tom
I am using django.views.static.serve() from a fresh project. The only change I made was based on this tutorial http://docs.djangoproject.com/en/dev/howto/static-files/ . When I download a large (60-75mb) 7zip file the size of the file is ~1kb smaller than the actual length. The downloaded size is

Re: djangoproject.com inaccessible?

2010-08-02 Thread creecode
Now working for me as well with no changes on my end. H.. On Aug 2, 9:42 am, Antoni Aloy wrote: > works for me! Toodle-lo.. creecode -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: djangoproject.com inaccessible?

2010-08-02 Thread Antoni Aloy
2010/8/2 creecode : > Hello all, > > djangoproject.com appears to be inaccessible to me.  Is anyone else > having problems?  Is anyone able to access it? > > Toodle-looo... > creecode > http://downforeveryoneorjustme.com/ works for me! -- Antoni Aloy López

Re: Splitting LONGTEXT column to its own table?

2010-08-02 Thread Antoni Aloy
2010/8/2 Nick Arnett : > I'm thinking that I could get a pretty good performance improvement on a > couple of tables by moving their LONGTEXT columns into their own tables. > Just wondering if there's anybody here who has done something like that - is > there a way to do

djangoproject.com inaccessible?

2010-08-02 Thread creecode
Hello all, djangoproject.com appears to be inaccessible to me. Is anyone else having problems? Is anyone able to access it? Toodle-looo... creecode -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Flexigrid

2010-08-02 Thread Ramesh
Hi Antoni, Thanks a lot for your quick reply, I will go through the links you listed. On Aug 2, 10:56 am, Antoni Aloy wrote: > Hi Ramesh, > > I haven't work with Flexigrid in my projects, but I did it with jqgrid > and as far I can see is quite the same: > > In the

Splitting LONGTEXT column to its own table?

2010-08-02 Thread Nick Arnett
I'm thinking that I could get a pretty good performance improvement on a couple of tables by moving their LONGTEXT columns into their own tables. Just wondering if there's anybody here who has done something like that - is there a way to do this transparently to Django, so I don't have to re-write

Logging user actions

2010-08-02 Thread vishy
Hi, I have a requirement to log all user actions like created new order,user logged in,logged out etc including user ip address.And,it should be displayed in admin section with admin logentries.Is there a module which I can use? What about reversion? thanks -- You received this message because

Re: return pk id on Form

2010-08-02 Thread alan-l
Thank you for the point in the right direction. In the end i now have: @models.permalink def get_absolute_url(self): return ('c_viewcontact', [str(self.id)]) class ContactForm(ModelForm): class Meta: model = Contacts fields = ('contact_type', 'firstname', 'surname',

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-08-02 Thread balu
Hi Jirka First of all let me thank you for replying to my question. I did as you said. But that also not working. If you don't mine please try this in Windows 7 operating system. Thank you Balu On Aug 1, 11:16 pm, Jirka Vejrazka wrote: > Hi Balu, > >    

Re: Flexigrid

2010-08-02 Thread Antoni Aloy
Hi Ramesh, I haven't work with Flexigrid in my projects, but I did it with jqgrid and as far I can see is quite the same: In the Flexigrid sample you have: $("#flex1").flexigrid ( { url: 'post2.php',

Re: Flexigrid

2010-08-02 Thread Ramesh
Hi Gonzalo, It looks like you are just showing me how to search on google which I already did but couldn't find the solution I was looking for. I am still looking forward for the help on flexigrid for my project. I really appreciate your help. Thanks! On Jul 30, 2:12 pm, Gonzalo Delgado

Re: RadioButton Form Validation

2010-08-02 Thread Evan Ferree
models.py RESPONDANT_CHOICES = ( ('Excellent', 'Excellent'), ('Good', 'Good'), ('Poor', 'Poor'), ) class Respondant(models.Model): key = models.CharField(max_length=8, blank=True, null=True, unique=True) create_date = models.DateTimeField('date created', auto_now_add=True)

Re: return pk id on Form

2010-08-02 Thread Daniel Roseman
On Aug 2, 3:27 pm, alan-l wrote: > Hi, > i have the below that im thought would be the best approach to have a > add contact page on my app: > > class ContactForm(ModelForm): >     class Meta: >         model = Contacts >         fields = ('contact_type',

renaming database constraint names

2010-08-02 Thread Shirley Cohen
Hi, I was wondering if anyone has ever tried to rename the database constraint names that are created by Django? In particular, I'm working with Oracle and would like to rename all the SYS_C* constraint names in my Django schema to something more descriptive. If anyone has any experience with

Re: RadioButton Form Validation

2010-08-02 Thread Daniel Roseman
On Aug 2, 2:46 pm, rupert wrote: > I have a form that validates all of the fields except for radio > buttons. If there is a radio button not selected, it will reset the > form. Any thoughts? Has anyone run into this before? Show some code... -- DR. -- You received this

return pk id on Form

2010-08-02 Thread alan-l
Hi, i have the below that im thought would be the best approach to have a add contact page on my app: class ContactForm(ModelForm): class Meta: model = Contacts fields = ('contact_type', 'firstname', 'surname', 'notes') def addcontact(request, request_id=0,

RadioButton Form Validation

2010-08-02 Thread rupert
I have a form that validates all of the fields except for radio buttons. If there is a radio button not selected, it will reset the form. Any thoughts? Has anyone run into this before? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Manual schema migration

2010-08-02 Thread derek
On Aug 2, 12:57 pm, Torsten Bronger wrote: > Hall chen! > > Does anybody know a tutorial for Django-related schema migration by > using the SQL console directly?  (Preferably PostgreSQL.)  We > evaluate South at the moment, but we'd like to have the low-level >

Re: Admin interface 1.2.1

2010-08-02 Thread galbourn
thank you very much, it was the same problem. Valérie. On 2 août, 13:27, Karen Tracey wrote: > On Mon, Aug 2, 2010 at 4:02 AM, galbourn wrote: > > Hello, > > > In version 1.2.1, on the admin interface on the form change_list.html, > > there is no

Re: moving to django 1.2.1

2010-08-02 Thread tiemonster
Thank you so much for the valuable feedback regarding my post. I value peer review, and take it very seriously. I've updated the article to attempt to address your concerns. Please review it at your convenience to ensure that your concerns are addressed appropriately.

Re: 502 Proxy Error trying to export PDF

2010-08-02 Thread marcoshernandez
this is my error log: [Mon Aug 02 04:46:10 2010] [error] [client 190.205.171.66] proxy: error reading status line from remote server 10.4.139.31, referer: http://foo.bar.com/reportes/guias/?operaciones=12=20= [Mon Aug 02 04:46:10 2010] [error] [client 190.205.171.66] proxy: Error reading from

Re: urlpattern problem !

2010-08-02 Thread yalda nasirian
tanx friends for your quickly and helpfull responds . On Mon, Aug 2, 2010 at 3:55 PM, Sameer Rahmani wrote: > oh my God you'r reading the old book . that book you was reading is > for legacy version of django > > > you should try this one http://www.djangobook.com/en/2.0/ >

Re: Admin interface 1.2.1

2010-08-02 Thread Karen Tracey
On Mon, Aug 2, 2010 at 4:02 AM, galbourn wrote: > Hello, > > In version 1.2.1, on the admin interface on the form change_list.html, > there is no check box above to select all records. > In addition, when you select a record, it does not change color > (yellow) as in

Re: urlpattern problem !

2010-08-02 Thread Sameer Rahmani
oh my God you'r reading the old book . that book you was reading is for legacy version of django you should try this one http://www.djangobook.com/en/2.0/ admin classes are different in django 1.x as jirka said too you should build an admin.py for each app. it is good to try #django and

Re: urlpattern problem !

2010-08-02 Thread yalda nasirian
thank you so much jirka On Mon, Aug 2, 2010 at 3:50 PM, yalda nasirian wrote: > dear sameer as you see in http://www.djangobook.com/en/1.0/chapter06/ . we > Still have not made but we add > > *class Admin:* > *pass* > to models.py ,tanx > > models.py > > >

Re: urlpattern problem !

2010-08-02 Thread yalda nasirian
dear sameer as you see in http://www.djangobook.com/en/1.0/chapter06/ . we Still have not made but we add *class Admin:* *pass* to models.py ,tanx models.py from django.db import models class Publisher(models.Model): name = models.CharField(max_length=30) address =

Re: urlpattern problem !

2010-08-02 Thread Jirka Vejrazka
> but when i login in my admin page i cant see all of my objects( like > Publisher, Author, ...) > http://www.djangobook.com/en/1.0/chapter06/ > i just have groups , users , sites . > can you help me Hi, the Django Book 1.0 is slightly outdated, the admin works slightly differently with

cx_Oracle not working (was: How to access a MySQL table in Django?)

2010-08-02 Thread Jirka Vejrazka
> yeah, i was able to find that exact thing yesterday, and it works and i am so > happy.  now i have one more problem, i cnat get oracle-cx to work. it says > that "no software installation was found" or something like that. i have the > python-mysql working but i cant seem to get the oracle

Re: urlpattern problem !

2010-08-02 Thread Sameer Rahmani
hmmm there is no problem with your urls.py the problem is in your admin.py , post one of your admin.py -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from

Re: drop table books_book

2010-08-02 Thread yalda nasirian
yes , i did all of these . i realy confused . can u send me template of url pattern ? tanx On Mon, Aug 2, 2010 at 3:36 PM, Sameer Rahmani wrote: > yeah , if you are iranian it's good to check out #django-ir IRC > channel in freenode server > > but about your problem > > did

urlpattern problem !

2010-08-02 Thread yalda.nasirian
i have an another problem my urlpattern is : from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^admin/', include('django.contrib.admin.urls')), ) even i try with this code again from django.conf.urls.defaults import * # Uncomment the next two lines to enable the

Re: drop table books_book

2010-08-02 Thread Sameer Rahmani
yeah , if you are iranian it's good to check out #django-ir IRC channel in freenode server but about your problem did you put your app name into INSTALLED_APPS in settings.py? did you create admin.py for your apps ? -- You received this message because you are subscribed to the Google Groups

Manual schema migration

2010-08-02 Thread Torsten Bronger
Hallöchen! Does anybody know a tutorial for Django-related schema migration by using the SQL console directly? (Preferably PostgreSQL.) We evaluate South at the moment, but we'd like to have the low-level knowledge as a fallback. Of course, general SQL knowledge can be assumed. It needn't be

Re: drop table books_book

2010-08-02 Thread yalda nasirian
sameer i have an another problem my urlpattern is : from django.conf.urls.defaults import * urlpatterns = patterns('', *(r'^admin/', include('django.contrib.admin.urls')),* ) i try with this again from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin:

Re: drop table books_book

2010-08-02 Thread Sameer Rahmani
np ;) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this

Re: drop table books_book

2010-08-02 Thread yalda nasirian
thank you so much sameer ! it works for me . On Mon, Aug 2, 2010 at 3:18 PM, yalda nasirian wrote: > tanx kenneth ! but when i run drop command i have syntax error , but i'm > sure i write command correctly . > > > > On Mon, Aug 2, 2010 at 3:14 PM, Kenneth Gonsalves

Re: drop table books_book

2010-08-02 Thread yalda nasirian
tanx kenneth ! but when i run drop command i have syntax error , but i'm sure i write command correctly . On Mon, Aug 2, 2010 at 3:14 PM, Kenneth Gonsalves wrote: > On Monday, August 02, 2010 04:05:16 pm yalda.nasirian wrote: > > CREATE INDEX "books_book_22dd9c39" ON

502 Proxy Error trying to export PDF

2010-08-02 Thread marcoshernandez
Hi. I'm using pisa (XHTML2PDF) for export the view results in a pdf The view is generated, a template is filled, then is passed to pisa and returned as a filestream. Later it's delivered via HTTP. It works fine for the most of the cases but I have a particular query that won't go out this way and

Re: drop table books_book

2010-08-02 Thread Sameer Rahmani
if you want to drop a table in your database you should run the DROP command in your database engine console not directly in linux shell for example : (mysql) $ mysql -u root -p password: > use DBNAME; > DROP TABLE books_book; -- You received this message because you are subscribed to the

Re: drop table books_book

2010-08-02 Thread Kenneth Gonsalves
On Monday, August 02, 2010 04:05:16 pm yalda.nasirian wrote: > CREATE INDEX "books_book_22dd9c39" ON "books_book" ("publisher_id"); > COMMIT; > $ python manage.py syncdb > Creating table books_publisher > Creating table books_author > Creating table books_book_authors > Creating table books_book >

Re: drop table books_book

2010-08-02 Thread yalda nasirian
in my shell On Mon, Aug 2, 2010 at 3:10 PM, Sameer Rahmani wrote: > where did you run that DROP command ? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to

Re: django-admin-tools

2010-08-02 Thread yalda nasirian
hi gnemis can you help me ? On Wed, Jul 28, 2010 at 10:54 AM, gnarmis wrote: > > Thanks for that link up there, David, solved my (similar, but not > really similar) problem. > Although this has me concerned about deployment issues... > -gnarmis > On Jun 1, 8:46 am, izi

Re: drop table books_book

2010-08-02 Thread Sameer Rahmani
where did you run that DROP command ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

drop table books_book

2010-08-02 Thread yalda.nasirian
hi when i run this command : DROP TABLE books_book; ^ in shell i have error SyntaxError: invalid syntax $ python manage.py validate 0 errors found $ python manage.py validate 0 errors found $ python manage.py sqlall books BEGIN;

Re: os.path

2010-08-02 Thread yalda nasirian
tanx On Mon, Aug 2, 2010 at 11:54 AM, Jirka Vejrazka wrote: > os.path is a standard Python module, you do have it already. > > Cheers > > Jirka > > > On 02/08/2010, yalda.nasirian wrote: > > hi > > > > note > > > > If you want to be a

Re: through/unique_together usage

2010-08-02 Thread Dave
No MySQL. But I found a bit of docs saying that this behaviour is expected: if you use through then that field cannot be automatically added to the admin pages. It suggested using an inline in these cases and that has worked, sort of :-). In fact, I'm beginning to suspect that my model design may

Re: Many to many ajax widget for admin

2010-08-02 Thread Carlos Ricardo Santos
Already tried to find a better approach without success, raw_id is now the best option. On 2 August 2010 10:54, Sævar Öfjörð wrote: > If someone is interested, > I just used raw_id_fields in my intermediary inline modeladmin. > > class AuthorshipInline(admin.TabularInline):

Re: where is my os.path

2010-08-02 Thread Carlos Ricardo Santos
So "import os" On 2 August 2010 05:57, yalda.nasirian wrote: > hi > when i type import sys or os i have error that unknown os > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email

Re: through/unique_together usage

2010-08-02 Thread Dave
Each patient can have multiple images. Each image can only be of a single patient. Have I got the model wrong? Should it be a ForeignKey in ImageRecord to Patient? On Jul 29, 6:06 pm, Dennis Kaarsemaker wrote: > On do, 2010-07-29 at 05:35 -0700, Dave wrote: > > > In my

Re: Many to many ajax widget for admin

2010-08-02 Thread Sævar Öfjörð
If someone is interested, I just used raw_id_fields in my intermediary inline modeladmin. class AuthorshipInline(admin.TabularInline): raw_id_fields = ('author',) This isn't exactly what I was going for, but it takes the really big select fields out of the picture. - Sævar On Jul 27, 5:24 

Error while saving custom form field

2010-08-02 Thread cyrux
I have a custom model field defined which works pretty fine when i use the python shell. It stores and retrieves the objects from the database as it should. I have been trying to use this model field in the admin form as a form field. in one of my models, this field is supposed to be the auto

Admin interface 1.2.1

2010-08-02 Thread galbourn
Hello, In version 1.2.1, on the admin interface on the form change_list.html, there is no check box above to select all records. In addition, when you select a record, it does not change color (yellow) as in version 1.1.1. Thank you for your help. Valerie. -- You received this message because

Re: os.path

2010-08-02 Thread Jirka Vejrazka
os.path is a standard Python module, you do have it already. Cheers Jirka On 02/08/2010, yalda.nasirian wrote: > hi > > note > > If you want to be a bit more flexible and decoupled, though, you can > take advantage of the fact that Django settings files are