Re: haystack

2011-05-11 Thread Tarkeshwar Thakur
In your settings file http://docs.djangoproject.com/en/dev/topics/settings/ On Thu, May 12, 2011 at 10:20 AM, pankaj sharma wrote: > hello friends, i want to use haystack for my website, > but i am having too many problems to install it. > in the dowumentation it is

Re: Django Admin site and password field

2011-05-11 Thread Gabe
I am using built-in Django admin. In my models.py file password field is defined: password = models.CharField(max_length=64) I just can`t see password type field for models. On 11 Maj, 20:26, Shawn Milochik wrote: > It sounds like you're not using the built-in Django

haystack

2011-05-11 Thread pankaj sharma
hello friends, i want to use haystack for my website, but i am having too many problems to install it. in the dowumentation it is telling to add haystack to ur installed apps. now it it telling to do "HAYSTACK_SITECONF = 'myproject.search_sites'" now where should i type this i dont have any idea

Overide error messages in models

2011-05-11 Thread Daniel França
Hi all, I need to override error messages (like for required fields) directly in Models, I don't wanna duplicate code declaring some fields again in forms, and in some cases I don't even create the forms, just using generic views for model... I was looking for a solution to change the default

Re: Tutorial: "Customize the admin look and feel"

2011-05-11 Thread BobG
Ramiro Morales: Yep! Wowza! That did it. Thank you very much! Moving forward again! Pax! BobG On May 11, 8:24 pm, Ramiro Morales wrote: > On Wed, May 11, 2011 at 8:39 PM, BobG wrote: > > I'm stuck on something that seems pretty > > simple: "Customize

Re: Django 1.3 CSRF faild when upgraded from Django 1.2.5

2011-05-11 Thread 阮明辉
I had try it , but it did't work . return render_to_response('account/login.html') these code is invoke when the http post method is 'get' but my problem is 'POST' I add django.contrib.csrf.middleware.CsrfResponseMiddleware to my settings and it can work but I think this is not the best solution

Re: Tutorial: "Customize the admin look and feel"

2011-05-11 Thread Ramiro Morales
On Wed, May 11, 2011 at 8:39 PM, BobG wrote: > I'm stuck on something that seems pretty > simple: "Customize the admin look and feel." I am unable to change > "Django administration" at the top of the page. > > Here is the questionable line of code in settings.py: >

Tutorial: "Customize the admin look and feel"

2011-05-11 Thread BobG
Django users: It is time to ask for help. I'm a newbie working the tutorial. I'm using Linux Mint, Python 2.6, and Django 1.3. So far, everything has been working smoothly, but I'm stuck on something that seems pretty simple: "Customize the admin look and feel." I am unable to change "Django

django admin and static files

2011-05-11 Thread Juan Pablo Romero Méndez
Hello, I'm trying to use a custom javascript file in the admin app with Media: class MyAdmin(admin.ModelAdmin): class Media: js = ('js/my.js',) the problem is that after installing the staticfiles app (in INSTALLED_APPS) and after setting STATIC_URL = '/media/', the admin app is

Re: imagefield upload_to

2011-05-11 Thread Brian Craft
solved this by moving it to the model clean() method, and using imagefield.file.open() and imagefield.file.read() to get the data for computing the other fields. On Wed, May 11, 2011 at 1:28 PM, Brian Craft wrote: > I have a model with an imagefield, and some fields

Re: DecimalFields, Floats, and Strings?

2011-05-11 Thread Shawn Milochik
On 05/11/2011 05:26 PM, Nan wrote: Yeah, I'm aware of the distinction between the types -- just wasn't paying enough attention when I added the default and the filter, and had to back up and take a second look when the filter started throwing exceptions. So basically it's a weird artifact of

Re: DecimalFields, Floats, and Strings?

2011-05-11 Thread Nan
Yeah, I'm aware of the distinction between the types -- just wasn't paying enough attention when I added the default and the filter, and had to back up and take a second look when the filter started throwing exceptions. So basically it's a weird artifact of how defaults are handled by the ORM?

Re: how to get the test runner to only rebuild & populate the test_database if it changed?

2011-05-11 Thread Phlip
> Me again. Still helping clients TDD despite obese databases. [localhost] run: python manage.py test --settings=test_settings my_app --verbosity=0 -- Ran 2 tests in 0.018s OK Eat my vapor trail, b-words! Here's how I did it:

Re: Error (EXTERNAL IP): /add_comment/10/

2011-05-11 Thread Aragorn
Thanks !!! Now it works great! On 10 Mag, 00:29, Ulrich Petri wrote: > > message = "Comment was was added to '%s' by '%s': \n\n%s" % (self.post, > > self.author, self.body) > > Most likely your users are posting utf-8 data which you are trying to insert > into a byte string . > >

imagefield upload_to

2011-05-11 Thread Brian Craft
I have a model with an imagefield, and some fields that are computed from the image. I'm trying to override the "save" method to fill in the other fields. When I test this in the admin, there are two problems: first, the path (mymodel.image.path) doesn't honor the upload_to setting on the field.

django-profile redirect to user's profile

2011-05-11 Thread christian.posta
I'm trying to understand the best way to redirect a user to their profile once they successfully login to the application. I'm using django-profiles to manage a custom user profile. By default, the redirect url is specified in settings.py as LOGIN_REDIRECT_URL. However, the url entry in the

Problems using django-taggit; tags disappear in the admin

2011-05-11 Thread Thomas Weholt
I got a model using django-taggit. It works great when I add tags in the admin, but when the tags are added in code ( they're read from the EXIF-data in a photo, the keywords part ) - nothing is shown in the admin change form tag-field for the model. I can see the values are stored correctly when

Re: Formsets and new 1.3 class based views

2011-05-11 Thread Iván Raskovsky
BTW you can find some example views and how to use them in the tests! Iván On Wed, May 11, 2011 at 3:50 PM, DK wrote: > Fantastic piece of work. I will try to dive into. > DK > > On May 11, 8:02 pm, Iván Raskovsky wrote: >> On Wed, May 11, 2011 at

Re: DecimalFields, Floats, and Strings?

2011-05-11 Thread Shawn Milochik
On 05/11/2011 03:01 PM, Nan wrote: Using Django 1.2.3, I recently declared a DecimalField on a model, and it happily accepts a float as its default value, but it won't filter on a float (it throws a TypeError instead). Is there a reason for this inconsistency? DecimalField subclasses Field,

DecimalFields, Floats, and Strings?

2011-05-11 Thread Nan
Using Django 1.2.3, I recently declared a DecimalField on a model, and it happily accepts a float as its default value, but it won't filter on a float (it throws a TypeError instead). Is there a reason for this inconsistency? -- You received this message because you are subscribed to the Google

Re: Formsets and new 1.3 class based views

2011-05-11 Thread DK
Fantastic piece of work. I will try to dive into. DK On May 11, 8:02 pm, Iván Raskovsky wrote: > On Wed, May 11, 2011 at 1:29 PM, DK wrote: > > What is a proper way to handle formsets with new class based views? > > Should I use standard forms views like

Re: Django Admin site and password field

2011-05-11 Thread Shawn Milochik
It sounds like you're not using the built-in Django admin, which would make your life easier. Assuming you want to do it the hard way, you can just use a PasswordInput widget. http://docs.djangoproject.com/en/1.3/ref/forms/widgets/ -- You received this message because you are subscribed to

Django Admin site and password field

2011-05-11 Thread Gabe
Hi all, this is my first post on this group so be gentle ;) I`ve crated a model class and an admin site. My model Users has password field. How can I rewrite it to be a password field and to get stars when I`am typing password (when creating a new user by admin site)? Sorry for my English but

Re: Formsets and new 1.3 class based views

2011-05-11 Thread Iván Raskovsky
On Wed, May 11, 2011 at 1:29 PM, DK wrote: > What is a proper way to handle formsets with new class based views? > Should I use standard forms views like CreateView, I did not saw any > views dedicated to handle formsets. Hi DK. I've faced the same issue some weeks ago, and I

Formsets and new 1.3 class based views

2011-05-11 Thread DK
What is a proper way to handle formsets with new class based views? Should I use standard forms views like CreateView, I did not saw any views dedicated to handle formsets. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Readonly fields for existing items on admin inlines

2011-05-11 Thread Vinicius Massuchetto
Hi! In a tabular inline, i want that the added items can't be changed or deleted. I'm ok with the `can_delete` option, but setting `readonly_fields` will also turn the form entry at the bottom to be readonly too. There's another problem with some more fields that I need to display in this form,

how to get the test runner to only rebuild & populate the test_database if it changed?

2011-05-11 Thread Phlip
Djangoists: Me again. Still helping clients TDD despite obese databases. Right now the test suite takes a minute to build a database with >20 models (and lots of fields in each one), then load a mere 7,000 records. Yes I will cut down on the records, but building the database, in sqlite3

How to use django-taggit in admin.py?

2011-05-11 Thread Thomas Weholt
I want to show tags used in a model in my admin.py file, to be able to sort by tag etc. but it crashes with "Caught AttributeError while rendering: 'TaggableManager' object has no attribute 'flatchoices'" if I add 'tags' to list_filter in my ModelAdmin. How can I use django-taggit in the admin

Re: Decimal * Float problem

2011-05-11 Thread Ian Clelland
On Wed, May 11, 2011 at 1:14 AM, Colin Corbett wrote: > Thanks! Solved: > > In models.py: > > class OurProducts(models.Model): > code = models.CharField(max_length=60) > name = models.CharField(max_length=80) > price = models.DecimalField (max_digits=8,

Re: Logging view exceptions: A tip and a question.

2011-05-11 Thread Shawn Milochik
On 05/11/2011 09:57 AM, Venkatraman S wrote: My response is more along the lines of performance gain - why not use asynchronous logging? I havent used logging extensively, but is the default logging scheme in scheme synchronous? -V This was already answered by a couple of people yesterday

Re: Logging view exceptions: A tip and a question.

2011-05-11 Thread Venkatraman S
On Tue, May 10, 2011 at 11:42 PM, Shawn Milochik wrote: > > Assuming performance won't be a major concern, I'd like to decorate all my > views automatically. My first thought was middleware, but since it handles > requests and responses, I don't think it's the right layer.

Re: form that displays an elements list with checkboxes

2011-05-11 Thread Marc Aymerich
On Wed, May 11, 2011 at 3:24 PM, Daniel Roseman wrote: > On Wednesday, May 11, 2011 2:17:07 PM UTC+1, Marc Aymerich wrote: >> >> Hi, >> I want to do a form that displays a list of elements that can be selected >> with a checkbox and then submit the selected elements, but I

Re: form that displays an elements list with checkboxes

2011-05-11 Thread Daniel Roseman
On Wednesday, May 11, 2011 2:17:07 PM UTC+1, Marc Aymerich wrote: > > Hi, > I want to do a form that displays a list of elements that can be selected > with a checkbox and then submit the selected elements, but I haven't found > any code sample for this. I'll apreciate if someone can give me a

form that displays an elements list with checkboxes

2011-05-11 Thread Marc Aymerich
Hi, I want to do a form that displays a list of elements that can be selected with a checkbox and then submit the selected elements, but I haven't found any code sample for this. I'll apreciate if someone can give me a link to an example or any advice on this! Many thanks! -- Marc -- You

Re: unit testing and file location

2011-05-11 Thread Calvin Spealman
You can run your tests with their own --settings parameter with the specific variations you want to test under. On May 10, 2011 5:21 PM, "Brian Craft" wrote: I would like unit tests that do file manipulations to run with a different storage "location", so they're not

Re: [] Filtering on weekday

2011-05-11 Thread Benedict Verheyen
On 11/05/2011 11:47, Henrik Genssen wrote: > you should try week_day instead > http://docs.djangoproject.com/en/dev/ref/models/querysets/#week-day > > regards > Henrik Henrik, thanks, it works. I don't know how I missed that. Regards, Benedict -- You received this message because you are

RE: [] Filtering on weekday

2011-05-11 Thread Henrik Genssen
you should try week_day instead http://docs.djangoproject.com/en/dev/ref/models/querysets/#week-day regards Henrik >reply to message: >date: 11.05.2011 11:38:40 >from: "Benedict Verheyen" >to: django-users@googlegroups.com >subject: [] Filtering on weekday > >Hi, >

EuroPython: Early Bird will end in 2 days!

2011-05-11 Thread Palla
Hi all, If you plan to attend, you could save quite a bit on registration fees! The end of Early bird is on May 12th, Friday, 23:59:59 CEST. We'd like to ask to you to forward this post to anyone that you feel may be interested. We have an amazing lineup of tutorials, events and talks. We have

Filtering on weekday

2011-05-11 Thread Benedict Verheyen
Hi, I've developed a calltracking app and I would want to know how many calls we have on Monday, Tuesday and so on. I would like to filter on weekdays as specified in the date module as date.weekday() Is there an easy way to do this? I've tried this: c=Call.objects.filter(date_created__day=3)

Re: performance of model instgance save()

2011-05-11 Thread Thomas Weholt
On Wed, May 11, 2011 at 10:21 AM, Daniel Roseman wrote: > On Wednesday, May 11, 2011 7:50:16 AM UTC+1, Brian wrote: >> >> Sure - it's just that bit more convenient and readable to use the ORM >> approach. If I get the chance, I must try substituting direct calls to >>

My DEF is not displaying on the Admin Form??

2011-05-11 Thread Colin Corbett
Hello, My DEF is not displaying on the Admin Form. models.py = class OurProducts(models.Model): code = models.CharField(max_length=60) price = models.DecimalField (max_digits=8, decimal_places=2) def combined_price(self): from decimal import Decimal return round(self.price *

Re: performance of model instgance save()

2011-05-11 Thread Daniel Roseman
On Wednesday, May 11, 2011 7:50:16 AM UTC+1, Brian wrote: > > Sure - it's just that bit more convenient and readable to use the ORM > approach. If I get the chance, I must try substituting direct calls to > psycopg and see if that makes it significantly faster again. I'd guess > there's maybe

Re: Decimal * Float problem

2011-05-11 Thread Colin Corbett
Thanks! Solved: In models.py: class OurProducts(models.Model): code = models.CharField(max_length=60) name = models.CharField(max_length=80) price = models.DecimalField (max_digits=8, decimal_places=2) def combined_price(self): from decimal import Decimal return

Re: performance of model instgance save()

2011-05-11 Thread Brian
Sure - it's just that bit more convenient and readable to use the ORM approach. If I get the chance, I must try substituting direct calls to psycopg and see if that makes it significantly faster again. I'd guess there's maybe another factor of 2 to be had. -- You received this message because