How to use the given snippet..?

2010-09-21 Thread girish shabadimath
hi all, how to make use of this snippets http://djangosnippets.org/snippets/963/ i have a view function def demand(request, id, template = 'hello.html'): i want to test dis using the above snippets,, i copied the snippet in my localmachine when i use django

Problem with ForeignKey()

2010-09-21 Thread Yo-Yo Ma
I have a model with: parent = ForeignKey('self', blank=True, null=True) In that model I've overridden clean() to contain: if self.parent: # Do some stuff It raises an attribute error saying that parent.pk doesn't exist. How can I get around this. Note that my foreign key is recursive. --

Re: Why Django Apps Suck

2010-09-21 Thread Ramdas S
On Wed, Sep 22, 2010 at 2:48 AM, Klaas van Schelven < klaasvanschel...@gmail.com> wrote: > Shawn: thanks > Just started watching the video and I'm noticing my complaints are not > unique. > > > Wow! I guess your definition of an app and expectation of re-usuability > > from an app written by

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-21 Thread Kenneth Gonsalves
On Tue, 2010-09-21 at 17:41 +0200, Sithembewena Lloyd Dube wrote: > Has anybody intergrated a WYSIWYG editor in the admin of a Django > 1.2.1. > site? I have tried django-wysiwyg and TinyMCE to no avail. I need > something > with concise, up-to-date documentation. a snippet from my admin.py:

Installing python 2.6 / 2.7, Django, mysql on Windows

2010-09-21 Thread m.bouzahir
good tutoriel about Installing python 2.6 / 2.7, Django, mysql on Windows http://web-eng-help.blogspot.com/2010/09/installing-django-on-windows.html Good luck -- 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 1.2.1. admin WYSIWYG editor

2010-09-21 Thread felix
I got sick of TinyMCE and switched to jQuery wysiwyg sorry this is just posted raw like this, but here it is. I should wrap it up on github. requires http://code.google.com/p/jwysiwyg/ and the 3 files stated below to be in your compress stack or on your page from django import forms from

Re: Why Django Apps Suck

2010-09-21 Thread Mike Dewhirst
Also at pycon-au http://glamkit.org/ where the talk focused on reusability of apps. On 22/09/2010 6:26am, klaasvanschel...@gmail.com wrote: Ok here it goes: I don't have a proper platform for my observations / rants so I figured I'd try my luck here. Django has been my favorite framework for

ChoiceField -suppressing "Select a valid choice. That choice is not one of ..." error?

2010-09-21 Thread ydjango
How to suppress invalid_choice validation error for choicefield -"Select a valid choice. That choice is not one of ..." ? I am using a client side combo box where user can either select from the choices or add a new value. For new value Django - ChoiceField give invalid_choice validation error.

Re: Why Django Apps Suck

2010-09-21 Thread Klaas van Schelven
Shawn: thanks Just started watching the video and I'm noticing my complaints are not unique. > Wow! I guess your definition of an app  and expectation of re-usuability > from an app written by someone else > is fairly high! Actually, a big part of the problem is reusing my own apps. Mostly since

help setting 'apps' folder Error: No module named registration

2010-09-21 Thread justin jools
I have setup 'apps' folder with __init__.py inside and 'registration' app inside 'apps' I then refer to it with: 'apps.registration' in installed_apps/settings.py When I run syncdb it gives error: Error: No module named registration -- You received this message because you are subscribed to

Customizing and Suppressing "Select a valid choice. That choice is not one of ..." error?

2010-09-21 Thread ydjango
How to customizing and suppressing "Select a valid choice. That choice is not one of ..." error? I have two requirements: 1) for some select drop downs, I want to customize the message "Select a valid choice. That choice is not one of ..." to "Select a valid choice for field ABC. 12 choice

Re: Why Django Apps Suck

2010-09-21 Thread Ramdas S
On Wed, Sep 22, 2010 at 1:56 AM, klaasvanschel...@gmail.com < klaasvanschel...@gmail.com> wrote: > Ok here it goes: I don't have a proper platform for my observations / > rants so I figured I'd try my luck here. Django has been my favorite > framework for developing web applications for about a

Re: Why Django Apps Suck

2010-09-21 Thread Shawn Milochik
Just FYI, the videos from DjangoCon 2010 are already up on blip.tv. The Python AV team was awesome. Here's that talk: http://blip.tv/file/4112452/ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Why Django Apps Suck

2010-09-21 Thread klaasvanschel...@gmail.com
Ok here it goes: I don't have a proper platform for my observations / rants so I figured I'd try my luck here. Django has been my favorite framework for developing web applications for about a year and a half, so it comes from a position of love when I say that the Django app really sucks as a

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread nick.l...@gmail.com
read this here I think this'll explain what you're wanting. http://docs.djangoproject.com/en/dev/ref/forms/validation/ On Tue, Sep 21, 2010 at 1:50 PM, Anton Danilchenko < anton.danilche...@gmail.com> wrote: > Message - this is a rental proposition (rooms, floor, cost, area, > country, cirty

Localization time formatting

2010-09-21 Thread tsuraan
What do you have to do to get the localized datetime formats to work in Django? I started a new project, set LANGUAGE_CODE to 'en-GB', enabled LocaleMiddleware (doesn't matter for this test though), and ran "django manage.py shell". In the shell, I had the following session: >>> from

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Message - this is a rental proposition (rooms, floor, cost, area, country, cirty and contact phones). Visitors can create new messages (message - this is a rent proposition) and enter list of own phones (one or more phones). My application store this phones not in char field, but save each phone

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread nick.l...@gmail.com
PersonallyI don't like the idea of adding multiple phone numbers as comma separated values. What happens when a user's trying to add more phone numbers than your charField's max_length? So let me see if I understand what's going on here... You have a problem where exists apartments for

select_template but return only template name?

2010-09-21 Thread ringemup
I've set up a theming system that relies on using select_template to find the correct template for each view, searching first the skin's template directory, then the theme's template directory, then the master template directory. (A "skin" in this case being mostly a stylesheet that applies a

Re: Synching samba users to django users?

2010-09-21 Thread Doug
You could create a secondary python script running as root that polls a queue or config file generated by your django app. Have that script perform the requested actions by running the same executables as a sub process and checking the exit codes. If you need immediate responses, it could run

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Also I need get list of all phones as with many-to-many relationship: m = Message.objects.get(1) for phone in m.phones: ptint phone On 21 сен, 20:15, Anton Danilchenko wrote: > I describe my task more reallistical. > > This is application for rent an apartment.

Header being removed or overwritten

2010-09-21 Thread TheIvIaxx
Hello, I have recently switched over to nginx as my front end server. All is well. However i have a view that sets the Cache-Control header to no-cache. But when going to this view, it looks like nginx is either overwriting the header value or removing/ignoring it all together. I'm not 100% i

filepath (system file system path) field

2010-09-21 Thread pixelcowboy
Hi, I have seen this asked before here (without answers), but I wanted to know how to go on about creating a field that stores filepath names from the client filesystem, so I wanted to check if someone could recommend the best apporach: Creating a custom field perhaps? Or perhaps extending the

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
I describe my task more reallistical. This is application for rent an apartment. User can create new message with information about apartment, and also add one or more contact phone numbers. One user, without registration, can create more that one message on the site. For one message can add one

Re: Synching samba users to django users?

2010-09-21 Thread MrMuffin
Yes, that`s one option I`ve looked at, but I also need to manage shares and restart the samba service when the config has been updated so it would be better to have a library that managed samba directly. But if I cannot find any other alternative, LDAP might be the best solution for my problem.

Re: Synching samba users to django users?

2010-09-21 Thread Rogério Carrasqueira
Did you thought to use a third party solution creating a LDAP server and syncs the Samba and Django system with the LDAP? http://www.google.com.br/search?hl==LDAP+django=navclient-ff=1B7GGLL_enBR394BR394=UTF-8 Cheers Rogério Carrasqueira --- e-mail: rogerio.carrasque...@gmail.com skype:

Synching samba users to django users?

2010-09-21 Thread MrMuffin
Hi, I need to sync samba users ( and generally manage samba users, samba shares and start/restart the samba service ) from within django. I've googled for hours and emailed some people on the samba site, but haven`t gotten any answers. I want to create a reusable app that can handle samba

Re: Django 1.2.1. admin WYSIWYG editor

2010-09-21 Thread bagheera
Dnia 21-09-2010 o 17:41:26 Sithembewena Lloyd Dube napisał(a): Hi, Has anybody intergrated a WYSIWYG editor in the admin of a Django 1.2.1. site? I have tried django-wysiwyg and TinyMCE to no avail. I need something with concise, up-to-date documentation. If anybody

Django 1.2.1. admin WYSIWYG editor

2010-09-21 Thread Sithembewena Lloyd Dube
Hi, Has anybody intergrated a WYSIWYG editor in the admin of a Django 1.2.1. site? I have tried django-wysiwyg and TinyMCE to no avail. I need something with concise, up-to-date documentation. If anybody has done this, please recommend and also point to the docs? Thanks. -- Regards,

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread nick.l...@gmail.com
Maybe I don't understand your problem. It sounds to me like your trying to make this way more difficult than it needs to be. Also it sounds to me like your trying to assign the same phone number to multiple people. (which is fine) But doesn't make a lot of sense to me in a practical application.

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
In my case, I have Users with equal phone numbers. And I need only ManyToMany relationship. I need create custom field for get information from CharFiels, validate this data, clean and save to datastore in separate model. If this phone already exists - we get ID of this phone. And, if this is a

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread nick.l...@gmail.com
Let me rephrase my first statement...You can use the admin for fine grained control of your data formats and characters. But don't use the Database to control the characters and formats. Use the database as a storage and make sure that anything you store gets cleaned. n On Tue, Sep 21, 2010 at

Re: ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread nick.l...@gmail.com
First I don't think you should be using the admin for such fine grained control of your data formats. BUT if you do want to do that you would want to do your validation in custom admin forms. (created in your admin.py to do cleans on the data that's being submitted) Second I wouldn't do a

Problems to render a tree in Json - __init__() got an unexpected keyword argument 'use_decimal'

2010-09-21 Thread Rogério Carrasqueira
Hello! I'm new on this list and a newbie in Django. I'm recurring to this list because I'm having a problem to implement a Json Tree using Django. I saw an article at http://www.elfsternberg.com/2009/05/20/fixing-an-omission-from-djangos-simplejson-iterators-generators-functors-and-closures/and

Re: django forms

2010-09-21 Thread Shawn Milochik
Of course. You can dynamically add to self.fields in the __init__ of your form instance. Shawn -- 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,

ManyToManyField to Phones model for enter phones manually (not select from list)

2010-09-21 Thread Anton Danilchenko
Hi all! Please, help me undestand, how to solve next task. I am show for user form with two fields: user name and text field, where user input list of phones, separated by comma. User sholud enter one or more phones separated by comma. If user enter not valid number - we show error message like

Re: What's the best way to develop an app that is similar the django admin?

2010-09-21 Thread Alex Robbins
I think you'll definitely want to use ModelForms. http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ Alex On Sep 20, 8:13 am, Federico Capoano wrote: > Hi all, > > I try to explain it clearly. > > I have to develop an application that will implement similar

django forms

2010-09-21 Thread ashy
Hi All, I want to create dynamic fields on the form, for instance I want the city and state fields to appear only when these properties are blank for the user. Can I create such a form in django? Any ideas? thanks ashy -- You received this message because you are subscribed to the Google

Re: multiple servers one database

2010-09-21 Thread Tim Arnold
Hi Steve, That would definitely be the easiest and simplest answer. Unfortunately I only have power over these two machines. What I'm trying to do is create a site that if one machine dies/hangs, the system will continue to work on the alternate server. I just read about the master-master mysql

Re: REST XML + HTML API suggestions

2010-09-21 Thread Brian Bouterse
I typically check the content type and have the response match the content type of the incoming request. I also typically have this be the only decision that lives within views.py, and in turn calls out to code in other modules to handle xml and/or html presentation respectively. Also, I would

Re: Automatically creating fields

2010-09-21 Thread tsmets
I think, one of the question is also ... What are these fields for ... ? If they are derived values like : is_firstname_filled or is_age_above_18 you should then just implement a method ... but bottom line, it looks much simpler / efficienter / safer to implement it (as an attribute or a method)

Making admin callables to display foreignkey relations (nested)

2010-09-21 Thread N8
No one responds to questions regarding nested inlines in the admin, there must be a reason for that :) But Im a django novice, and am having troubles customizing the admin to make it intuitive for the client. Can someone give me an example of one of the following: - nesting inlines of

Re: django-mailer truncate my log file

2010-09-21 Thread ferran
Thanks to Rolando for he's answer http://groups.google.com/group/django-es/browse_thread/thread/c2107f2b172eb0c0/6f5ffb8235326e56?show_docid=6f5ffb8235326e56 On Sep 17, 11:35 am, ferran wrote: > hello, > I don't understand because django-mailer truncate my log file every >

Re: REST XML + HTML API suggestions

2010-09-21 Thread Alexandre González
I'm using django-piston in my app, and it's incredible. You can use XML in your RESTful API, but if you like to user another emitter as JSON, Pickle... you can do at-the-moment! Incredible! On Tue, Sep 21, 2010 at 11:11, vikalp sahni wrote: > Hi, > > You might want to

Django 1.2 and keyless many to many on legacy databases

2010-09-21 Thread Xavier Ordoquy
Hi, I'd like to know whether someone managed to get a many to many relationship with a keyless joint table. I got a legacy database which uses that and although I can get it working on read mode, I have issues with writing. I'm using this snippet (works fine with django 1.1):

Re: REST XML + HTML API suggestions

2010-09-21 Thread vikalp sahni
Hi, You might want to have a look at django-piston. http://bitbucket.org/jespern/django-piston/wiki/Home Its a nice project to give rest full interface to your models. And for some specific logic also you can tweak the handlers to get desired results. Regards, //Vikalp On Tue, Sep 21, 2010

Re: IPAddressField inserted as empty string although null=True

2010-09-21 Thread rihad
Incidentally this has been mentioned in the trac for 3 years by a few, but no milestone has been set yet. http://code.djangoproject.com/ticket/5622 Unfortunately I'm not yet knowledgeable enough in Django's inner workings to propose a patch myself. -- You received this message because you are

RE: CSS and JS minification

2010-09-21 Thread Henrik Genssen
Hi, use the minimizer from yahoo (yuicompressor) for js and css (yes, written in java). But it does its job pretty well - and you won't reinvent the wheel... regards Henrik >reply to message: >date: 21.09.2010 07:53:33 >from: "Shamail Tayyab" >to: