User profile creation forms

2009-09-09 Thread Rodney Topor
Suppose one wants to store additional information about a user in a separate profile class as described in the documentation. When a user registers, the form displayed should show (all) fields from class User and (some) fields from class Profile. What is the best way to define this form? What

Long user creation forms

2009-09-09 Thread Rodney Topor
The default UserCreationForm in django.contrib.auth.forms only asks for username and password. Given that users also have first and last names and emails, it would be natural for the default form to provide fields for these also. One way to provide these extra fields is to define a subclass of

remember me

2009-09-09 Thread putih
i'm facing a problem for remember_me function but it's actually not working. below are my code:- _views.py _from django.contrib.auth import REDIRECT_FIELD_NAME from django.views.decorators.cache import never_cache def remember_me_login ( request, template_name =

Model manger for the abstract model.

2009-09-09 Thread Alexandre Djioev
Hi everyone, I have an abstract model EventComponent, and from this model I inherit two models - EventCollection (non-abstract) and Event (abstract). I also inherit from Event model and create non-abstract models, for example ClassEvent, LectureEvent e.c. I want to: EventComponent.objects.all()

Leaking python app structure

2009-09-09 Thread Eric Abrahamsen
I have a site with SEND_BROKEN_LINK_EMAILS = True in the settings, which means I get both legitimate 404s and also probes where the bot is being clever by putting the fake URL in the referer heading. Today I got a series of 404 messages that were alarming because they were probing

Re: PostgreSQL or MySQL, What are the +'s and -'s?

2009-09-09 Thread Jason Beaudoin
> > > @Jason - I think that's the number one reason I'm going to PostgreSQL. I > don't use everything all the time but I really like to have the widest array > of query syntax options. MySQL is just too limiting, especially when > PostgreSQL is available. > > The other issue I have with MySQL is

Permissions per model instance

2009-09-09 Thread eka
Hi all.. Is there any way to assign permissions to an instance of a model instead of to a model itself? Example: I have a model for Files so john can (view) file 1, 5 and 6 but not the rest Regards Eka --~--~-~--~~~---~--~~ You received this message because

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Ramiro Morales
On Wed, Sep 9, 2009 at 1:16 PM, Vlastimil Zima wrote: > > Neither name nor app_label fixed situation. > AdminSite instance django.contrib.admin.site is constructed without > any names and it works. > In documentation is written: "If no instance name is provided, a >

What is the correct database format for storing a 2-dimensional table?

2009-09-09 Thread W.P. McNeill
I am writing a Django app to store and manipulate a 2-dimensional table of data. I don't think I'm trying to do anything particularly difficult, but I'm new to both Django and relational databases, so I'm getting confused by various design considerations. I'm hoping there are canonical answers

Django-logging in production mode

2009-09-09 Thread eli
Hi, It's a good idea to logging errors, notices etc using python module logging in app under production mode (Nginx)? I know about for ex: sending error:500 emails to admins etc, but sometimes I want to log errors and lets app go on. (I'm talking about logging errors to the file, and later

Re: Is it secure "enough" to put login info in the session?

2009-09-09 Thread ristretto.rb
Hi Craig, I'm considering something like this Trigger: User comes to site for the first time 1. User requests to be a guest 2. system creates a guest User with randomness for username and password, authenticates and logs in the user, also sets a cookie in the browser with the id of the Guest

Re: Custom url in django Django sitemap

2009-09-09 Thread eli
Hi, Thanks for replay, but I was talking about the django sitemap framework http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/ , and problem: how to add my custom page (serving by server) to output (XML) of the django sitemap framework? regards. On 9 Wrz, 18:47, Peter Coles

Re: Having Trouble with Reverse method

2009-09-09 Thread Streamweaver
Yet more info here. This might be a particular problem due to the particular method being called in multiple URL patterns so I tried making it and calling a named URL pattern but am getting the same message. On Sep 9, 5:18 pm, Streamweaver wrote: > Thanks for all the

Re: Having Trouble with Reverse method

2009-09-09 Thread Streamweaver
Thanks for all the replies. I'm on Django 1.0.2 btw if it makes a difference, I see the extra-patterns. I'm also running this via the manage.py runserver on a development machine and not in staging or production. For the original authors, those variations turn up the same error. To Peters

Re: How to invoke hasNoProfanities?

2009-09-09 Thread Chris Withers
Brandon Taylor wrote: > I would like to do some obscenity filtering on posts, and I see there > is a setting: PROFANITIES_LIST > > But, how to I invoke the hasNoProfanities validator? I searched the > django source code for this, but the only thing I could find was the > setting in conf >

How to invoke hasNoProfanities?

2009-09-09 Thread Brandon Taylor
Hi everyone, I would like to do some obscenity filtering on posts, and I see there is a setting: PROFANITIES_LIST But, how to I invoke the hasNoProfanities validator? I searched the django source code for this, but the only thing I could find was the setting in conf > global_settings.py I'd

Re: How to generate po files ?

2009-09-09 Thread Mirat Can Bayrak
i am calling like python manage.py compilemessages < so django settings module set before compilemessages command executed :/ (i think) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Choices of foreign keys?

2009-09-09 Thread Peter Coles
Oh sorry, thought you wanted multiple categories per photo. Tim's response above is good. As he said, I'd go with the ForeignKey approach, this makes the categories easier to manage and gives you further flexibility of storing additional information within each category (if you want). Also his

Re: Choices of foreign keys?

2009-09-09 Thread Tim
For something like categories, I would go with a separate model and use ForeignKey. For that 1% chance when you have to add a new category, it will be a lot easier. Plus, what if requirements change in the future and you are adding/deleting categories more than you anticipated? Using choices

Re: foreign key not generated when pointing to a model in another application

2009-09-09 Thread jim
True, but the FOREIGN KEY constraints generated are merely ignore by sqlite. However, the CREATE statement should be correct because when I port this to say MySQL, it will be a problem. For any other example the FOREIGN KEY constrains are generated corrcetly in sqlite (athough they are ignore

Re: How to generate po files ?

2009-09-09 Thread Mike Ramirez
On Wednesday 09 September 2009 10:55:54 Mike Ramirez wrote: > # export DJANGO_SETTINGS_MODULE=myproject.settings > # django_admin.py makemessages > > For windows I believe it's: > > C:\> set DJANGO_SETTINGS_MODULE=myproject.settings > C:\> django_admin.py makemessages > I forgot to add that

Re: How to generate po files ?

2009-09-09 Thread Mike Ramirez
On Wednesday 09 September 2009 10:40:47 Léon Dignòn wrote: > I am glad you ask this. I was running in that problem too. > I use Windows Vista and I've run 'django-admin.py makemessages' inside > the folder I also run 'django-admin.py startproject bestsiteever'. > Same error. > > -leond > > On Sep

Re: How to generate po files ?

2009-09-09 Thread Léon Dignòn
I am glad you ask this. I was running in that problem too. I use Windows Vista and I've run 'django-admin.py makemessages' inside the folder I also run 'django-admin.py startproject bestsiteever'. Same error. -leond On Sep 9, 7:28 pm, Mirat Can Bayrak wrote: > Hi, i

Re: Choices of foreign keys?

2009-09-09 Thread Léon Dignòn
Hello Peter, sorry, I was talking about choices, not a choice field: http://docs.djangoproject.com/en/dev/ref/models/fields/#choices Since any photo can only belong to one category (because I say so :) I would tend towards using 1:N instead of M:N. Or did I missunderstand you? If one photo can

How to generate po files ?

2009-09-09 Thread Mirat Can Bayrak
Hi, i finished my site in english and want to convert to some other languages. as mentioned in django docs i added translation tags to my templates than gived that command : horsel...@horselogy-pardus yerelilan $ python manage.py compilemessages Error: This script should be run from the Django

Re: Unique fields that allow nulls

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 12:37 PM, Jan Ostrochovsky < jan.ostrochov...@gmail.com> wrote: > > > But I see as an ultimate solution to distinguish between NULL and > empty string for CharField and TextField, as I see it, here is reason > to have it. > > NULL means undefined (or unknown) value, and its

how to use the generic_inline_formset_factory?

2009-09-09 Thread Viktor
hi, how can I create a page similar to the admin pages in the sense of having a ModelForm and a formset generated with generic_inline_formset_factory, that is model instances related to my "base" model with the content_types framework? I have two models: class Project(models.Model): title

Re: Custom url in django Django sitemap

2009-09-09 Thread Peter Coles
Hi eli, If you want serve a "static file" (that never changes and doesn't take advantage of django's template system) then you shouldn't be serving it with django. You can use django if you really want: http://docs.djangoproject.com/en/dev/howto/static-files/ but you're better off having your

Re: Unique fields that allow nulls

2009-09-09 Thread Jan Ostrochovsky
Karen, thanks for useful workaround. Another (but little bit sick) workaround I see is to create separate class for such field, and an optional OneToOneField to that class... But I see as an ultimate solution to distinguish between NULL and empty string for CharField and TextField, as I see it,

Re: Choices of foreign keys?

2009-09-09 Thread Peter Coles
Hey Léon, ChoiceField is a form field, not a table column—maybe you're thinking about CommaSeparatedIntegerField? You could use that and hardcode which categories represent which ids in your python code. http://docs.djangoproject.com/en/dev/ref/models/fields/#commaseparatedintegerfield On the

Re: foreign key not generated when pointing to a model in another application

2009-09-09 Thread Daniel Roseman
On Sep 9, 5:29 pm, jim wrote: > Am using sqlite3 and django version 1.0 > > class U(models.Model): >     woid = models.ForeignKey('workorder.X') > > In the workorder app I have: > > class X(models.Model): >     woid = models.CharField(max_length=20, primary_key=True) > >

foreign key not generated when pointing to a model in another application

2009-09-09 Thread jim
Am using sqlite3 and django version 1.0 class U(models.Model): woid = models.ForeignKey('workorder.X') In the workorder app I have: class X(models.Model): woid = models.CharField(max_length=20, primary_key=True) When I try : python manage.py sql ceuser I get CREATE TABLE

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Vlastimil Zima
Neither name nor app_label fixed situation. AdminSite instance django.contrib.admin.site is constructed without any names and it works. In documentation is written: "If no instance name is provided, a default instance name of admin will be used." On Sep 9, 5:31 pm, Ramiro Morales

Choices of foreign keys?

2009-09-09 Thread Léon Dignòn
Hello, let's assume we have a model for photos with the fields id, user, photo. Any user should be able to categorize his foto with a given number of categories, e.g. person, car, building. In future it's possible that I add more categories. My question is whether the new category field should

Nested Inlines / Multiple ManyToMany field admin support

2009-09-09 Thread Mike W.
Hey guys. I looked around this group & the web for an answer to this question, but I can't seem to find one. My application has Publications, which have multiple Authors. Each Author has one Person, but each Auther can have multiple Institutions. (This is an app to keep track of academic

ModelAdmins for abstract model and its children

2009-09-09 Thread Aaron
I have an abstract base model as well several models that subclass it. Now I am figuring out how to design the ModelAdmin subclasses for these models. I need a ModelAdmin that can display the fields of the base model (so that the ModelAdmins for the child models don't have to do that themselves)

Custom url in django Django sitemap

2009-09-09 Thread eli
Hi, How to add custom static url (they are not in database) to Django Sitemap? for ex: /about-me.html, /contact.html, /some-static-url.html regards. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Ramiro Morales
On Wed, Sep 9, 2009 at 4:33 AM, Vlastimil Zima wrote: > > Hello, > I found out, that if I made derived class of > django.contrib.admin.sites.AdminSite admin generated by this AdminSite > in unable to to create correct links e.g. for Logout (http:// >

Re: Custom template tags

2009-09-09 Thread Daniel Roseman
On Sep 9, 4:00 pm, tdelam wrote: > Hey, > > I would like to know if I should write a custom template tag or if > anyone can give me some direction on how to do the following: > > 1) User visits a page on a web site, example.org/campaign/businessname > 2) I capture

Re: Sourcing java script file inside django

2009-09-09 Thread Hrishikesh Dhayagude
Thank u very much.. it worked.. Regards, Hrishikesh Dhayagude On Sep 8, 11:38 pm, Ulysses Almeida wrote: > Hi, > On Tue, 8 Sep 2009 10:59:11 -0700 > (PDT),HrishikeshDhayagude wrote: > > > Hi, > [cut] > > If i want to source abc.js

Re: MySQL-Python and Snow Leopard

2009-09-09 Thread Walter Scheper
Brandon Taylor wrote: [snip] > However, I can't get MySQL-Python 1.2.3c1 to compile. I have re- > installed Xcode for 10.6, but I get an error trace a mile long, ending > with error: Setup script exited with error: command 'gcc' failed with > exit status 1 > Hey Brandon, The new version of

Custom template tags

2009-09-09 Thread tdelam
Hey, I would like to know if I should write a custom template tag or if anyone can give me some direction on how to do the following: 1) User visits a page on a web site, example.org/campaign/businessname 2) I capture "businessname" and fetch the details of that user from the database and

Re: Link for new page

2009-09-09 Thread Ajit jena
Hi , I have one question plz help me. I am create a page and it is showing , when I am redirect from view.py page. In *url.py* page I have written urlpatterns = patterns('', (r'^$', login_page), (r'^abc/', main_page), ) *In view.py:* from django.http import HttpResponse def

Re: Link for new page

2009-09-09 Thread Ajit jena
thanks Peter, On Wed, Sep 9, 2009 at 2:28 AM, Peter Coles wrote: > > Make yourself familiar with the django documention page—if you know > where to look for stuff there, you'll find it to be a very handy > resource. http://docs.djangoproject.com/en/dev/ > > > 1: How can I go

Re: understsanding views

2009-09-09 Thread mettwoch
That function should at least return somewhere, I guess to the caller which might be a "view" function that returns a HttpResponse. Anyway, You should consider putting code that updates the database in the "model". Marc On Sep 9, 4:25 pm, elminio wrote: > Hello, > > I

Re: understsanding views

2009-09-09 Thread Javier Guerra
On Wed, Sep 9, 2009 at 9:25 AM, elminio wrote: > I assume that each view should return Httpresponse. What when I just > want to execute function which updates my databes and doesnt redirect > anywhere ? the HTTP client is still waiting for some response. usually i do an

Re: Unique fields that allow nulls

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 9:14 AM, Jan Ostrochovsky wrote: > > Hello, > > I have the exact need, as author of this question: > > http://stackoverflow.com/questions/454436/unique-fields-that-allow-nulls-in-django > . > > I answered on that question because the answer

understsanding views

2009-09-09 Thread elminio
Hello, I assume that each view should return Httpresponse. What when I just want to execute function which updates my databes and doesnt redirect anywhere ? thanks for reply --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: login required

2009-09-09 Thread Jeff Green
I would think you could just extend the User model to store the registered users and then check if the user is registered which would then redirect to the survey page. On Tue, Sep 8, 2009 at 11:30 PM, putih wrote: > > hii, > > need your help on this matter :- > > 1.

IndexError when creating a formset

2009-09-09 Thread chewynougat
Hi, I have instances in my code where I need to save an object with a new pk. Then I need to create and save an inline formset using the newly created object as the instance. form_instance = form.save(commit=False) form_instance.pk = None form_instance.slug = None form_instance.save()

Re: Date Field in ModelForm

2009-09-09 Thread mettwoch
Some more info: Windows Vista Django 1.1Final PostGreSQL 8.3.7 psycopg2 Python 2.5.4 mod_wsgi Apache2.2 On Sep 9, 12:57 pm, Daniel Roseman wrote: > On Sep 9, 11:49 am, mettwoch wrote: > > > > > Hi, > > > I don't understand why the following code produces

Re: haml + sass + django

2009-09-09 Thread Alex Robbins
You might look at http://sandbox.pocoo.org/clevercss/, which is python based. On Sep 8, 9:19 am, ThinRhino wrote: > Hello, > > I just came across haml and sass, but looks like it is built for Ruby on > Rails. > > Any implementation that can work on Django? > > Though I also

Unique fields that allow nulls

2009-09-09 Thread Jan Ostrochovsky
Hello, I have the exact need, as author of this question: http://stackoverflow.com/questions/454436/unique-fields-that-allow-nulls-in-django. I want a value to be unique, if it is not NULL. Database backend allows such construction, but in Django admin I have got this error message when saving

Re: Open Position: Software/System Engineer....Django...

2009-09-09 Thread James
Thanks, I will post there. On Sep 8, 4:41 pm, Jim McGaw wrote: > There is a site for posting Django jobs: > > http://djangogigs.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Encoding question

2009-09-09 Thread Oleg Oltar
Well, I prefer to find alt tag inside my image and check that it's correct instead of, checking that whole response contains some text. btw, have a problem: b = BeautifulSoap(client.get("/")) b.find('img')["alt"] again gives me those strange symbols I am updating my django now. (was using 1.0)

Re: changing model manager

2009-09-09 Thread goobee
great to hear, thanks Karen I will check the ticket and hope goobee --~--~-~--~~~---~--~~ 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@googlegroups.com To

Re: breadcrumb solution

2009-09-09 Thread Mike Dewhirst
Thanks David - I do :) Cheers M David De La Harpe Golden wrote: > Mike Dewhirst wrote: >> I would like to get breadcrumbs working in a simple way. Could anyone >> please help? > >> Is there a better way? > > One thing you can do is a "pure template" based breadcrumb > or pseudo-breadcrumb,

list_filter

2009-09-09 Thread elminio
Hello I have model like: class MyModelA(models.Model): number = models.IntegerField() class MyModel(models.Model): my_model_a = models.ForeignKey(MyModelA) other_field = other data ... and now in admin: class MyModelAdmin(admin.ModelAdmin): list_filter = ("my_model_a") it

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Vlastimil Zima
Django1.1 On Sep 9, 12:40 pm, Ramiro Morales wrote: > On Wed, Sep 9, 2009 at 4:33 AM, Vlastimil Zima > wrote: > > > Hello, > > I found out, that if I made derived class of > > django.contrib.admin.sites.AdminSite admin generated by this AdminSite >

Re: Django admin templates not loading

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 7:23 AM, Simon Lee wrote: > > Hi All, > > I am following the tutorial in the Django website (writing your first > django app) and get it to work on the development server. However, > when I port to Apache, the admin template is not loaded and thus I >

Re: Encoding question

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 5:06 AM, Oleg Oltar wrote: > Hi! > > One of my tests returned following text () > > The test: > from django.test.client import Client > c = Client() > resp = c.get("/") > resp.content > > In [25]: resp.content > Out[25]: '\r\n\r\n\r\n Strict//EN"

Re: changing model manager

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 4:58 AM, goobee wrote: > > hi there > django's features for handling data from a database are great. > Unfortunately I work with a legacy database which does not quite fit > into djangos requirements: > > Class Member(models.Model) >mnum =

Re: How to display and update selected fields from a model

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 4:08 AM, Daniel Roseman wrote: > > As regards updating, Django will only update the fields that have > changed in any case. > I don't believe this is true. Only updating the fields that have changed would require keeping track of what fields in the

Django admin templates not loading

2009-09-09 Thread Simon Lee
Hi All, I am following the tutorial in the Django website (writing your first django app) and get it to work on the development server. However, when I port to Apache, the admin template is not loaded and thus I could not get the nice Django UI with Apache. I try copying the default django admin

Re: Date Field in ModelForm

2009-09-09 Thread mettwoch
Here is the definition of the field: date_due = models.DateField(auto_now_add=True) On Sep 9, 12:57 pm, Daniel Roseman wrote: > On Sep 9, 11:49 am, mettwoch wrote: > > > > > Hi, > > > I don't understand why the following code produces an

Re: [Tutor] Encoding question

2009-09-09 Thread Kent Johnson
On Wed, Sep 9, 2009 at 5:06 AM, Oleg Oltar wrote: > Hi! > > One of my tests returned following text () > > The test: > from django.test.client import Client >  c = Client() > resp = c.get("/") > resp.content > > In [25]: resp.content > Out[25]: '\r\n\r\n\r\n Strict//EN" >

Re: Managers in admin

2009-09-09 Thread Alasdair
I got the admin to use the models.Manager() by overriding the queryset method in my EntryAdmin class: class EntryAdmin(admin.ModelAdmin): [...] def queryset(self, request): return Entry.objects --~--~-~--~~~---~--~~ You received this message

Re: Date Field in ModelForm

2009-09-09 Thread Daniel Roseman
On Sep 9, 11:49 am, mettwoch wrote: > Hi, > > I don't understand why the following code produces an error (see > below): > > > > >>> from django import forms > >>> from ishop.bo.models import Document > >>> d = Document.objects.get(pk=8) > >>> print d.date_due > 2009-08-28 >

Date Field in ModelForm

2009-09-09 Thread mettwoch
Hi, I don't understand why the following code produces an error (see below): >>> from django import forms >>> from ishop.bo.models import Document >>> d = Document.objects.get(pk=8) >>> print d.date_due 2009-08-28 >>> class df(forms.ModelForm): >>> class Meta: >>> model =

Re: breadcrumb solution

2009-09-09 Thread David De La Harpe Golden
Mike Dewhirst wrote: > I would like to get breadcrumbs working in a simple way. Could anyone > please help? > Is there a better way? One thing you can do is a "pure template" based breadcrumb or pseudo-breadcrumb, assuming you have a template inheritance graph with different views rendering

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Ramiro Morales
On Wed, Sep 9, 2009 at 4:33 AM, Vlastimil Zima wrote: > > Hello, > I found out, that if I made derived class of > django.contrib.admin.sites.AdminSite admin generated by this AdminSite > in unable to to create correct links e.g. for Logout (http:// >

Re: IOError: request data read error on POST, anyone solved this?

2009-09-09 Thread Graham Dumpleton
On Sep 9, 8:09 pm, "jeremias.kangas" wrote: > Hi all, > > This error started popping on last sunday, and it keeps happening > pretty randomly, like 1-2 times a day. I read from the internet that > this problem seems to be pretty common, though didn't find out if >

IOError: request data read error on POST, anyone solved this?

2009-09-09 Thread jeremias.kangas
Hi all, This error started popping on last sunday, and it keeps happening pretty randomly, like 1-2 times a day. I read from the internet that this problem seems to be pretty common, though didn't find out if anyone had any success solving it. My setup is WSGI+django on ubuntu. Django version

Re: formatting dates for DateTimeField()

2009-09-09 Thread Gonzalo
I thought that was the case, Thanks for your reply. G. On Sep 9, 10:33 am, Daniel Roseman wrote: > On Sep 9, 9:21 am, Gonzalo wrote: > > > How would you store that into the database, what type of field on the > > model I mean? should I store the

Re: Encoding question

2009-09-09 Thread Oleg Oltar
It's more then great! Thanks! 2009/9/9 ray > > Hi Oleg > > You can use BeautifulSoup > > from BeautifulSoup import BeautifulSoup > >>> html = '\r\n\r\n\r\n Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>\r\n\r\n xmlns="http://www.w3.org/1999/xhtml;>\r\n

Re: Encoding question

2009-09-09 Thread ray
Hi Oleg You can use BeautifulSoup from BeautifulSoup import BeautifulSoup >>> html = '\r\n\r\n\r\n>> Strict//EN" >>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>\r\n\r\n>> xmlns="http://www.w3.org/1999/xhtml;>\r\n \r\n>> http-equiv="content-type" content="text/html; charset=utf-8"

Re: apache2+mod_wsgi: 403 Forbidden

2009-09-09 Thread Léon Dignòn
I solved the Problem. It was my fault and because of that the default virtual host served the request. :( Thank you for your help! On 9 Sep., 01:21, Graham Dumpleton wrote: > On Sep 9, 12:28 am, Matias wrote: > > > sorry, I messed up! > >

Re: formatting dates for DateTimeField()

2009-09-09 Thread Daniel Roseman
On Sep 9, 9:21 am, Gonzalo wrote: > How would you store that into the database, what type of field on the > model I mean? should I store the number of seconds + number of days in > seconds? or the datetime.timedelta() object? > > Thanks You can't store a timedelta object

Re: breadcrumb solution

2009-09-09 Thread Mike Dewhirst
Daniel Roseman wrote: > On Sep 9, 7:32 am, Mike Dewhirst wrote: >> I would like to get breadcrumbs working in a simple way. Could anyone >> please help? >> >> I think I need a singleton with a dict like this ... >> >> bread = singleton() >> >> bread.dct['last_title'] = >>

Encoding question

2009-09-09 Thread Oleg Oltar
Hi! One of my tests returned following text () The test: from django.test.client import Client c = Client() resp = c.get("/") resp.content In [25]: resp.content Out[25]: '\r\n\r\n\r\nhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>\r\n\r\nhttp://www.w3.org/1999/xhtml;>\r\n \r\n\r\n

Re: automatic initialization of sample data

2009-09-09 Thread Jan Ostrochovsky
Bill, thanks for answer, my comments are inline: On Sep 8, 4:29 pm, Bill Freeman wrote: > Well, do you want this to happen every time that the module is imported?  Or > spend time > each server start determining that these items are already in the data base > and skipping >

Re: breadcrumb solution

2009-09-09 Thread Daniel Roseman
On Sep 9, 7:32 am, Mike Dewhirst wrote: > I would like to get breadcrumbs working in a simple way. Could anyone > please help? > > I think I need a singleton with a dict like this ... > > bread = singleton() > > bread.dct['last_title'] = > > Within each view and before

Incorrect {{root_path}} in classes derived from AdminSite

2009-09-09 Thread Vlastimil Zima
Hello, I found out, that if I made derived class of django.contrib.admin.sites.AdminSite admin generated by this AdminSite in unable to to create correct links e.g. for Logout (http:// 127.0.0.1:8000/admin/Nonelogout/), Change Password (http:// 127.0.0.1:8000/admin/Nonepassword_change/), etc.

Re: problem in define variables.

2009-09-09 Thread fchow
The template wants a dictionary of key-value pairs, and you called that dict 'variables' in your code. So you need to define a variable called variables that holds the data to pass to the template. Example: variables = {'foo':'bar', 'a':3} return render_to_response('survey.html', variables) Now

changing model manager

2009-09-09 Thread goobee
hi there django's features for handling data from a database are great. Unfortunately I work with a legacy database which does not quite fit into djangos requirements: Class Member(models.Model) mnum = models.ForeignKey(, primary_key=True) enum = models.ForeignKey(,

Re: Security: Django vs popular PHP apps?

2009-09-09 Thread Nick Lo
> I am hoping to get some reasonably knowledgeable, and unbiased, > responses. > > I was thinking about putting together a wordpress blog. Then I came > across a recent slashdot article about recent wordpress security > issues. I did a little research, and found that wordpress has quite a >

Re: multi-table inheritance - how to access child object methods/attributes

2009-09-09 Thread Jan Ostrochovsky
Manfre, thanks. It seems like ultimate solution, on the other hand, it seems quite low level and adds more complexity, which should be added not only for __unicode__() but also for each method or attribute, which I'd handle this way. I meant, if here is something like that:

Re: formatting dates for DateTimeField()

2009-09-09 Thread Gonzalo
How would you store that into the database, what type of field on the model I mean? should I store the number of seconds + number of days in seconds? or the datetime.timedelta() object? Thanks > Stop calling int on the return value > > >>> import datetime > >>> time_start =

Re: How to display and update selected fields from a model

2009-09-09 Thread Daniel Roseman
On Sep 9, 7:10 am, Jim Myers wrote: > I have a database model with many fields, some of which I don't want > displayed in a form and others I don't want to be editable.  Is it > possible to do this with a ModelForm?  Or is it even possible with > regular forms? > >

Re: Editors of choice

2009-09-09 Thread Benjamin Buch
I second that. > > Vim > --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to

Re: python manage.py syncdb problem

2009-09-09 Thread Zico
On Wed, Sep 9, 2009 at 11:40 AM, ankit rai wrote: > hello, > > this error shows that there is some postgres db connection exception.please > check ur connection As far as i know, everything is ok so far. But, if i check with *python manage.py dbshell, it can connect!* --

Re: unicode error when adding a related object in admin inline

2009-09-09 Thread Miklós
Thanks, Karen. I was using gettext, and replacing it to ugettext indeed fixed the problem. On Sep 7, 7:06 pm, Karen Tracey wrote: > On Mon, Sep 7, 2009 at 12:53 PM, Miklos wrote: > > > Hi, > > > I have models with verbose names translated into

Re: how to deploy an app that gets used by people in multiple time zones

2009-09-09 Thread Margie
Sorry for the delay in response - was on vacation for a few days. After reading up more on naive and aware timezones in python, this all makes more sense now. Thanks for your pointers, they were helpful. Margie On Sep 4, 9:03 am, Brian Neal wrote: > On Sep 4, 10:47 am,

Re: how to deploy an app that gets used by people in multiple time zones

2009-09-09 Thread Margie
Tracy, Sorry for the delay, just got back from a short vacation. Thanks very much for your clarification. I think I now understand how to proceed! On Sep 7, 8:06 pm, Tracy Reed wrote: > On Thu, Sep 03, 2009 at 03:48:14PM -0700, Margie spake thusly: > > > What is the

breadcrumb solution

2009-09-09 Thread Mike Dewhirst
I would like to get breadcrumbs working in a simple way. Could anyone please help? I think I need a singleton with a dict like this ... bread = singleton() bread.dct['last_title'] = Within each view and before doing anything else I want to ... def someview(request): title = 'whatever'

Re: python manage.py syncdb problem

2009-09-09 Thread Kenneth Gonsalves
On Wednesday 09 Sep 2009 11:07:22 am Zico wrote: > File > "/usr/lib/python2.6/site-packages/django/contrib/gis/db/backend/postgis/man >agement.py", line 13, in _get_postgis_func > cursor.execute('SELECT %s()' % func) > *psycopg2.InternalError: current transaction is aborted, commands

How to display and update selected fields from a model

2009-09-09 Thread Jim Myers
I have a database model with many fields, some of which I don't want displayed in a form and others I don't want to be editable. Is it possible to do this with a ModelForm? Or is it even possible with regular forms? Furthermore, I only want the SQL update statement to update ONLY the fields