Re: csrf migration

2010-02-10 Thread Russell Keith-Magee
On Thu, Feb 11, 2010 at 12:22 PM, Jeff Bauer wrote: > Update: My work-around is this: > > 1) Wrap views functions: >    try: >        import django.views.decorators.csrf >        # Django 1.2 stuff >    except ImportError: >        # Django 1.1 stuff > > 2) If running Django 1.1, register a fake c

Re: having an ManyToMany field, and have it optional

2010-02-10 Thread iliveinapark
Both are required for a ForeignKey or ManyToManyField to be empty, ie: class GoalTag(models.Model): goals = models.ManyToManyField(Goal, blank=True, null=True,) On Feb 11, 5:20 pm, Atamert Ölçgen wrote: > On Thursday 11 February 2010 05:18:44 kamilski81 wrote:> Is it possible to do: > > >

Re: having an ManyToMany field, and have it optional

2010-02-10 Thread Atamert Ölçgen
On Thursday 11 February 2010 05:18:44 kamilski81 wrote: > Is it possible to do: > > class GoalTag(models.Model): > goals = models.ManyToManyField(Goal, null=True) Try blank=True. That null=True is possibly redundant there. -- Saygılarımla, Atamert Ölçgen -+- --+ +++ www.muhuk.com mu..

Re: csrf migration

2010-02-10 Thread Jeff Bauer
Update: My work-around is this: 1) Wrap views functions: try: import django.views.decorators.csrf # Django 1.2 stuff except ImportError: # Django 1.1 stuff 2) If running Django 1.1, register a fake custom tag 'csrf_token' and load it in the templates so it's

Re: django-debug-toolbar and 404's

2010-02-10 Thread Mike Dewhirst
Rishab Maybe you haven't included any toolbar panels? Here is an example ... if TOOLBAR: DEBUG_TOOLBAR_CONFIG = { 'INTERCEPT_REDIRECTS': TOOLBAR_REDIRECTS, 'SHOW_TOOLBAR_CALLBACK': None, } DEBUG_TOOLBAR_PANELS = ( #'debug_toolbar.panels.version.VersionDebugP

having an ManyToMany field, and have it optional

2010-02-10 Thread kamilski81
Is it possible to do: class GoalTag(models.Model): goals = models.ManyToManyField(Goal, null=True) The reason why i ask is that a goal can have many tags, and a tag can belong to many goals. However, after a tag is input and a user deletes a goal, the tag should still remain in the databse.

django-debug-toolbar and 404's

2010-02-10 Thread Rishabh Manocha
Hey Guys, I know I must be doing something stupid here, but for the life of me, I can't seem to be able to get django-debug-toolbar to work - I keep getting a 404 error whenever I visit http://localhost:8000/admin/ (see [1]). I've followed the Installation instructions at http://github.com/robhuds

Django Transactions at the Model Level

2010-02-10 Thread khoobks
Hi Everyone, I was wondering if a Django guru was able to verify if my mental model of how django transactions operate is correct. The situation that I have is that I'd like to place the transaction.commit_on_success decorator around a custom function on my model. At the same time, I would also l

csrf migration

2010-02-10 Thread Jeff Bauer
It looks to be a long week of working out backwards incompatible stuff in Django-1.2 (beta-1). http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ But I wish there were a gentler upgrade path. My main question: Is there a way to re-code my applications so the same codebase can run on both

Re: Setting from address for internally generated emails

2010-02-10 Thread Nick Booker
I'll try that. I did look at the docs, but obviously not hard enough. Thanks for your help. Nick On Feb 10, 3:11 pm, Karen Tracey wrote: > On Wed, Feb 10, 2010 at 10:01 AM, Nick Booker wrote: > > Sorry I correct myself -- I meant it always has a from address of > > r...@localhost, which the c

Re: How to serialize objects that contain a foreign key object

2010-02-10 Thread Ramiro Morales
On Wed, Feb 10, 2010 at 2:42 PM, Ariel wrote: > I am using version 1.1, Could I do the same with 1.1 version ??? > > On Wed, Feb 10, 2010 at 7:39 AM, diofeher wrote: >> >> Django 1.2 comes with a parameter [1] at serializers that do this for >> you. >> >> http://docs.djangoproject.com/en/dev/topi

MultiValueField & MultiWidgets in Django Admin

2010-02-10 Thread djangomg
Hi folks, Having a heck of a time modifying the admin site to use MultiValueField and MultiWidgets. The concept I am building a cms with page regions, I need to render a dynamic # of textareas on the admin site and have them combine into a single database field in the db. I currently have a sta

State of the Django MPTT Art?

2010-02-10 Thread Jon Loeliger
Folks, I'd like to add a few MPTT manged data-sets to my projects so I am wondering what the current state of the MPTT art is. I'm using Danjgo 1.1.1 right now, and would like to slap down an MPTT manager in my project that is BSD-ish licensed, allows multiple, different sets of nodes, and hopefu

[ANSWER] Re: Template and Form Question

2010-02-10 Thread Jon Loeliger
> Folks, > > I would appreciate some help figuring out how to create a > templated form scenario. The quick form of the question is > either: > > How do I iterate over two form field list simultaneously > in my template using {% for f in form %}, sort of like > {% for f,g in form1,fo

Re: Custom commands called outside project path

2010-02-10 Thread Tim Daniel
Thanks for the quick and helpful answers. On 9 feb, 19:37, Bill Freeman wrote: > If you're running on *nix (including Os/X, probably) you have a few options. > Someone else will have to help if it's Windows without cygwin. > > The easy way, if it does all that you need, is to deploy, instead of a

Re: Django Generator

2010-02-10 Thread Brice Leroy
Thank you Wolf, I think you're right on the necessity of a tutorial once beta is reach. I'll try to fight against complexity but as new feature will appear that will probably become a sine qua non condition. Thank you for your support. Brice 2010/2/10 Wolf Halton : > It is a great idea, Brice. 

Re: How to serialize objects that contain a foreign key object

2010-02-10 Thread Ariel
I am using version 1.1, Could I do the same with 1.1 version ??? On Wed, Feb 10, 2010 at 7:39 AM, diofeher wrote: > Django 1.2 comes with a parameter [1] at serializers that do this for > you. > > http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys > > -- > You received this

Re: Django Generator

2010-02-10 Thread Wolf Halton
It is a great idea, Brice. I was playing with it last night. It will really help the beginners along. I am imagining a tutorial for your generator that shows people how to structure a useful project and then walks the reader through their own code to help them understand what the generator has d

Re: Django Generator

2010-02-10 Thread Brice Leroy
Hello everybody, I woke up this morning and saw all those email and I would like to thank you all for all those advices and support you wrote. That motivates me even more to work on it. The project being in alpha stage, please keep in mind that your project integrity and its storage is not guaran

Model design question: Inheritance? GenericRelation? ...?

2010-02-10 Thread Achim Domma
Hi, I have different models A,B,C which all will have exactly on Address. If I query instances of A,B,C I usually will also need the related address. I also want to query all instances of A,B,C which have a certain zip code for example. What's the best and most efficient way to model that in djang

ANN: Celery 1.0 released!

2010-02-10 Thread Ask Solem
=== Celery 1.0 has been released! === We're happy to announce the release of Celery 1.0. What is it? === Celery is a task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports sche

Re: Javascript Modal Window

2010-02-10 Thread CrabbyPete
Thanks, but I was not clear in my question. If I use jQuery or any other javascript framework, to do a modal window from a link I have to load some html code that is the form Here is an example using thickbox in a template login In a view I load an html template with get_template() Do I do

Re: I'm having an issue with clean() method in ModelForm

2010-02-10 Thread Roboto
Thanks Bruno, I'll look back into it again tonight. On Feb 10, 5:30 am, bruno desthuilliers wrote: > On Feb 10, 5:22 am, Roboto wrote: > > > class userForm(ModelForm): > > OT : Python's naming convention is "UserForm" > > >     first_name = CharField(label='First Name') > >     last_name = CharF

Re: Using ForeignKey with dJango and PyAMF

2010-02-10 Thread WC
According to this bug report, select_related is supposed to return the data, but it doesn't. Also, if I can't get the foreign key, is there a way around this? All I really need is the id of the foreignKey object. Any help would be much appreciated. I am a newbie to this architecture. -- You r

Re: Setting from address for internally generated emails

2010-02-10 Thread Karen Tracey
On Wed, Feb 10, 2010 at 10:01 AM, Nick Booker wrote: > Sorry I correct myself -- I meant it always has a from address of > r...@localhost, which the customer's relay rejects. SERVER_EMAIL is the setting that control the from address on server-generated error emails, not DEFAULT_FROM_ADDRESS. S

Re: Save as inline formset

2010-02-10 Thread Karen Tracey
On Wed, Feb 10, 2010 at 7:45 AM, oiad wrote: > Hi. If I have a couple of models like these: > > class Poll(models.Model): >question = models.CharField(max_length=200, unique = True) >pub_date = models.DateTimeField('date published') > > class Choice(models.Model): >poll = models.Forei

Re: Setting from address for internally generated emails

2010-02-10 Thread Nick Booker
Sorry I correct myself -- I meant it always has a from address of r...@localhost, which the customer's relay rejects. On 10/02/10 14:54, Nick Booker wrote: Hi all. Django keeps sending out emails with the subject: [Django] Error (EXTERNAL IP): /path_to_some_file.css The problem I have is they

Setting from address for internally generated emails

2010-02-10 Thread Nick Booker
Hi all. Django keeps sending out emails with the subject: [Django] Error (EXTERNAL IP): /path_to_some_file.css The problem I have is they are producing Non Delivery Reports (example below) on the customer's mail relay and never getting to me as they're always sent to r...@localhost. This is

Re: Django Generator

2010-02-10 Thread Kevin Postal
Love it! -- 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 g

How to build an json object that contain objects class and dictionary.

2010-02-10 Thread manixor
Hello all, I need to send with HttpResponse an json object. I need to have there more then one objects class(myclass.objects.all()) and a dictionary. To have only objects I can do like this: ob1 = cl1.objects.all() ob2 = cl2.objects.all() all_ob = list(ob1) all_ob +=list(ob2) return HttpRespons

Re: Unicode name of field in form

2010-02-10 Thread Thomas Turner
In django you would do from django.utils.safestring import mark_safe forms.CharField(label = mark_safe('Ø')) On Dec 24 2009, 9:17 am, Andrij Skalyuk wrote: > Thanks for reply. > > I see, that in this case, i will use replacement system of Unicode > characters to ASCII. > > On Dec 23, 6:09 pm,

Re: how to redirect to another page in if else condition.

2010-02-10 Thread bruno desthuilliers
On Feb 10, 6:00 am, Keyan wrote: > I am new to django!! working in windows. I have created a login page > and validating in view.py file > code wil go like this >       for x in log: >         if u_name ==x[1]: >               return render_to_response('index.html',{"log":log}) >         else: >  

Re: Django Generator

2010-02-10 Thread Rick Caudill
Sorry... It is Brice... My bad. Rick On Wed, Feb 10, 2010 at 7:48 AM, Rick Caudill wrote: > I want to say good job Brian. I can see how this could be very useful. > > Rick > > > On Tue, Feb 9, 2010 at 2:58 PM, Brice Leroy wrote: > >> Hello everybody, >> >> I've been working for a week on th

Re: Django Generator

2010-02-10 Thread Rick Caudill
I want to say good job Brian. I can see how this could be very useful. Rick On Tue, Feb 9, 2010 at 2:58 PM, Brice Leroy wrote: > Hello everybody, > > I've been working for a week on this idea of a generator for django > project. The goal is to provide a simple architecture that can be > after

Re: How to serialize objects that contain a foreign key object

2010-02-10 Thread diofeher
Django 1.2 comes with a parameter [1] at serializers that do this for you. http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys -- 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...

Re: Django Generator

2010-02-10 Thread derek
I'd like the option (maybe linked to profile on the webpage?) to set: * timezone * database engine On Feb 9, 10:58 pm, Brice Leroy wrote: > Hello everybody, > > I've been working for a week on this idea of a generator for django > project. The goal is to provide a simple architecture that can be

Save as inline formset

2010-02-10 Thread oiad
Hi. If I have a couple of models like these: class Poll(models.Model): question = models.CharField(max_length=200, unique = True) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200)

Managing different user types

2010-02-10 Thread ALJ
I appreciate that this is a very common question. I have searched through the forums and now totally confused. There seems to be loads of different methods you could use, but I wondered if there is a pattern for managing different user types. 1. The best way to do a simple extension of user inform

Re: Custom commands called outside project path

2010-02-10 Thread David De La Harpe Golden
(I'm not sure about that "root" in creecode's version. Editing crontab with crontab -e on a linux box has no user specification because it edits the crontab of the invoking user. Perhaps it's different for a directly edited root crontab.) The system-wide /etc/crontab is different to individu

Re: Django Generator

2010-02-10 Thread Russell Keith-Magee
On Wed, Feb 10, 2010 at 6:48 PM, Atamert Ölçgen wrote: > On Tuesday 09 February 2010 22:58:32 Brice Leroy wrote: > * Please remove `auto_now` and `auto_now_add` since they're deprecated. No, they really aren't. If they were deprecated, there would be deprecation warnings in the code and document

Re: Django Generator

2010-02-10 Thread Atamert Ölçgen
On Tuesday 09 February 2010 22:58:32 Brice Leroy wrote: > Hello everybody, > > I've been working for a week on this idea of a generator for django > project. The goal is to provide a simple architecture that can be > after adapted to your project. The system is in alpha stage but allows > you to c

Re: I'm having an issue with clean() method in ModelForm

2010-02-10 Thread bruno desthuilliers
On Feb 10, 5:22 am, Roboto wrote: > class userForm(ModelForm): OT : Python's naming convention is "UserForm" >     first_name = CharField(label='First Name') >     last_name = CharField(label='Last Name') >     email = CharField(label='Your Email') >     password = CharField(label='New Password

Re: how to redirect to another page in if else condition.

2010-02-10 Thread bruno desthuilliers
On Feb 10, 6:00 am, Keyan wrote: > I am new to django!! working in windows. I have created a login page > and validating in view.py file > code wil go like this >       for x in log: what is "log" here ? >         if u_name ==x[1]: and what is 'x' supposed to be ? And why do you test against th

Re: slug is not autogenerated in edit page

2010-02-10 Thread bruno desthuilliers
On Feb 10, 10:31 am, harryos wrote: > I was trying out forms and created a class and its form (snip code) > When the template is rendered it shows the helptext which I provided > in the model's slugfield.But unlike in the django admin 's edit > page ,the slug is not auto generated when I type in

slug is not autogenerated in edit page

2010-02-10 Thread harryos
I was trying out forms and created a class and its form class MyCategory(models.Model): name=models.CharField(max_length=10) description=models.TextField(help_text='a description about the category') slug=models.SlugField(unique=True,help_text='will be auto generated from n

ANN: django-admin-tools 0.1.0 released

2010-02-10 Thread David Jean Louis
Hello, I'm happy to announce the availability of the first public release of django-admin-tools. Django-admin-tools is a collection of extensions/tools for the default django administration interface, it includes: * a full featured and customizable dashboard, * a customizable menu bar, *

Admin bug with tinymce in the custom media

2010-02-10 Thread Xavier Ordoquy
Hello, I'm getting a weird and random bug with the admin part while using tinymce in the custom media. It happens that on the list view, I get a broken editable boolean field looking like: http://python.altazeo.com/js/tiny_mce/themes/simple/langs/en.js";>rm-1-nouvo_entite" id="id_form-1-nouvo_

Re: moderation of djangosearch.com

2010-02-10 Thread Sithembewena Lloyd Dube
I would be glad too - although like Atamert, I know only one listed language. On Tue, Feb 9, 2010 at 12:55 PM, Atamert Ölçgen wrote: > Hi Alex, > > On Monday 08 February 2010 23:33:20 Alrond wrote: > > Now I don’t have time to support the project because of the main > > project WIPmania.com. The