Re: Not calling clean() properly

2010-09-13 Thread Christos Jonathan Hayward
Other attempts to write a clean that would run a print statement and then call to_python(), validate(), and run_validators() did not result in that print statement being called. Am I missing something about data being cleaned? The hooks I've tried to override don't seem to be being called. On

[no subject]

2010-09-13 Thread 伟泓 徐
http://qebumipa.tripod.com/qukemy.html MakeM assiv esOfCa shFrom Home -- 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

Re: Form not taking my input...

2010-09-13 Thread keynesiandreamer
Thanks Daniel. I have been modding code from a Django book I have been working through so figuring out how all the pieces work is always fun. Thanks for your insights here. I will get cracking on them later tonight. On Sep 13, 2:41 pm, Daniel Roseman wrote: > On Sep 13,

Overriding queryset for admin.ModelAdmin

2010-09-13 Thread Brandon Taylor
Hi everyone, I have a very strange problem I'm trying to get a handle on. I need to filter a model admin with a value from the querystring, so I am doing an override of queryset in my ModelAdmin like so: def queryset(self, request): id = request.GET.get('id', None) if id: return

Re: user created variables

2010-09-13 Thread pixelcowboy
I see what you are saying, thanks for the advice! On Sep 13, 12:10 pm, "nick.l...@gmail.com" wrote: > The problem I see with creating a model for each data type is that you have > LOTS of clutter in the admin...and what happens if you want to change the > value from a string

Re: django tinyMCE is normal text field instead of rich text formatting? a fix please.

2010-09-13 Thread joconnell
Hi, What does your admin.py look like? You might need to add a media class to your admin classes e.g. class Media: js = ('/js/tiny_mce/tiny_mce.js', '/js/textareas.js') I never tried to get tinymce working with the admin mind, I just spotted it in the below tutorial:

Re: db filter comparing a minimum to a range

2010-09-13 Thread Phlip
Curiously, if I add another constraint to the dates, it must go into the Min() itself: Blog.objects.annotate(min_date= Min('comment__date', comment__status='sane')).all() Otherwise the date range check is disjoint from the sanity check (important for modern commenters!), and lots of

Re: Form not taking my input...

2010-09-13 Thread Daniel Roseman
On Sep 13, 9:32 pm, keynesiandreamer wrote: > Hi Daniel, thanks for looking at this! > > Here is my views.py code related to this: > > @login_required > def wine_add_page(request): >   if request.method == 'POST': >     form = WineAddForm(request.POST) >     if

Not calling clean() properly

2010-09-13 Thread Christos Jonathan Hayward
I have a TextURLField defined below, and I am trying to get the clean() to prepend http:// to all entries that do not contain a ':'. In other words, if someone enters "google.com", I'd like to store "http://google.com;. Right now it appears not to be making any difference; if I enter an FQDN then

Re: Form not taking my input...

2010-09-13 Thread keynesiandreamer
Hi Daniel, thanks for looking at this! Here is my views.py code related to this: @login_required def wine_add_page(request): if request.method == 'POST': form = WineAddForm(request.POST) if form.is_valid(): #create or get dummy wine wine, dummy = Wine.objects.get_or_create(

can't get m2m_changed signal working

2010-09-13 Thread allyb
I'm finding it difficult to denormalise a field in a django model. I have: class AnswerSet(models.Model): title = models.CharField(max_length=255) num_answers = models.PositiveIntegerField(editable=False, default=0) answers = models.ManyToManyField(Answer,

Gotcha with ?generic foreign keys?

2010-09-13 Thread Christos Jonathan Hayward
I'm working on tracking changes and am running into trouble with the many-to-many fields. I can straightforwardly track and edit one-to-one fields, and many-to-one, and they behave straightforwardly. However, when I try to do a many-to-many field, the present issue I'm running into is that I save

Re: db filter comparing a minimum to a range

2010-09-13 Thread Phlip
> Maybe this is what you want: > > http://docs.djangoproject.com/en/1.2/topics/db/aggregation/#filtering... Outrageous, thanks. I seem to have reconstructed the rational for .annotate(), which I didn't understand until now! -- You received this message because you are subscribed to the Google

Re: db filter comparing a minimum to a range

2010-09-13 Thread Alec Shaner
Maybe this is what you want: http://docs.djangoproject.com/en/1.2/topics/db/aggregation/#filtering-on-annotations On Mon, Sep 13, 2010 at 3:32 PM, Phlip wrote: > Djangoids: > > Consider this QuerySet: > > Blog.objects.filter(comment__date__range=(self.yesterday, >

db filter comparing a minimum to a range

2010-09-13 Thread Phlip
Djangoids: Consider this QuerySet: Blog.objects.filter(comment__date__range=(self.yesterday, self.tomorrow)) It returns all the blogs with any comment (as a side note, it seems to return each blog redundantly, to allow the SELECT to differ each returned row by comment). I need every Blog

Re: user created variables

2010-09-13 Thread nick.l...@gmail.com
The problem I see with creating a model for each data type is that you have LOTS of clutter in the admin...and what happens if you want to change the value from a string to an int? You'd have to delete it one, then recreate it in another...just a lot of steps. Also it means more models to

Re: tracking down a login issue (django 1.2)

2010-09-13 Thread Cindy
OK, I have figured this out myself -- is there somewhere I should put in a bug report? It seems that if you are using the ldap authentication backend, setting AUTH_LDAP_FIND_GROUP_PERMS can result in generating sql that tries to look up group membership in an empty set. When this value is true,

delete permission from permission list

2010-09-13 Thread owidjaya
Hi all, I have a problem with permission list. I deleted the table for a django model, deleted the permission entries for the model from the permissions table, restart web server, delete the content type entry of the model and i still get the permission appearing in the list in the admin page. I

Re: user created variables

2010-09-13 Thread pixelcowboy
Yes, it totally does! Thanks again for your help. Another work around might be just creating different models for each data type that I want to validate, as in your first example maybe... but create a different model for each different data type possibility? What do you about this approach? On

delete permission from permission list

2010-09-13 Thread owidjaya
Hi all, I have a problem with permission list. I deleted the table for a django model, deleted the permission entries for the model from the permissions table, restart web server, delete the content type entry of the model and i still get the permission appearing in the list in the admin page. I

delete permission from permission list

2010-09-13 Thread owidjaya
Hi all, I have a problem with permission list. I deleted the table for a django model, deleted the permission entries for the model from the permissions table, restart web server, delete the content type entry of the model and i still get the permission appearing in the list in the admin page. I

Re: Form not taking my input...

2010-09-13 Thread Daniel Roseman
On Sep 13, 5:48 pm, keynesiandreamer wrote: > Howdy, > > I am still new to Django and have been working with forms. > > Currently I a getting an error that says a field can't be NULL, even > though I have entered data into it. Weird! > > Error: > IntegrityError at /save/

django tinyMCE is normal text field instead of rich text formatting? a fix please.

2010-09-13 Thread tricks...@googlemail.com
I installed Django tiny mce however i am getting a normal text area in my admin. Can anyone help me to correct this to a rich text area where i can access text formatting? Any help would be greatly appreciated. Here are my settings.py import os PROJECT_DIR = os.path.dirname(__file__)

Form not taking my input...

2010-09-13 Thread keynesiandreamer
Howdy, I am still new to Django and have been working with forms. Currently I a getting an error that says a field can't be NULL, even though I have entered data into it. Weird! Error: IntegrityError at /save/ winerater_wine.alcohol may not be NULL Request Method: POST Request URL:

Re: Please add tag for Django 1.2.3 release

2010-09-13 Thread shacker
On Sep 13, 8:19 am, shacker wrote: > Hmm, the ticket is marked fixed, but the repo is still at 1.2.1. This > is not good. 1.2.2 is a security release, and we should be able to use > the official distribution mechanism (svn) to update our sites > immediately. OK, 1.2.3 is

Re: user created variables

2010-09-13 Thread nick.l...@gmail.com
hmm ok I'm thinking out loud here :) So you want your users to have the ability to create env variables through the Django admin. You also want these variables to be validated (ie you don't want people to put 123 in a char var). I still see this solution as being at least a starting ground. You

Re: url_name from resolve in Django 1.2

2010-09-13 Thread SlafS
It seems it's impossible for now. So let me change the question. How to use the already compiled (by Django) url_patterns so i dont have to import and compile the ROOT_URLCONF on every hit of my function? Regards On 9 Wrz, 22:52, SlafS wrote: > Hi there! > > Is there any

Is it possible for template to use context variable as list index?

2010-09-13 Thread David.D
In my template: This is ok: {{ my_list.2 }} But it doesn't work: {{ my_list.index }} index is a context variable (index=2) Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: user created variables

2010-09-13 Thread pixelcowboy
The only reason I dont share the information is that I dont want to bore you to death. The application will need to provide (via a database) per project environment variables for use in external client applications. However, those variables might, or might not change from project to project. The

Bug with distinct + aggregate ?

2010-09-13 Thread donato.gr
Hi, when using 'aggregate(Sum(...))' on a queryset that is also using 'distinct()', 'DISTINCT' is misplaced in resulting SQL query... Here is a silly sample code: I have the following classes: class Son(models.Model): name = models.CharField(max_length=20) def __unicode__(self):

Re: Please add tag for Django 1.2.3 release

2010-09-13 Thread shacker
On Sep 12, 12:12 pm, creecode wrote: > Hello all, > > I asked and we > received! :-)  Thanks Russell! Hmm, the ticket is marked fixed, but the repo is still at 1.2.1. This is not good. 1.2.2 is a security release, and we

Re: Wiki in Django?

2010-09-13 Thread bobhaugen
http://github.com/bartTC/django-wakawaka http://github.com/pinax/django-wakawaka Does not run on flat files, but it is being actively developed and used in Pinax. You might need to check the diffs to figure out which of the above versions to use. -- You received this message because you are

Re: django join queries

2010-09-13 Thread nick.l...@gmail.com
Ok...context helps! :) Try reading this... http://docs.djangoproject.com/en/dev/topics/serialization/#deserialization-of-natural-keys I think that'll help get you where you need to go. n On Mon, Sep 13, 2010 at 2:19 PM, ashy wrote: > Hi Nick, > > I am trying to

Re: django join queries

2010-09-13 Thread ashy
Hi Nick, I am trying to serialize the object and send it to the calling ajax request users = Userdata.objects.all() HttpResponse(serializers.serialize('json', users), mimetype='application/json') in the javascript code, I do not get the user object to call u.username. I guess it wont work that

Re: django join queries

2010-09-13 Thread nick.l...@gmail.com
Ashy, The question what do you want to do with the data is important. When you do Userdata.objects.all() you will get back all the data from both tables. How you access it is different. u = Userdata.objects.all()[0] u.user.name is going to return the name from the User model. u being the

Django empty string saved as MySQL null

2010-09-13 Thread Sithembewena Lloyd Dube
Hi folks, We have a Menu model which defines a nullable field called Rel. The Menu record is persisted via the admin site, and when the Rel textbox is left blank, Django/ MySQL saves the field as null. When a template uses that Menu object, it's Rel property is not seen as an empty string by the

Re: user created variables

2010-09-13 Thread nick.l...@gmail.com
That's fine...well for data types ad a field for types say an integer field and when youcome across a new type you need just increment your integer count by one... ie: STRING = 1 INT = 2 CHAR = 3 TYPE_CHOICES = ( (STRING, 'string'), (INT, 'integer'), (CHAR, 'character'), ) Then add the field to

Re: Change variable value after a click

2010-09-13 Thread nick.l...@gmail.com
you can do that, though not necessary. Your view needs to return the data necessary for ajax to write INTO the webpage. ie on the page you have: action adventure (click for more) when that user clicks, your view needs to return the "more"...(and really only the more and what ever info is

Re: django join queries

2010-09-13 Thread ashy
Yes, I know that. What is the object oriented way of getting the data from both the tables based on the foreign key? thanks for any help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: import Error

2010-09-13 Thread nick.l...@gmail.com
Ahh ok I think I misread your email last time then I thought the django-chat module was named "dojango". There's a couple ways to add django-chat to your pypath...easiest would be to run the setup.py in the django-chat directory. After you've unzipped/tarred the file navigate into the django-chat

Re: django join queries

2010-09-13 Thread Daniel Roseman
On Sep 13, 12:26 pm, ashy wrote: > Ok, > > but I want to retrieve rows from both the tables based on the foreign > key. > User.objects.all() > or > Userdata.objects.all() > will give me data from either table. How can retrieve data from both > the tables using the foreign

Re: Three Django forms in different tabs in one template?

2010-09-13 Thread David De La Harpe Golden
On 13/09/10 12:48, Stodge wrote: > one view can't support > three forms? Uh, it certainly can if you want to write it that way: Multiple django "form" objects can validate different parts of some request.POST dataset, you're not limited to one post one form. You can even use multiple instances

Using IDs for upload_to path

2010-09-13 Thread Tereno
Hi there, I've an ImageField and it requires a upload_to path or a callable. From what I read in the docs, the callable takes two arguments, one of which is the instance of model. It is stated that the model may not have been saved in the database at this point and thus, we cannot assume to obtain

Re: Three Django forms in different tabs in one template?

2010-09-13 Thread Stodge
Ah cunning! Thanks - that's a great idea. On Sep 13, 8:13 am, bruno desthuilliers wrote: > On 13 sep, 13:48, Stodge wrote: > > > I'm working through a nice little feature for my website that will > > bring all user editable preferences/profile

Re: python setup.py install errors

2010-09-13 Thread S66
oh thanks for the reply. yes it is an arm cpu, maybe i will test to recompile my python 2.5 with the provided patch. thanks for the help On 12 Sep., 14:23, Vasil Vangelovski wrote: > Is that NAS with an ARM processor? It might be caused by a bug in python > 2.5: > >

Re: Three Django forms in different tabs in one template?

2010-09-13 Thread bruno desthuilliers
On 13 sep, 13:48, Stodge wrote: > I'm working through a nice little feature for my website that will > bring all user editable preferences/profile options together into a > single web page using tabs. I have the tabs working and I can display > a different Django form on each

Custom Feed Generator XML

2010-09-13 Thread Scott W
Hi, I'm trying to extend the Atom1Feed in the Syndication Framework to print out a list of names stored within Django, similar to the way GData and OData work. I would like to know how to display attributes within an XML tag. So, for example: Scott W s...@... 555-4341 I also want the

Bug in Django when user cancels his request

2010-09-13 Thread Jyrki Hofman
Hello, I have found something a bit odd. I wanted to send an on-the-fly generated file as a response and then delete the file from my disk. I tried to implement it using a file wrapper which deletes the file when it is closed. It worked fine until I tried what happens if a user cancels his

Three Django forms in different tabs in one template?

2010-09-13 Thread Stodge
I'm working through a nice little feature for my website that will bring all user editable preferences/profile options together into a single web page using tabs. I have the tabs working and I can display a different Django form on each tab but I'm confused how to tie it all together using a view.

Response object problem

2010-09-13 Thread girish shabadimath
hi all, im in the task of testing django app.. when i do the simple url tests and check for status_code it gives me 200 which is correct,, but when i use response.template it gives nothing though i use template in the view function...?,,,reason..? this may sound simple for many,,,but plz help

Re: django join queries

2010-09-13 Thread ashy
Ok, but I want to retrieve rows from both the tables based on the foreign key. User.objects.all() or Userdata.objects.all() will give me data from either table. How can retrieve data from both the tables using the foreign key? thanks ashy -- You received this message because you are

Re: django join queries

2010-09-13 Thread Daniel Roseman
On Sep 13, 12:18 pm, ashy wrote: > Hi All, > > I have the following model class > > from django.db import models > from django.contrib.auth.models import User > > # Create your models here. > class Userdata(models.Model): >   user = models.ForeignKey(User) >   location =

django join queries

2010-09-13 Thread ashy
Hi All, I have the following model class from django.db import models from django.contrib.auth.models import User # Create your models here. class Userdata(models.Model): user = models.ForeignKey(User) location = models.CharField(max_length=200) I want to join them on user foreign key. How

Re: Django document said the QueryDict is only immutable, but why I can edit it sometimes

2010-09-13 Thread ouds...@gmail.com
Hi, group, will someone tell me why querydict can be mutable sometimes? thanks... -- 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

Re: Change variable value after a click

2010-09-13 Thread mf
What about using request.is_ajax() inside my view?. -- 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

Re: No module named shortcuts

2010-09-13 Thread jean polo
doh, sorry I didn't even think about re-installing django. indeed it works fine now.. dunno what have happened, didn't update or anything, weird. anyway, thanks for your time and help =) cheers, _y On Sep 13, 10:01 am, bruno desthuilliers wrote: > On 12 sep,

Response object problem

2010-09-13 Thread girish shabadimath
hi all, im in the task of testing django app.. when i do the simple url tests and check for status_code it gives me 200 which is correct,, but when i use response.template it gives nothing though i use template in the view function...?,,,reason..? this may sound simple for many,,,but plz help

Re: No module named shortcuts

2010-09-13 Thread bruno desthuilliers
On 12 sep, 21:30, jean polo wrote: > django.contrib.admin is the problem then.. > I can access the shell if I comment it.. > problem is that I have no idea about why or where to look Should have asked for this right from the beginning but... Could you post the

Re: Django - Multiple columns primary key

2010-09-13 Thread derek
On Sep 10, 6:40 pm, Russell Keith-Magee wrote: > On Fri, Sep 10, 2010 at 7:47 PM, naoy.teruh wrote: > > Hello, > > > I would like to implement multicolumns primary keys in django. > ... > > Did I miss something ? > > Yes - Multicolumn primary keys

Re: import Error

2010-09-13 Thread ravi krishna
Hi Nick, I checked dojango in the python path and its importing it without any errors. And when i run python manage,py runserver it giving 'ImportError: No module named Chat'. Can u please help by telling how to add the app in the python path. Rav! On Fri, Sep 10, 2010 at 11:32 PM,