Re: Preserving pretty HTML output

2008-12-03 Thread Tonne
Thank you for the detailed response, Malcolm. I wasn't aware of the complexities of the issue and understand better now why it is the way it is. It was something that was really bugging me, but I feel like I can let it go now :) I'm not skilled enough in Python to take a crack at solving the prob

Re: Query API: get all users without a group

2008-12-03 Thread Thomas Guettler
Filip Wasilewski schrieb: > On 2 Gru, 16:45, Thomas Guettler <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I want to get all objects where the corresponding many-to-many field is >> empty. >> >> Example: get all users without a group >> > [...] > > The preferred solution is using the `isnull`

Re: how to create json from template?

2008-12-03 Thread Viktor
thanks V On dec. 3, 07:49, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Wed, Dec 3, 2008 at 1:17 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > > To trim last colon wrap it with if statement: > > > {% if forloop.revcounter0 %},{% endif %} > > You can also do: > > {% if not forloop.last %},{% e

Re: How to create and send a pdf attachment

2008-12-03 Thread Thomas Guettler
Epinephrine schrieb: > Does anyone have a code sample that shows how to create a pdf document > and then, without saving that document to disk, email it as an > attachment? > > I am using the ReportLab PDF library at the platypus level for pdf > creation. > > For emailing, I expect to use Django's

sorting and grouping problem

2008-12-03 Thread Vokial
Hello, i have a sorting and grouping problem: This is the situation: the app i'm working on has to sort cinemas, cinema shows, movies and rooms In a model "Shows" i stored each data about which cinema, which room, what time and which film..so now i have a great number of show objects to sort in o

Re: change i18n language through hyperlinks

2008-12-03 Thread Ozgur Odabasi
wow this is dangerous! Changes language settings for all users ;P But I couldnt unerstand how session and cookie frameworks works, documented examples doesn't work... On Dec 3, 6:56 am, Ozgur Odabasi <[EMAIL PROTECTED]> wrote: > try this > > def set_language(request, lang_code): >         next =

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-12-03 Thread rcoup
Hi, On Dec 3, 5:21 pm, Andre P LeBlanc <[EMAIL PROTECTED]> wrote: > Confirmed also. only happens on my 64-bit machine, and is not related > to apache at all as I can reproduce it faithfully in ipython. > I tried pretty hard to replicate it in the console and couldn't - none of our unit tests cra

Question about i18n

2008-12-03 Thread Elvis Stansvik
Hello django-users, first post to this list :) I often use the i18n support of Django in my projects, and I have a small annoyance/problem that maybe someone can help me with. If I decide to customize e.g. admin/index.html, by copying it over from django to my project, strings in that template s

Re: replacing a contrib class

2008-12-03 Thread Sandro
Use it in the User class place , What I want to avoid is patching the user source code. Is there any way to do this ? Sandro On Dec 2, 7:33 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > I did considered , but I could not see how to do it , the model I want > > to inherit is from > > contrib.

Re: Many-to-Many to exists table

2008-12-03 Thread nucles
Thank you Thomas for your feedback! We need a Many-To-Many Relation not to "group", but to "user_auth_group". I try to draw the desirable result: user --- user_auth_group group | | user_auth_group_area

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-12-03 Thread Justin Bronn
> "The same problem [segfault] could afflict any python package that > uses Ctypes on 64-bit systems without explicitly marking argument and > return types. " > > Looking back through the modwsgi thread and this one, everyone's on > 64bit, except the CentOS guy who said it worked ok on 32bit but n

Re: replacing a contrib class

2008-12-03 Thread Logan Chow
Hi Rajesh, That's the way I did. But I am wondering how I can hide the Users in admin site? Thanks. Logan On Dec 3, 5:33 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > I did considered , but I could not see how to do it , the model I want > > to inherit is from > > contrib.Users an

about tutorial

2008-12-03 Thread Alan
Hi, so I did the tutorial and did a simple modification in order to get 'polls' views and 'admin' view too but I am failing. It's that: for mysite/urls.py: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/(.*)'

django-tagging encoding errors

2008-12-03 Thread Alex Jonsson
Guys, I'm in trouble. I'm using the django-tagging application with a Swedish news application. It generally works, but there's one big problem which has taken me forever to solve. I've concluded that the issue lies in the http://django-tagging.googlecode.com/svn/trunk/tagging/models.py file. If

Re: about tutorial

2008-12-03 Thread bruno desthuilliers
On 3 déc, 13:22, Alan <[EMAIL PROTECTED]> wrote: > Hi, so I did the tutorial and did a simple modification in order to > get 'polls' views and 'admin' view too but I am failing. > > It's that: > > for mysite/urls.py: > from django.conf.urls.defaults import * > from django.contrib import admin > ad

ForeignKey value return from web page

2008-12-03 Thread Peter Bailey
I am trying to use ForeignKey data returned from a page and view, and am having trouble. I am missing something fundamental I think. Say I have 2 models class TopModel(models.Model): name = models.CharField(max_length=50) db_type = models.CharField(max_length=1, choices=STATUS_DB

Re: about tutorial

2008-12-03 Thread Alan
In fact I found the problem. If I had finished part 4 of the tutorial I would have any issue. Method 'vote' is created there and now everything works fine. Sorry for being hurry. Cheers, Alan On Wed, Dec 3, 2008 at 15:24, bruno desthuilliers < [EMAIL PROTECTED]> wrote: > > On 3 déc, 13:22, Alan

Re: replacing a contrib class

2008-12-03 Thread Rajesh Dhawan
On Dec 3, 8:47 am, Logan Chow <[EMAIL PROTECTED]> wrote: > Hi Rajesh, >     That's the way I did. >     But I am wondering how I can hide the Users in admin site? You can unregister the default User model from the admin: from django.contrib import admin from django.contrib.admin.sites import N

admin TemplateSyntaxError using Django 1.1

2008-12-03 Thread JonathanB
I've been following the tutorial on the Django site, except that I'm inserting the app I'm developing in place of the tutorial app data. I received this error after logging into the admin site. TemplateSyntaxError at /admin/ Caught an exception while rendering: no such table: django_admin_log O

Authentication session timeout

2008-12-03 Thread mdp
If I enable session timeouts via settings.SESSION_COOKIE_AGE I get the following when accessing my login/logout page: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.s

Re: ForeignKey value return from web page

2008-12-03 Thread Daniel Roseman
On Dec 3, 3:25 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > I am trying to use ForeignKey data returned from a page and view, and > am having trouble. I am missing something fundamental I think. > > Say I have 2 models > > class TopModel(models.Model): >         name = models.CharField(max_length

Re: admin TemplateSyntaxError using Django 1.1

2008-12-03 Thread Daniel Roseman
On Dec 3, 4:12 pm, JonathanB <[EMAIL PROTECTED]> wrote: > I've been following the tutorial on the Django site, except that I'm > inserting the app I'm developing in place of the tutorial app data. I > received this error after logging into the admin site. > > TemplateSyntaxError at /admin/ > Cau

Re: Preserving pretty HTML output

2008-12-03 Thread adelevie
You may also want to look at BeautifulSoup. It is an html parser writter for python. It has a method called soup.prettify() in which "soup" is a string of html. prettify() outputs cleanly formatted html. Approximation: soup = "titlehello world" soup.pretiffy() >>> t

Re: replacing a contrib class

2008-12-03 Thread Logan Chow
Thanks a lot, Rajesh. Excuse me, but one more question: When I edit/add the inherited class (for example: Student), everything goes well but the password field. It is not user friendly. So I try the following: from django.contrib.auth.admin import UserAdmin admin.site.register(Student, UserAd

Re: Non-displayed fields on admin form get overwritten

2008-12-03 Thread Rajesh Dhawan
On Dec 2, 10:03 pm, borntonetwork <[EMAIL PROTECTED]> wrote: > Thank you for your reply, Rajesh. The two fields in question are > actually "pending_referrer_name" and "pending_referrer_email". In the > admin class code below, I include them in the fields attribute. > However, initially I did not

Re: admin TemplateSyntaxError using Django 1.1

2008-12-03 Thread JonathanB
Oh! Duh... I must have missed that part in the 5 or 10 time I read through the tutorial. Funny what you don't see when you're not looking for it. Thanks! On Dec 3, 11:25 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 3, 4:12 pm, JonathanB <[EMAIL PROTECTED]> wrote: > > > I've been followi

Re: ForeignKey value return from web page

2008-12-03 Thread Peter Bailey
Sorry for babbling Daniel :-) , my use of all this terminology is still growing (I hope). Anyway, I sorted it out thanks to your brief description above. Trying to do too much twisting and turning lol. Cheers On Dec 3, 11:24 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Dec 3, 3:25 pm, Pet

Re: replacing a contrib class

2008-12-03 Thread Rajesh Dhawan
On Dec 3, 11:37 am, Logan Chow <[EMAIL PROTECTED]> wrote: > Thanks a lot, Rajesh. > Excuse me, but one more question: > When I edit/add the inherited class (for example: Student), > everything goes well but the password field. It is not user friendly. > So I try the following: > > from django.

Disappearing inline in admin

2008-12-03 Thread [EMAIL PROTECTED]
Very strange. This is the admin for the model: from django.contrib import admin from articles.models import * class SectionInline(admin.StackedInline): model = section class ArticleAdmin(admin.ModelAdmin): model=Article filter_horizontal = ('related_articles',) prepopulated_fiel

Re: admin css, is this still supported?

2008-12-03 Thread John M
Thanks Malcom, I'll do what I can On Dec 2, 8:05 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-12-02 at 08:21 -0800, John M wrote: > > I've searched for theadminCSSguide, and found it deprecated (http:// > > docs.djangoproject.com/en/dev/obsolete/admin-css/?from=olddocs), is >

Webservers, Django thread-safeness, etc.

2008-12-03 Thread SteveB
Deploying Django behind Apache is great for real web apps, but I also use Django for Desktop apps that employ a web browser as the UI. In this situation, a distribution package that depends on Apache is not an option (too much for end users to manage), and the Django development server's weakness

Re: Disappearing inline in admin

2008-12-03 Thread [EMAIL PROTECTED]
On Dec 3, 10:49 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > When I go to Article, the sections are there, inline, as they should > be. When I SAVE, all the sections disappear. Suggestions? Turns out there was a unicode error in the inline. Maybe it will help someone else somewhere dow

Weird Windows issue

2008-12-03 Thread Ace
Hi, I am fairly new to python and I am trying to get django running propertly. if I type django-admin.py startproject mysite I keep getting the following message. Type 'django-admin.py help' for usage. whereas if I type django-admin.pyc startproject mysite , it works. I have looked at the fi

Possible to use raw_admin_fields with inlineformset_factory for a create page?

2008-12-03 Thread Paul Childs
Hi folks, I am a newforms newbie who is currently porting a .96 project over to 1.0 I have been trying to coerce the examples in the Django documentation to accommodate creating a "Document" . I have three models: Document, DocPart --> These are in the doc module. DocPart is an intermediary Par

More User/Profile troubles

2008-12-03 Thread [EMAIL PROTECTED]
Hi all, I have another newbie question. The user registration + profiles seems to always be giving me a lot of trouble, I think Im nearly there but Im sort of stuck at the moment and not sure how to proceed. I am having trouble setting a user profile that is hooked up to the user all in one page.

Re: Webservers, Django thread-safeness, etc.

2008-12-03 Thread James Bennett
On Wed, Dec 3, 2008 at 11:45 AM, SteveB <[EMAIL PROTECTED]> wrote: > I've had positive experiences with the standalone CherryPy webserver > Although I can't prove it, I'm suspicious that the problem may be that > Django is not thread safe. Can anyone state for a fact that it is > safe to use Djan

Re: More User/Profile troubles

2008-12-03 Thread Brian Neal
On Dec 3, 12:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > ... > And here is my view for my signup page - > > def signup(request): >     if request.method == 'POST': >         form = UserCreationForm(request.POST) >         extraform =  CustomProfileForm(request.POST) >         if form.i

Re: django table locking

2008-12-03 Thread msoulier
On Nov 18, 7:46 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Django doesn't do any explicit table locking, although there are > transactions involved. However, that shouldn't be affecting this. So Django is not safe to use in a concurrent environment? Well, it is if you don't mind two user

Re: django-tagging encoding errors

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 10:14 AM, Alex Jonsson <[EMAIL PROTECTED]>wrote: > > Guys, I'm in trouble. > > I'm using the django-tagging application with a Swedish news > application. It generally works, but there's one big problem which has > taken me forever to solve. > > I've concluded that the issue

Re: Authentication session timeout

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 11:09 AM, mdp <[EMAIL PROTECTED]> wrote: > > If I enable session timeouts via settings.SESSION_COOKIE_AGE I get the > following when accessing my login/logout page: > > Traceback (most recent call last): > > File "/usr/lib/python2.5/site-packages/django/core/servers/ > base

Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Hey there, I am trying to figure out how to solve this: I have created a new model called GroupLevels to extend the already existing Group model by django.contrib.auth.models.group. I wish to have the GroupLevels inline with the Group Model in the admin panel. I have attempted to do this via: cl

Re: How to delete template fragment cache?

2008-12-03 Thread Nathaniel Whiteinge
On Dec 3, 12:37 am, Bartek SQ9MEV <[EMAIL PROTECTED]> wrote: > I know I should use cache.delete('a'), but how can I get key for > particular fragment? The key is 'fragment_name:additional:arguments:seperated:by:colons'. > What is better idea? Use signals (I do not know too mouch about them > yet

Re: Adding Model Inline with Group Model

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 2:29 PM, VoiDeT <[EMAIL PROTECTED]> wrote: > > Hey there, > > I am trying to figure out how to solve this: > I have created a new model called GroupLevels to extend the already > existing Group model by django.contrib.auth.models.group. I wish to > have the GroupLevels inlin

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-12-03 Thread Andre P LeBlanc
I had a large table of zip & postal codes which always crashed after about 20 minutes of geocoding them in the ipython shell, i did the same thing several times on the same os, but on a 32-bit machine with no issues. running under mod-python or mod-wsgi on the 64-bit box also seems to randomly th

Re: Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Hi Karen, Thanks alot for your quick reply! Indeed the admin.site.register(Group, GroupAdmin) was meant to write as admin.site.register(GroupLevels, GroupAdmin). However when i do this it doesn't display it inline, instead merely throws back an error saying Group doesn't have a foreignkey to Grou

Re: How to create and send a pdf attachment

2008-12-03 Thread Epinephrine
Thanks. That is the outline of what I want to do; what I need now is specifics: how to create the document and pass it successfully (MIME, etc) to the attach method. On Dec 3, 12:59 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Epinephrine schrieb:> Does anyone have a code sample that shows h

Re: forms and modelform

2008-12-03 Thread grahamu
Buddy, I found this, you might give it a try. http://www.djangosnippets.org/snippets/703/ Graham On Nov 28, 9:59 am, Buddy <[EMAIL PROTECTED]> wrote: > Yes, I try it before to my ask here. I get error if use likethis > (class B(forms.ModelForm, A): > > ### > TypeError at /A/ > > Error when cal

Re: django-tagging encoding errors

2008-12-03 Thread Alex Jonsson
Karen, I thank you a million times over. You have no idea how many hours I've spent on this issue. :) I got it working by using exactly the method you specified. Finally I'll be able to get some sleep at night! Take care, Alex On Dec 3, 8:18 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On W

HttpResponse.set_cookie defaults?

2008-12-03 Thread John Boxall
>From the documentation it's not obivous what the defaults are for the set_cookie() function. http://docs.djangoproject.com/en/dev/ref/request-response/?from=olddocs#django.http.HttpResponse.set_cookie I've read about the various django SESSION_COOKIE_* settings: http://docs.djangoproject.com/en/

open source project management app that uses django?

2008-12-03 Thread Margie
Hi everyone, I would like to create a django project managment web app to be used internally in my company. I am a software developer, but have little experience with web apps other than my recent work going through the sams django tutorial book. I'm wondering if anyone knows of any open source

Re: Webservers, Django thread-safeness, etc.

2008-12-03 Thread Graham Dumpleton
On Dec 4, 5:25 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Dec 3, 2008 at 11:45 AM, SteveB <[EMAIL PROTECTED]> wrote: > > I've had positive experiences with the standalone CherryPy webserver > > Although I can't prove it, I'm suspicious that the problem may be that > > Django is not

Re: Adding Model Inline with Group Model

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 2:46 PM, VoiDeT <[EMAIL PROTECTED]> wrote: > > Hi Karen, > > Thanks alot for your quick reply! > Indeed the admin.site.register(Group, GroupAdmin) was meant to write > as admin.site.register(GroupLevels, GroupAdmin). However when i do > this it doesn't display it inline, ins

Re: django-tagging encoding errors

2008-12-03 Thread Karen Tracey
Glad to help. Out of curiosity, where are you deploying that your production server has only Python 2.3? There's been a conversation over on the developer's list about when to drop support for Python 2.3 in Django, and the general feeling seems to be that 2.3 ought to be getting pretty rarely see

No module named MySQLdb

2008-12-03 Thread Udbhav
I installed Django and started my project on a server running Plesk. I've set up my vhost.conf as follows: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE twinsister.settings PythonOption django.root /mysite

Solution for use Django with Ejabberd ?

2008-12-03 Thread E
I want to use my django website with chat system ( ejabberd ). I don't know how to help me :( --~--~-~--~~~---~--~~ 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@g

Re: Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Hey Karen, I have the setup as you have posted above, however i neither see GroupLevels model or the GroupLevels model inline with the Groups admin section. Indeed i am trying to get the GroupLevels model to display where the Groups section is in admin, however i have tried both scenarios and nei

Re: Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Hey Karen, I have tried this scenario above, however the GroupLevels does not show inline with the Groups Model in Admin. I don't understand why not, no errors, just simply does not display. I have also tried to inline the Groups Model into the GroupLevels Model yet i get an error saying that Gro

Re: Adding Model Inline with Group Model

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 7:08 PM, VoiDeT <[EMAIL PROTECTED]> wrote: > > Hey Karen, > > I have tried this scenario above, however the GroupLevels does not > show inline with the Groups Model in Admin. I don't understand why > not, no errors, just simply does not display. I have also tried to > inline

Re: Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Excellent! That worked fine, i guess i had to unregister it first and then dump my code into the admin.py file. However now the Group is a multiple select widget whereas before it would use a widget that i could add group permissions and take them away via an arrow to two neighbouring multiple sel

Re: HttpResponse.set_cookie defaults?

2008-12-03 Thread John Boxall
To answer my own question - the SESSION_COOKIE_* variables are not used in set_cookie. You'll have to pass in these things yourself! John On Dec 3, 3:02 pm, John Boxall <[EMAIL PROTECTED]> wrote: > From the documentation it's not obivous what the defaults are for the > set_cookie() > function.

How construct specific complex queries?

2008-12-03 Thread Zeroth
I'm trying to construct complex queries, to better use the database (fewer hits, less slowdown). The models: List model, has a boolean called Public. Item model, is related to the List model via foreign key. Visibility model, is related to the Item model via foreign key, and has information like

Re: No module named MySQLdb

2008-12-03 Thread Brian Neal
On Dec 3, 5:54 pm, Udbhav <[EMAIL PROTECTED]> wrote: > > Whenever I point my browser at twinsistermusic.com/mysite/ I get the > following error: > > ImproperlyConfigured: Error loading MySQLdb module: No module named > MySQLdb > > Now, I'm pretty sure I installed MySQLdb correctly, as I was able t

Re: Adding Model Inline with Group Model

2008-12-03 Thread Karen Tracey
On Wed, Dec 3, 2008 at 8:04 PM, VoiDeT <[EMAIL PROTECTED]> wrote: > > Excellent! > That worked fine, i guess i had to unregister it first and then dump > my code into the admin.py file. > However now the Group is a multiple select widget whereas before it > would use a widget that i could add grou

Re: Webservers, Django thread-safeness, etc.

2008-12-03 Thread SteveB
Actually, that statement, "to the best of anyone's knowledge, Django does not have issues running in threaded servers, and if/when bugs are found which contradict that we fix them" is what I was looking for. I probably should have asked, "Is Django intended and designed to be thread safe?" Obvio

Re: Adding Model Inline with Group Model

2008-12-03 Thread VoiDeT
Perfect! Thanks alot Karen :) Just getting my bearings into the plentiful overriding :D --~--~-~--~~~---~--~~ 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: open source project management app that uses django?

2008-12-03 Thread maeck
Margie, If you can think up a decent model, you might be able to setup the core of the project management application in the Django contrib.admin module. Development will go fast as long as you can stay with standard CRUD pages. The admin model will also give you the user security hooks necessary

Re: Question about i18n

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 12:51 +0100, Elvis Stansvik wrote: > Hello django-users, first post to this list :) > > I often use the i18n support of Django in my projects, and I have a > small annoyance/problem that maybe someone can help me with. > > If I decide to customize e.g. admin/index.html, by

Re: Webservers, Django thread-safeness, etc.

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 17:42 -0800, SteveB wrote: > Actually, that statement, "to the best of anyone's knowledge, > Django does not have issues running in threaded servers, and if/when > bugs are found which contradict that we fix them" is what I was > looking > for. > > I probably should have as

Does a Template Factory system exist, or do I need to build it?

2008-12-03 Thread ristretto.rb
Hello, I have a site that we plan to localize for different countries (all English speaking at this point.) Most of the templates in the site will localize fine as they are, but a few will need to be changed. I would like to have one set of templates that is the international (default) set, and

Re: Does a Template Factory system exist, or do I need to build it?

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 19:19 -0800, ristretto.rb wrote: > Hello, > > I have a site that we plan to localize for different countries (all > English speaking at this point.) Most of the templates in the site > will localize fine as they are, but a few will need to be changed. I > would like to ha

Re: How construct specific complex queries?

2008-12-03 Thread Zeroth
Never mind, I've got it answered. For the record, this is what works: if user.is_anonymous(): #gets all the items with no visibility constraints. items = ListItem.objects.filter(WList__exact=wlist_id).exclude (visibility__isnull=False) else: #first get all items with s

App Name In Admin

2008-12-03 Thread Steve Phillips
Hi All, Around two weeks ago I inquired about customizing the "App Name" in the the Admin Interface. I came up with a solution which involves copying the original "django.contrib.admin, sites.py" over to project level and did what I needed to do to make it so I could have a custom app name and use

Can javascript call a python script?

2008-12-03 Thread Eric
Hello, this might be a silly question, but I'm wondering if javascript can call a python script, and if so, how? To elaborate, I'm trying to customize the admin change_list page so that editing can be done directly from the change_list, instead of clicking into the admin change_form page. To do t

Re: Does a Template Factory system exist, or do I need to build it?

2008-12-03 Thread ristretto.rb
Bloody brilliant! thanks for the reply Malcolm. gene On Dec 4, 4:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-12-03 at 19:19 -0800, ristretto.rb wrote: > > Hello, > > > I have a site that we plan to localize for different countries (all > > English speaking at this point

Any ideas why this code won't work in a post save signal, but will in the shell?

2008-12-03 Thread tenni
def post_save_user_handler(sender, **kwargs): user = kwargs['instance'] if user.is_staff: # only give add_staffprofile permissions to staff p_add_perm = Permission.objects.get (codename='add_staffprofile') p_change_perm = Permission.objects.get (codename='change_st

need to override validation logic

2008-12-03 Thread Nate
I have a form that requires more complex validation logic than is provided through the default form.is_valid implementation. As an example, I have a form with properties A and B. One of A or B must be set. If neither is set, a validation error should be raised. Can someone show me an example of

Re: Can javascript call a python script?

2008-12-03 Thread Jeff Anderson
Eric wrote: > Hello, this might be a silly question, but I'm wondering if javascript > can call a python script, and if so, how? > I believe Javascript can execute external commands, but I'm sure that it'd be turned off entirely for security reasons. I wouldn't trust client side code to modify m

issues with .96 tutorial

2008-12-03 Thread garagefan
I've recently set up a virtual server w/ godaddy and followed http://www.howtoforge.com/how-to-install-django-on-fedora9-apache2-mod_python to install django. I'm following the tutorial and am up to setting up the admin section and configuring the urls.py for the polls model. this is what is happ

Re: need to override validation logic

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 21:18 -0800, Nate wrote: > I have a form that requires more complex validation logic than is > provided through the default form.is_valid implementation. > > As an example, I have a form with properties A and B. One of A or B > must be set. If neither is set, a validation

Re: issues with .96 tutorial

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 21:27 -0800, garagefan wrote: > I've recently set up a virtual server w/ godaddy and followed > http://www.howtoforge.com/how-to-install-django-on-fedora9-apache2-mod_python > to install django. > > I'm following the tutorial and am up to setting up the admin section > and

Re: need to override validation logic

2008-12-03 Thread Kenneth Gonsalves
On Thursday 04 Dec 2008 10:59:13 am Malcolm Tredinnick wrote: > > As an example, I have a form with properties A and B.  One of A or B > > must be set.  If neither is set, a validation error should be raised. > > Can someone show me an example of overriding is_valid()?  Ideally, I > > would want t

Re: No module named urls

2008-12-03 Thread Rob Hudson
It's odd... I'm getting the exact same error at the exact same spot, running Django trunk r9550. What's strange is that it gets the 500 error on first request, and is ok all subsequent requests. On Nov 26, 9:34 am, TheIvIaxx <[EMAIL PROTECTED]> wrote: > So i've narrowed down the problem more.  I

Re: No module named urls

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 22:49 -0800, Rob Hudson wrote: > It's odd... I'm getting the exact same error at the exact same spot, > running Django trunk r9550. What's strange is that it gets the 500 > error on first request, and is ok all subsequent requests. That type of error means there's a proble

Re: modelformset_factory error: (Hidden field id) with this None already exists.

2008-12-03 Thread cyberjack
Hi, I haven't been able to solve this problem, but have made some progress: It's definitely *not* bug 9039. I've download the tests from that ticket and confirmed the fix was included in 1.0.2 final. The problem is related to using querysets with formset_factory. Ie, if I include a queryset f

Re: Can javascript call a python script?

2008-12-03 Thread Daniel Roseman
On Dec 4, 4:09 am, Eric <[EMAIL PROTECTED]> wrote: > Hello, this might be a silly question, but I'm wondering if javascript > can call a python script, and if so, how? > > To elaborate, I'm trying to customize the admin change_list page so > that editing can be done directly from the change_list,

change/edit list not showing in admin interface

2008-12-03 Thread Adam Yee
Hi, Going through chapter 6 in the djangobook. Using 1.1 SVN-9368. I think this chapter might be missing a step or two, or there's something I'm overlooking. In both the django development server and my apache server I can't seem to show the created models 'Publiser, Author and Books'. All mo

Re: change/edit list not showing in admin interface

2008-12-03 Thread Malcolm Tredinnick
On Wed, 2008-12-03 at 23:53 -0800, Adam Yee wrote: > Hi, > > Going through chapter 6 in the djangobook. Using 1.1 SVN-9368. I > think this chapter might be missing a step or two, or there's > something I'm overlooking. What you're overlooking is that that book is written for Django 0.96 and s