DateTimeField Validation Error

2010-07-26 Thread strayhand
I don't get why I'm getting a validation error with my code. I thought that all of the built in fields are referenced inside of "from django.db import models". Thanks for any help that you may offer. ERROR NameError: name 'DateTimeField' is not defined CODE #shifts.models.py from django.db

Stability of auto IDs

2010-07-26 Thread Torsten Bronger
Hallöchen! Currently, our Django app relies on the stability of various auto ID fields which are implicitly generated by Django/database backend. Is is better to have explicit ID fields for this or can one consider them stable? For example, many bitmap files on the DB server are connected with

Override QuerySet.none()

2010-07-26 Thread gs794
Hi all, I'm having trouble overriding QuerySet.none() (code below)... Works if I rename the method to almost anything but "none". class QuerySetManager(models.Manager): def get_query_set(self): return self.model.QuerySet(self.model) def __getattr__(self, name): return

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Joseph
hi all thanks for answering my question i already found the answer just dont do this it will work {% load customTags %} tks Joseph On Jul 27, 8:59 am, Joseph wrote: > thanks , but still doesnt work.. > > On Jul 27, 8:48 am, Karen Tracey wrote: > > >

Re: Many to many ajax widget for admin

2010-07-26 Thread ringemup
You might want to check out grappelli and its Related Lookups feature: http://code.google.com/p/django-grappelli/ On Jul 26, 4:30 pm, Sævar Öfjörð wrote: > Hi > > I have some models (Song and Author) that are related through an > intermediary model (Authorship) like this:

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Joseph
thanks , but still doesnt work.. On Jul 27, 8:48 am, Karen Tracey wrote: > On Mon, Jul 26, 2010 at 9:18 PM, Joseph wrote: > > hi > > the level of directory(named templateTags) is same with the model.py > > and main.py > > and i put both __init__.py

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Karen Tracey
On Mon, Jul 26, 2010 at 9:18 PM, Joseph wrote: > hi > the level of directory(named templateTags) is same with the model.py > and main.py > and i put both __init__.py customTags.py and under templateTags > > for sure the name __init__.py is correct > > i run on AppEngine

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Joseph
hi the level of directory(named templateTags) is same with the model.py and main.py and i put both __init__.py customTags.py and under templateTags for sure the name __init__.py is correct i run on AppEngine not Django would u tell me more detail about this and thanks answering my question

Re: No module named site - error deploying a django-jython war in tomcat

2010-07-26 Thread Jose Flores
Thanks Tim A workaround while the new beta is released is to manually update de web.xml defining the python.home variable, and creating a pth file pointing the project being deployed. I think a fix is needed for the war.py in order to doing those settings. On Jul 16, 4:36 pm, Tim Sawyer

Re: errors serving text files using templates and static files

2010-07-26 Thread Josh Boon
Oops, swapped it and it still didn't work. Right now I have it writing to a file and then redirecting and having Apache serve the file which works. My code looks like this: def bootmenu(request, username): user = User.objects.get(username=username) user_bootimage_list =

Re: errors serving text files using templates and static files

2010-07-26 Thread Dennis Kaarsemaker
On ma, 2010-07-26 at 09:21 -0700, Josh wrote: > return HttpResponse(menu, mimetype="plain/text") > > What makes Django's text serving different? What can I do to > troubleshoot this issue further? Am I just missing something about > how text files are served? The correct mimetype is

errors serving text files using templates and static files

2010-07-26 Thread Josh
Good morning, I've been writing a Django app to create a dynamic net boot program to boot configs created by users from a web interface using a tool called gPXE. I've exhausted my troubleshooting methods and can't seem to figure out why gPXE can boot from a static file served directly from

Many to many ajax widget for admin

2010-07-26 Thread Sævar Öfjörð
Hi I have some models (Song and Author) that are related through an intermediary model (Authorship) like this: class Song(models.Model) authors = models.ManyToManyField('Author', through='Authorship') class Author(models.Model) name = models.CharField(max_length=255) class

Re: single point of entry to a webpage

2010-07-26 Thread Scott Gould
I often cringe it when people trot out the "read the docs" line, but that's honestly what it comes down to in this case. An app isn't some sacred walled city. Just write a template tag, import whatever you need from whichever apps they belong to, and stick it on the page. But before you do that,

Re: Trying to customize a form and make it look like my design

2010-07-26 Thread Antoni Aloy
2010/7/26 reduxdj : > for instance, i need to nest certain form-fields inside divs... The > automatic form {{form as p}}, seems to be a little too constraining. > How can I create a form and customize the template. I just need to see > a simple example of how to use a

[SOLVED]: Caught TypeError while rendering: unhashable type: 'dict'

2010-07-26 Thread Colleen A Josephson
Sorry about the double e-mail, not sure what happened there. I ended up fixing the issue myself; I wasn't fully understanding the structure of patterns() in urls.py. I moved the 'SSL': True into the other dictionary so the line now looks like: (r'^login/', 'django.contrib.auth.views.login',

Caught TypeError while rendering: unhashable type: 'dict'

2010-07-26 Thread Colleen A Josephson
I'm trying to use the SSLMiddleware. I have a login page whose urlconf is: (r'^login/', 'django.contrib.auth.views.login', {'template_name': 'reg\ istration/login.html'}, {'SSL' : True}), When I go to that page, I get the error: TemplateSyntaxError at /login/ Caught TypeError while rendering:

Caught TypeError while rendering: unhashable type: 'dict'

2010-07-26 Thread Colleen A Josephson
I'm trying to use the SSLMiddleware. I have a login page whose urlconf is: (r'^login/', 'django.contrib.auth.views.login', {'template_name': 'reg\ istration/login.html'}, {'SSL' : True}), When I go to that page, I get the error: TemplateSyntaxError at /login/ Caught TypeError while rendering:

Trying to customize a form and make it look like my design

2010-07-26 Thread reduxdj
for instance, i need to nest certain form-fields inside divs... The automatic form {{form as p}}, seems to be a little too constraining. How can I create a form and customize the template. I just need to see a simple example of how to use a customized form template with fields and labels already

Re: Inline formset when pk doesn't exist

2010-07-26 Thread cerberos
I've managed to solve my problem. view item_form = ItemForm() ImageFormSet = formset_factory(ImageForm) image_formset = ImageFormSet() template (I'm using uni_form in the template but it's no different) {{ image_formset.management_form }} {{

Inline formset when pk doesn't exist

2010-07-26 Thread cerberos
I have 2 models class Item(models.Model): fields here class ItemImage(models.Model): item = models.ForeignKey('Item', null=True, blank=True, related_name='images') I want a single 'form' where a user can add an Item and an ItemImage (actually many images but that's

Re: What goes in 500.html?

2010-07-26 Thread Michael Hipp
Thanks for a helpful and complete answer, David. Michael On 7/26/2010 6:24 AM, David De La Harpe Golden wrote: On 24/07/10 20:14, Michael Hipp wrote: What should go in a proper 500.html page? As little as you can get away with; it's for when your server has screwed up. However, you probably

Re: Filtering within a ModelForm

2010-07-26 Thread Casey S. Greene
Does anyone have a hint for this (or an idea of where to get started in the documentation)? This seems relatively simple so my best guess is that there is something that I am just missing. Thanks! -- Casey On 07/22/2010 10:16 AM, Casey S. Greene wrote: I am trying to figure out a

Re: setting intial value for choicefield in admin panel

2010-07-26 Thread Condor Chou
On 7/26/10 4:08 AM, Daniel Roseman wrote: On Jul 26, 8:49 am, gondor wrote: I am using admin panel and using get_form to retrieve one of my table objects. I have a choicefield in this object but I don't know how to set the default. I have saw numerous examples of

Re: single point of entry to a webpage

2010-07-26 Thread owidjaya
how do i write custom template tag that is available to all my apps. not tied to a particular app? On Jul 26, 7:05 am, bruno desthuilliers wrote: > On 25 juil, 00:25, owidjaya wrote: > > > if i have a page with sections say the home page. It

HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-26 Thread etone
Hi there, I'm trying to sent a HTTP POST from a client application to my Django app. Django does indeed receive the HTTP POST as I do hit _HandleRequest(), however it returns a 403 Forbidden, instead of hitting my handler function. I experimented and sent a HTTP GET from my client application

Re: Custom admin input app

2010-07-26 Thread Nick
Completely missed that section. You are always very helpful, Daniel. Thank you. On Jul 26, 10:08 am, Daniel Roseman wrote: > On Jul 26, 3:56 pm, Nick wrote: > > > Has anyone heard of, see, or used an app that would transform the > > table view of the

Re: Custom admin input app

2010-07-26 Thread Daniel Roseman
On Jul 26, 3:56 pm, Nick wrote: > Has anyone heard of, see, or used an app that would transform the > table view of the admin into a data entry point, basically jumping the > need to click through to individual entries in order to edit them? This is built-in, to an extent -

Custom admin input app

2010-07-26 Thread Nick
Has anyone heard of, see, or used an app that would transform the table view of the admin into a data entry point, basically jumping the need to click through to individual entries in order to edit them? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: single point of entry to a webpage

2010-07-26 Thread bruno desthuilliers
On 25 juil, 00:25, owidjaya wrote: > if i have a page with sections say the home page. It has section for > news, it has section for blog, comments and etc. > I have apps for every one of those section. Now how do i add the > output of the view for each of those apps on the

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Daniel Roseman
On Jul 26, 1:56 pm, Joseph wrote: > hi > im a newbie if u know please answer me > i just follow steps of django   > websitehttp://www.djangoproject.com/documentation/0.96/templates_python/ > > create a directory under inside has two file _init_.py and > customTags.py > >

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Bill Freeman
It's a bit hard to tell in the browser on this webmail account, but I think that you have the wrong number of underscores before and after "init" in "__init__.py". There must be two underscore characters before the word "init" and two after it, before the ".py". The tutorial at python.org really

Custom method to query external db

2010-07-26 Thread PieterB
In one of my models, 3 values refer to unique ID's in an external db I want to query for a sum for each ID. What's the best way to query this external MySQL db? Example == Model: - class Test(models.Model): name = models.CharField(max_length=10) id1 =

Re: how to create a custom django template filter(please help)

2010-07-26 Thread Steve Holden
On 7/26/2010 1:56 PM, Joseph wrote: > hi > im a newbie if u know please answer me > i just follow steps of django website > http://www.djangoproject.com/documentation/0.96/templates_python/ > > create a directory under inside has two file _init_.py and > customTags.py > > content of

how to create a custom django template filter(please help)

2010-07-26 Thread Joseph
hi im a newbie if u know please answer me i just follow steps of django website http://www.djangoproject.com/documentation/0.96/templates_python/ create a directory under inside has two file _init_.py and customTags.py content of customTags.py from google.appengine.ext.webapp import template

Re: plupload + django

2010-07-26 Thread Yuri Egorov
Igor, I am using plupload in one project. I don't have it in a pluggable app unfortunatelly, but can share my knowledge. Not sure that uploading images using _only_ in-memory files is the right way (for sure it depends on your project and your audience and your hardware etc). I am using only

Re: Help with localization [SOLVED]

2010-07-26 Thread Martin Tiršel
On Mon, 26 Jul 2010 03:46:10 +0200, Lachlan Musicman wrote: On Mon, Jul 26, 2010 at 11:16, Martin Tiršel wrote: Gah, my eyes were closed. Have you also added the appropriate Middleware product? As you see here:

Re: Working with URL Fields in django test.

2010-07-26 Thread Steve Holden
On 2/9/2009 5:14 AM, Vitaly Babiy wrote: > Hello, > > If I am using a URLField in form and it set to verify the URL, if I > write tests for the code and in the post I push a url like > /http:google.com /it will fail if the computer is > off-line. Is there a good fix for this?

Re: What goes in 500.html?

2010-07-26 Thread David De La Harpe Golden
On 24/07/10 20:14, Michael Hipp wrote: > What should go in a proper 500.html page? As little as you can get away with; it's for when your server has screwed up. However, you probably want to make it distinguishable from the apache-level 500 page, in a manner you can ask a user reporting a

Re: setting intial value for choicefield in admin panel

2010-07-26 Thread Daniel Roseman
On Jul 26, 8:49 am, gondor wrote: > I am using admin panel and using get_form to retrieve one of my table > objects.  I have a choicefield in this object but I don't know how to > set the default.   I have saw numerous examples of using the > following: > > class

Re: DatabaseError: subquery has too many columns

2010-07-26 Thread gs794
The query it produces is pretty close to what you'd expect though - apart from the extra column. The reason i'd like it to work is because i'm applying filters based on context using some complicated logic that sometimes applies the "none" method. Should I ticket this? In terms of a quick hack,

Re: django + serving static CSS

2010-07-26 Thread Thomas
Thanks Alex that got it working! -- 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

Re: obtaining pid of child process

2010-07-26 Thread Baurzhan Ismagulov
On Sun, Jul 25, 2010 at 08:28:54PM -0700, tazimk wrote: > I want to obtain pid of iostat command or the command executed using > multiprocessing > module > > When I execute : > > d.pid it gives me pid of subshell in which this command is running . One way could be to traverse the list of all

most appropriate model to save a dynamic form

2010-07-26 Thread pinco
Hi guys, I'm going to develop a survey application with the following functionalities: •An administrator defines a custom form through a form builder interface to carry out a survey. The form can be composed of an arbitrary number of questions (the form of text boxes, radio and check boxes

setting intial value for choicefield in admin panel

2010-07-26 Thread gondor
I am using admin panel and using get_form to retrieve one of my table objects. I have a choicefield in this object but I don't know how to set the default. I have saw numerous examples of using the following: class MyAdmin(admin.ModelAdmin): list_display = ('rank', 'name') def

Re: Demonstrate Development Server

2010-07-26 Thread Mykola Lys
You probably should check the Fedora firewall settings. laso check server logs to check where request is blocked to this port (8000). Looks like it closed by default. Simplest way to stop Apache and run your Django site on http 80 port like: 0.0.0.0:80 On 24 Лип, 21:30, kostia