Re: converting sql command to django api query

2008-12-28 Thread Alan
Thanks, this is a very interesting way. I will give a try. Cheers, Alan On Mon, Dec 29, 2008 at 04:48, join.toget...@gmail.com < join.toget...@gmail.com> wrote: > > In your model definition, you can specify choices for each field. >

Newbie question - Deploying Django apps

2008-12-28 Thread Leslie Maclachlan
Hi, I am using Eclipse editor to work with my django projects. Can anyone recommend a way to deploy my django apps to an Apache web server? Currently, I am manually copying the entire source folder to the correct location on my Apache server. It seems that there should be an easier way to keep

Template IDE

2008-12-28 Thread Vicky
how can we debug errors in templates? Are there any IDE for this? --~--~-~--~~~---~--~~ 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: A Django Comic Site Issues

2008-12-28 Thread tsop
Hello, Thanks for your reply Daniel, that along with setting ordering on the Comic model seems to have fixed it. Titus On Dec 28, 9:55 am, Daniel Roseman wrote: > On Dec 28, 5:35 am, tsop wrote: > > > > > Hey, > > I'm quite new to django but I

Re: Variables in templates

2008-12-28 Thread Jeff Anderson
Vicky wrote: > Is there any way to create a variable within the templates...? > You'll need to be more specific. What exactly are you trying to do? You can define anything you need in your view, and then pass it to the template. Logic belongs in the view. Templates are only there to put that

how to set up google docs-like sharing

2008-12-28 Thread Paul Franz
I'm trying to set up a system where you can create a document and add collaborators (well, watchers) similar to google docs. Here's my model right now: class Poll(models.Model): title = models.CharField(max_length="250") owner = models.ForeignKey(User, null=True,

Variables in templates

2008-12-28 Thread Vicky
Is there any way to create a variable within the templates...? --~--~-~--~~~---~--~~ 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

Re: wondering how to do something similar to save_model for inline.

2008-12-28 Thread Praveen
This is your database error.. On Dec 28, 8:32 am, Timboy wrote: > Great link. I was really excited to try it. > > Here is my new inline: > class rentalInline(admin.TabularInline): >     model= Rent >     extra = 3 >     raw_id_fields = ('movie',) >     exclude =

Please have a look, sub category field is not saving

2008-12-28 Thread Praveen
Hi all i am not able to save the entry of sub_cat field here is my model.py class MainCategory(models.Model): main_cat_code= models.CharField(max_length=20,primary_key=True) description = models.CharField(max_length = 50,) def __unicode__(self): return self.main_cat_code class

Re: converting sql command to django api query

2008-12-28 Thread join.toget...@gmail.com
In your model definition, you can specify choices for each field. http://docs.djangoproject.com/en/dev/topics/db/models/#field-options Create a list of (DB value, display value) tuples containing all the choices, then set the field's "choices" option to that list. Later, when you have your

Re: enumerate in templates

2008-12-28 Thread Vicky
ya that's what i need :) thanks a lot :) :) On Dec 28, 8:06 pm, Daniel Roseman wrote: > On Dec 27, 6:20 am, Vicky wrote: > > > Is there a way to access the previous value of a for loop in > > templates. Can anyone tell the template

Re: memory use in django database queries

2008-12-28 Thread join.toget...@gmail.com
Three things: 1: http://docs.djangoproject.com/en/dev/ref/models/querysets/#iterator 2: What you're trying to do can be done much more efficiently the following way: sum(SomeModel.objects.all().values_list('value')) 3: django 1.1 will have aggregation support, meaning you won't even need to do

How to populate a form field with a Select widget

2008-12-28 Thread Aaron Lee
I would like to populate a form field which uses a Select widget with choices in views.py. I understand I can pass the initial arg to the form but I couldn't find the correct value to pass. The choices is a list of tuple CHOICES = ( ('P', 'Pending'), ('A', 'Active'), ('D', 'Done')) Any hints?

custome tags, single model, multiple classes

2008-12-28 Thread garagefan
I've got a gallery model, with a Gallery class, and an ImageUpload class. in my custom tag i'm pulling in the Gallery to display a list of galleries in a side bar. this works fine. But, i want to randomly display an image associated with that gallery, which would be accessed through ImageUpload

Re: '.schema' is not recognized as an internal or external command, operable program or batch file

2008-12-28 Thread Jeff Hammerbacher
Hey, .schema is a command for the sqlite3 shell. If you have sqlite3 installed and have set DATABASE_ENGINE to sqlite3, type "sqlite3 " at your shell. is file name specified by DATABASE_NAME in settings.py. You should be able to issue the ".schema" command successfully from there. Regards,

'.schema' is not recognized as an internal or external command, operable program or batch file

2008-12-28 Thread mango7
I am new to django, and following the tutorial at: http://docs.djangoproject.com/en/dev/intro/tutorial01/?from=olddocs I got as far as creating and syncing a DB, but when I type .schema into my command prompt, I get: '.schema' is not recognized as an internal or external command, operable

Re: django i18n for google

2008-12-28 Thread James Bennett
On Sun, Dec 28, 2008 at 7:19 PM, Alessandro Ronchi wrote: > Django itselfs permits selecting the i18n language via POST. I think > it should be useful to add also a GET var to set the language, and a > localization middleware catches it. This has been debated to

Re: django i18n for google

2008-12-28 Thread Alessandro Ronchi
2008/12/27 Antoni Aloy : > You could create a url that links to your localized site so Google > would be able to crawl it, but I suppose that your site depens on > changing the language via POST, isn't it? > > I that case, you could write yourselve the code and allow

Re: link to a text file without "txt" extension

2008-12-28 Thread Alan
Thanks Jarek, it sounds true what you said because when I did this first implementation was in Zope. But I am not the admin. I will check with the admin here. Cheers, Alan 2008/12/28 Jarek Zgoda > > Wiadomość napisana w dniu 2008-12-28, o godz. 19:05, przez Alan: > > >

adding default inline items on a model/add page in the admin

2008-12-28 Thread John Beaver
Hi, I'm trying to figure out how to customize a model/add page so that it includes zero or more default items in an inline list. More specifically, the following code produces almost what I need, but I'd like to be able to add some default entries to the inline Roles list on (only) the

Re: image uploading via admin, and an error...

2008-12-28 Thread MrGecko
I find a way to install correctly PIL : http://www.unelectronlibre.info/tutoriels/python/installer_pil_sous_mac_osx.html Then, Django didnt bothered me anymore with this error. And the selftest.py joined with the PIL sources now pass without problems. I only had to install the .dmg, I didnt set

Re: Calculate and store the average rating

2008-12-28 Thread eldonp2
@Dave: It is not a 1-to1 as I would like each borrower to provide his own rating, and then compute the average ratings per book - to make recommendations for the highest rated books. Thanks for the example in the reply too. I will try out the SQL update shortly. @ Russ: Thanks too for the

Re: link to a text file without "txt" extension

2008-12-28 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-12-28, o godz. 19:05, przez Alan: > A external program generate files and I want to access then via > django. I have a file "report" and buit the link to it. But when I > click on the link to "report", instead of getting the "report" text > content showed by

link to a text file without "txt" extension

2008-12-28 Thread Alan
Hi List, So I have this situation: A external program generate files and I want to access then via django. I have a file "report" and buit the link to it. But when I click on the link to "report", instead of getting the "report" text content showed by my browser, I got a prompt to download it.

Re: MySQL deadlocking issues

2008-12-28 Thread Torsten Bronger
Hallöchen! Malcolm Tredinnick writes: > On Wed, 2008-11-19 at 10:21 +0900, Ian Lewis wrote: > >> I've run into the following error in a SQL DB envornment and was >> wondering if any one else had run into problems with Deadlocking >> with MySQL. What would be the proper way to handle this kind

Re: enumerate in templates

2008-12-28 Thread Daniel Roseman
On Dec 27, 6:20 am, Vicky wrote: > Is there a way to access the previous value of a for loop in > templates. Can anyone tell the template representation for the python > code like: > >                          for i,j in enumerate(item): >                         ... I

Re: A Django Comic Site Issues

2008-12-28 Thread Daniel Roseman
On Dec 28, 5:35 am, tsop wrote: > Hey, > I'm quite new to django but I ran into a small problem maybe someone > can shed some light onto: > > models.py > > class Comic(models.Model): >         title = models.CharField(max_length=80, help_text='Title of > comic.') >        

A Django Comic Site Issues

2008-12-28 Thread tsop
Hey, I'm quite new to django but I ran into a small problem maybe someone can shed some light onto: models.py class Comic(models.Model): title = models.CharField(max_length=80, help_text='Title of comic.') series = models.ForeignKey(ComicSeries, help_text='Which series comic

Re: Django Comments framework

2008-12-28 Thread Sean
Hello, I removed the preview button as it did not preview, it posted. To redirect the "post" add the following line to the comment form: where <> is what page you want to view after posting. Sean On Dec 27, 4:30 pm, stereoit wrote: > Hi, > I tried to add comments

HBase and Django

2008-12-28 Thread Mark Jarecki
Hi, I was wondering whether anyone has made any headway into getting HBase working with Django? I think the existence of such an option would be definite boon to the framework. Cheers Mark --~--~-~--~~~---~--~~ You received this message because you are

Re: Invalid block tag: 'get_comment_count'

2008-12-28 Thread Florian Lindner
Am 28.12.2008 um 00:42 schrieb Russell Keith-Magee: > > On Sun, Dec 28, 2008 at 12:27 AM, Florian Lindner > wrote: >> >> Hello, >> >> I'm trying to use the comment framework from Django 1.0.2. >> >> I've followed all the steps in >>