submit logins over SSL

2009-03-25 Thread Ryan Kelly
Hi All, I'm trying to set things up so that my login form uses SSL to protect the user's password in transit. Basically, the behaviour I'm after is as follows: 1) Unauthenticated user requests http://site/private/ 2) They're redirected to http://site/login/ 3) They submit their deta

inlineformset_factory. how to get pk of parent model without saving.

2009-03-25 Thread igor.potapenko
Hi, people! I want to write a view, which save all my data, entered to form.(like contrib.admin) But I got a problem. How to get a pk value of parent form, when it's just saved(form is continue editing)? I have such models: ## class Question(models.Model): number = models.IntegerField(

Re: Strange behaviour with ImageField

2009-03-25 Thread Julien Phalip
On Mar 26, 4:42 pm, Michael Strickland wrote: > You should just be able to take out the MEDIA_ROOT portion of your > upload_to path. So instead of: >     upload_to='%s/images/' % settings.MEDIA_ROOT > You would have: >     upload_to='images/' > > That should make it store the relative address and

Re: Strange behaviour with ImageField

2009-03-25 Thread Michael Strickland
You should just be able to take out the MEDIA_ROOT portion of your upload_to path. So instead of: upload_to='%s/images/' % settings.MEDIA_ROOT You would have: upload_to='images/' That should make it store the relative address and not the absolute address in your database. As for {{photo.

Re: Does the INSTALLED_APPS order of auth and contenttypes maters?

2009-03-25 Thread @@
Thanks, I'll try and see if i can work out a fix. On Thu, Mar 26, 2009 at 8:41 AM, Russell Keith-Magee wrote: > > Ordinarily the order in INSTALLED_APPS _shouldn't_ matter. However, > this looks like you're hitting a form of #7052. > > The problem plays out like this: Certain applications (in par

Strange behaviour with ImageField

2009-03-25 Thread Julien Phalip
Hi, Sorry if my question seems trivial, but I've looked around for an answer and I'm really at loss... I've got a simple model: class Photo(models.Model): image_file = models.ImageField(_('image file'), upload_to='%s/ images/' % settings.MEDIA_ROOT) But when I upload an image via the admin

Re: creating model instance with existing foreign key db entry

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 20:38 -0700, adrian wrote: > > I have a Sighting model which has a foreign key field "notes" to a > model called Notes. > Notes has a predefined empty note with id=1. If the user specifies > no note then > I want the sighting to reference this predefined empty note. > So i

creating model instance with existing foreign key db entry

2009-03-25 Thread adrian
I have a Sighting model which has a foreign key field "notes" to a model called Notes. Notes has a predefined empty note with id=1. If the user specifies no note then I want the sighting to reference this predefined empty note. So in my view: note = form.cleaned_data['notes'] if note != "": #

Re: Help with ChoiceField

2009-03-25 Thread Kuros
Solved. -Kuros On Wed, Mar 25, 2009 at 5:34 PM, Kuros wrote: > > Hello, > > I am trying to create a Form that functions as follows: > > There are three ChoiceFields. The values of the third are dependent > upon the selected values in the first two. After the user selects the > first two, he clic

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 18:34 -0700, Joshua Partogi wrote: > I agree with David. > > I think this migration tool is essential these days. Anything will do > for me as long as it comes prepackaged with django. But that's just the point. *Anything* clearly won't do. You already have "django-admin.py

Re: Is there a programmatic way to loop through all the possible URLs in a site?

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 17:52 -0700, Joe Murphy wrote: [...] > and, with the help of the related > views, figure out all the possible URLs of a Django site. That could be an infinite set. Consider how many URLs this pattern represents, for example: /foo/bar/(?P.*)/$ > Why am I interested

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 17:04 -0700, David Lindquist wrote: [...] > Why has it taken so long for Django to acquire this functionality > when a framework like Ruby on Rails has had it for years? Is there > something about Django that makes it more difficult to implement? Was > the Rails impleme

Re: Missing features on Django ORM (Query Cache, Persistant Connexion/Connexion Pool)

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 16:01 -0700, Kedare wrote: > Hello, > I'm here because i need to know if the following feature will be > included in the futures releases of django (if yes, what release ?) or > why are they missing ? > -- REAL Query cache (like in ruby on rails), very useful if you have > re

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Joshua Partogi
I agree with David. I think this migration tool is essential these days. Anything will do for me as long as it comes prepackaged with django. Best regards, On Mar 26, 11:04 am, David Lindquist wrote: > On Mar 25, 2009, at 4:54 PM, Russell Keith-Magee wrote: > > > > > > > On Thu, Mar 26, 2009 a

Re: What to use: release or development?

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 12:51 -0700, rihad wrote: > 1) From the FAQ (http://docs.djangoproject.com/en/dev/faq/install/): > Q: Should I use the official version or development version?¶ > A: [...] we recommend that you use the latest development code, > because it generally contains more features and

Re: Having trouble authenticating/validating

2009-03-25 Thread Karen Tracey
On Tue, Mar 24, 2009 at 2:11 PM, Adam Yee wrote: > So, I now pass the bound form, but still no validation error messages > show up. More importantly, is_valid is still returning false even > when I try logging in as a super user. I also removed checking for > is_active since the AuthenticationF

Re: Missing features on Django ORM (Query Cache, Persistant Connexion/Connexion Pool)

2009-03-25 Thread Kedare
>> To my knowledge most of the core >> developers feel that a full identity mapper isn't appropriate for Django. Why ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: template tag for nested tables

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 09:46 -0700, Jesse wrote: > One research project can have many publications. One model includes > the research projects, one model includes the publications and a third > model assigns multiple publications to each research project. > The model: > class Researchproject(model

Re: Auth (or session?) issue and www prefix

2009-03-25 Thread Julien Phalip
On Mar 26, 11:55 am, Graham Dumpleton wrote: > On Mar 26, 11:04 am, Julien Phalip wrote: > > > Hi there, > > > If I login on my site on example.com, and then visitwww.example.com > > it asks me to login again. I can't tell if it's an issue with > > contrib.auth or contrib.session, or if that's a

Re: request object in custom template filter code?

2009-03-25 Thread Malcolm Tredinnick
On Wed, 2009-03-25 at 05:23 -0700, foxbunny wrote: > I am trying to write a custom template filter which takes a variable > which is a model object and grabs fields from a related object based > on request.session['lang'] parameter. Or it would if I knew how to get > the `lang` parameter from with

Re: ManyToMany

2009-03-25 Thread Russell Keith-Magee
On Wed, Mar 25, 2009 at 9:54 PM, Bro wrote: > > Hi, > > I'm trying to use ManyToMany in 2 sens : > > --- > class Person(models.Model): >    name = models.CharField(max_length=128) >    groups = models.ManyToManyField(Group, through='Membership') > >    def __unicode__(

Re: Auth (or session?) issue and www prefix

2009-03-25 Thread Graham Dumpleton
On Mar 26, 11:04 am, Julien Phalip wrote: > Hi there, > > If I login on my site on example.com, and then visitwww.example.com > it asks me to login again. I can't tell if it's an issue with > contrib.auth or contrib.session, or if that's a problem with my Apache > configuration. My guess is tha

Is there a programmatic way to loop through all the possible URLs in a site?

2009-03-25 Thread Joe Murphy
Hi all, I've been doing some digging on this and haven't found a way to loop through the urlpatterns in a given site (I'm going on the assumption that all urls are stored in urls.py) and, with the help of the related views, figure out all the possible URLs of a Django site. Why am I interested i

Re: model filed with default type set in database

2009-03-25 Thread Russell Keith-Magee
On Thu, Mar 26, 2009 at 1:02 AM, mark wrote: > > so its not possible to model this in django? > >>  created timestamp without time zone DEFAULT now(), >>  number_polls integer DEFAULT 0, Depends on exactly what you are trying to achieve. Django doesn't support database-level defaults - Django's

Re: Does the INSTALLED_APPS order of auth and contenttypes maters?

2009-03-25 Thread Russell Keith-Magee
On Thu, Mar 26, 2009 at 1:22 AM, @@ wrote: > Hi, > I run into a strange problem when i changed my code a little and then test > my apps. > In some tests(not the first) i got the error message below: ... > IntegrityError: (1452, 'Cannot add or update a child row: a foreign key > constrai > nt fail

Help with ChoiceField

2009-03-25 Thread Kuros
Hello, I am trying to create a Form that functions as follows: There are three ChoiceFields. The values of the third are dependent upon the selected values in the first two. After the user selects the first two, he clicks a "Get List" button, which reloads the with a populated third ChoiceField.

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 8:04 PM, David Lindquist wrote: > > > On Mar 25, 2009, at 4:54 PM, Russell Keith-Magee wrote: > > > > > On Thu, Mar 26, 2009 at 8:42 AM, Joshua Partogi > > wrote: > >> > >> Is there any chance dmigrations > >> (http://code.google.com/p/dmigrations/) will be merged into dja

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread David Lindquist
On Mar 25, 2009, at 4:54 PM, Russell Keith-Magee wrote: > > On Thu, Mar 26, 2009 at 8:42 AM, Joshua Partogi > wrote: >> >> Is there any chance dmigrations >> (http://code.google.com/p/dmigrations/) will be merged into django >> codebase? Because it removes the pain for db migrations :-D > > d

Auth (or session?) issue and www prefix

2009-03-25 Thread Julien Phalip
Hi there, If I login on my site on example.com, and then visit www.example.com it asks me to login again. I can't tell if it's an issue with contrib.auth or contrib.session, or if that's a problem with my Apache configuration. My guess is that the session/cookies are not shared between www.exampl

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Russell Keith-Magee
On Thu, Mar 26, 2009 at 8:42 AM, Joshua Partogi wrote: > > Is there any chance dmigrations > (http://code.google.com/p/dmigrations/) will be merged into django > codebase? Because it removes the pain for db migrations :-D dmigrations is one of several database schema migration projects that exis

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 7:42 PM, Joshua Partogi wrote: > > Is there any chance dmigrations > (http://code.google.com/p/dmigrations/) will be merged into django > codebase? Because it removes the pain for db migrations :-D > > Regards, > > -- > If you can't believe in God the chances are your God i

will dmigrations be merged into django codebase?

2009-03-25 Thread Joshua Partogi
Is there any chance dmigrations (http://code.google.com/p/dmigrations/) will be merged into django codebase? Because it removes the pain for db migrations :-D Regards, -- If you can't believe in God the chances are your God is too small. Read my blog: http://joshuajava.wordpress.com/ Follow me

Re: manage.py syncdb Ignoring Models

2009-03-25 Thread Karen Tracey
On Wed, Mar 25, 2009 at 5:39 PM, Darren Mansell wrote: > I'm just trying to do a bit of home development on Ubuntu 9.04 which has > Python 2.6. > > When trying to populate the database from the models it's randomly ignoring > model definitions. I have no idea what's going on but the deprecation >

A message for Danny: psycopg2 Visual Studio installation error on XP

2009-03-25 Thread dj
I would like to start by apologizing to Danny, has I did not reply to him immediately. Danny sent me an email regrading the installation of psycop2 for PostgreSQL. He was getting a Visual Studio installation error. I have been wrapped up at work and have just recently gotten around to really look

Re: Missing features on Django ORM (Query Cache, Persistant Connexion/Connexion Pool)

2009-03-25 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 7:01 PM, Kedare wrote: > > Hello, > I'm here because i need to know if the following feature will be > included in the futures releases of django (if yes, what release ?) or > why are they missing ? > -- REAL Query cache (like in ruby on rails), very useful if you have > r

Missing features on Django ORM (Query Cache, Persistant Connexion/Connexion Pool)

2009-03-25 Thread Kedare
Hello, I'm here because i need to know if the following feature will be included in the futures releases of django (if yes, what release ?) or why are they missing ? -- REAL Query cache (like in ruby on rails), very useful if you have redundant SQL request (like multiple recursive requests by exam

Re: Creating bound form and sending it to the page without validation

2009-03-25 Thread Marek Wawrzyczek
Sorry for the late reply. I did as you suggested - overrided form's clean method.For example when I did sth like this: Template: {{carForm.as_p}} {{carPhotoForm.as_p}} Model: class Car(models.Model): car_type = models.IntegerField()

manage.py syncdb Ignoring Models

2009-03-25 Thread Darren Mansell
I'm just trying to do a bit of home development on Ubuntu 9.04 which has Python 2.6. When trying to populate the database from the models it's randomly ignoring model definitions. I have no idea what's going on but the deprecation warning of sets may be to do with it? Output of ./manage.py syncdb

Re: Admin Model Search issue.

2009-03-25 Thread Ayaz Ahmed Khan
On 26-Mar-09, at 2:07 AM, Bobby Roberts wrote: > #this keeps track of active bidders and their profile settings > class Bidder (models.Model): >AccountNum = models.ForeignKey(User, unique=True, blank=False) # > User.Id (per auth user table > [...] >class Admin: >search_fields =

Re: Admin Model Search issue.

2009-03-25 Thread Bobby Roberts
> Do you mind sharing the class definition for this model? here it is: #this keeps track of active bidders and their profile settings class Bidder (models.Model): AccountNum = models.ForeignKey(User, unique=True, blank=False)# User.Id (per auth user table Title = mo

Re: Django / Postrges problem

2009-03-25 Thread Antoni Aloy
2009/3/25 Szymon : > > Hello Django users, > > I have big problem. For a few days my site isn't working properly. We > have two interfaces. First connected to Apache, second is cron job > running every 10 minutes (using Django ORM etc.). The problem is when > that job is running, there is some Exc

Re: Django / Postrges problem

2009-03-25 Thread Rajesh D
Hi, > I have big problem. For a few days my site isn't working properly. We > have two interfaces. First connected to Apache, second is cron job > running every 10 minutes (using Django ORM etc.). The problem is when > that job is running, there is some ExclusiveLock on postgres and web > interfa

Re: Having trouble authenticating/validating

2009-03-25 Thread Adam Yee
On Mar 23, 8:30 pm, Karen Tracey wrote: > On Mon, Mar 23, 2009 at 4:45 PM, Adam Yee wrote: > > > I'm using Django's builtin AuthenticationForm > > > Here's my login view:http://dpaste.com/18110/ > > > Form submittal (not empty or empty fields) takes me back to the login > > page with 'Did not lo

Re: What's the most scalable Django deployment out there currently?

2009-03-25 Thread Graham Dumpleton
On Mar 26, 12:41 am, Oli Warner wrote: > David, slightly off-topic, but you should see some impressive gains if you > move your static handling off Apache onto something lighter > (Cherokee/Lighttpd/nginx/etc) and reverse-proxy the dynamic stuff through to > a localhost-bound Apache. > > Hell,

Re: Error when posting a comment

2009-03-25 Thread Tonu Mikk
Daniel Roseman wrote: > On Mar 24, 8:58 pm, Tonu Mikk wrote: > >> I posted this on djangothreadedcomments list some days ago, but did not >> get a response. Perhaps django users can help me out? >> >> Hello, I am attempting to get threaded comments to work on a shared >> bookmarking applicati

Re: What to use: release or development?

2009-03-25 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 3:51 PM, rihad wrote: > > 1) From the FAQ (http://docs.djangoproject.com/en/dev/faq/install/): > Q: Should I use the official version or development version?¶ > A: [...] we recommend that you use the latest development code, > because it generally contains more features an

What to use: release or development?

2009-03-25 Thread rihad
1) From the FAQ (http://docs.djangoproject.com/en/dev/faq/install/): Q: Should I use the official version or development version?¶ A: [...] we recommend that you use the latest development code, because it generally contains more features and fewer bugs than the “official” releases. 2) From Djang

Re: DjangoBook forms

2009-03-25 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 3:11 PM, AKK wrote: > > I'm still abit confused. > > Does that mean this part in the book is wrong?: > > def search(request): >if 'q' in request.GET: >message = 'You searched for: %r' % request.GET['q'] > else: >message = 'You submitted an empty for

Django / Postrges problem

2009-03-25 Thread Szymon
Hello Django users, I have big problem. For a few days my site isn't working properly. We have two interfaces. First connected to Apache, second is cron job running every 10 minutes (using Django ORM etc.). The problem is when that job is running, there is some ExclusiveLock on postgres and web i

Re: DjangoBook forms

2009-03-25 Thread AKK
I'm still abit confused. Does that mean this part in the book is wrong?: def search(request): if 'q' in request.GET: message = 'You searched for: %r' % request.GET['q'] else: message = 'You submitted an empty form.' return HttpResponse(message) I also tried what you

django way to pass parameters to templates

2009-03-25 Thread Matias Surdi
Which is the correct or recommended way to accomplish what is described in the following url with django? http://www.djangosnippets.org/snippets/11/ My question is, if I have a template like this: {% for i in args %}{{ i }}{% endfor %} {{ title }} {{ name }} args {{ args }} kwargs {{ kwargs

Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-03-25 Thread cgarvey
On Mar 25, 2:16 pm, Dougal Matthews wrote: > I've never actually tried this but i often hear it mentioned. It may > do what you need (or at least, > help)...http://code.google.com/p/google-app-engine-django/ Cheers Dougal, I'm actually using that helper already (and it's great). However, the D

Re: has_add_permission() isn't working properly

2009-03-25 Thread Alex Gaynor
2009/3/25 João Olavo Baião de Vasconcelos > On Wed, Mar 25, 2009 at 10:25 AM, Karen Tracey wrote: > >> Probably a missed bit from when this was fixed for the other pages, see >> ticket #5447: >> > > Thanks a lot, Karen. I opened a new ticket: > http://code.djangoproject.com/ticket/10624#preview

Re: has_add_permission() isn't working properly

2009-03-25 Thread João Olavo Baião de Vasconcelos
On Wed, Mar 25, 2009 at 10:25 AM, Karen Tracey wrote: > Probably a missed bit from when this was fixed for the other pages, see > ticket #5447: > Thanks a lot, Karen. I opened a new ticket: http://code.djangoproject.com/ticket/10624#preview (they said in #5447 to create a new one if an issue rem

Re: Limiting choices to a field in the user profile

2009-03-25 Thread Rajesh Dhawan
> In my models, I'm trying to limit the choices of a field based on the > data stored in a field in the user profile table. You will want to define these limits in your forms rather than in the models. > However, I have not been successful. I'm trying to learn Django, so > I'm still a noob when

template tag for nested tables

2009-03-25 Thread Jesse
One research project can have many publications. One model includes the research projects, one model includes the publications and a third model assigns multiple publications to each research project. The model: class Researchproject(models.Model): restitle = models.TextField() class Publica

SQL Admin & Email app?

2009-03-25 Thread Kevin Ar18
It was suggested that django might have something close to what I need. Basically, I am wondering whether someone has made the following in Python: * An SQL/db administration app ... similar to phpmyadmin... or even better, similar to DabbleDB (http://dabbledb.com/demo/) * An email app

Does the INSTALLED_APPS order of auth and contenttypes maters?

2009-03-25 Thread @@
Hi, I run into a strange problem when i changed my code a little and then test my apps.In some tests(not the first) i got the error message below: Traceback (most recent call last): File "D:\coding\codes\django\django\test\testcases.py", line 202, in __call__ self._pre_setup() File "D:\cod

Re: model filed with default type set in database

2009-03-25 Thread mark
so its not possible to model this in django? > created timestamp without time zone DEFAULT now(), > number_polls integer DEFAULT 0, thanks! On Tue, Mar 24, 2009 at 8:22 AM, mark wrote: > im a newbie to django. i have an existing database with default values > for field set in the database:

Re: Avoiding Accidental Overwrite In Admin Interface

2009-03-25 Thread David Zhou
It shouldn't be too hard to add a last-updated timestamp to a model, and compare it to a hidden field in the form validation. -- dz On Wed, Mar 25, 2009 at 11:49 AM, Daniel Watkins wrote: > > Hello all, > > We recently ran into an issue when two people were editing a record via > the admin in

Avoiding Accidental Overwrite In Admin Interface

2009-03-25 Thread Daniel Watkins
Hello all, We recently ran into an issue when two people were editing a record via the admin interface simultaneously. Both opened the record, made changes and hit Save. Person A pressed Save after Person B, and so only Person A's changes were reflected in the database. What is a good way of e

Re: Snap and SCT - any reviews?

2009-03-25 Thread StefanoC
...also this older thread might be of interest: http://groups.google.com/group/django-users/browse_thread/thread/56a6b62aba0c8766 My question now is: which one of these forums has a real activity and community behind? My short list currently has, in order of preferences: diamanda/myghtyblog sn

Re: Snap and SCT - any reviews?

2009-03-25 Thread StefanoC
Same question for me, not yet solved, but: bringing a small contribution, my search has found the following similar discussion: http://groups.google.com/group/django-users/browse_thread/thread/20c17f81c2a97f9e/1f42541bea308fad with this pointer: http://code.djangoproject.com/wiki/ForumAppsCompa

Re: FileField - Forms - upload to not available

2009-03-25 Thread tom
thanks for the update. So it seems, that save(commit=False) does not work here. What I try to do is: create a track object without saving, because I need two more objects (Artist, Album). These two offers will be created out of the mp3 tags of the file, if there are any. I assign than those two o

Re: pagination django

2009-03-25 Thread Joe
nicemira wrote: > please friends, > how can I paginate my product with this method: I want to do a newline > after every two products Doing a newline after every two products is not pagination. Here is an example that adds a horizontal rule after every two products: {% for product in products %

Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-03-25 Thread Dougal Matthews
I've never actually tried this but i often hear it mentioned. It may do what you need (or at least, help)... http://code.google.com/p/google-app-engine-django/ Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/ 2009/3/25 cgarvey : > > Hi, > > Does anyone here maintain a Dja

1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-03-25 Thread cgarvey
Hi, Does anyone here maintain a Django project codebase that gets deployed to Google App Engine, *and* to standalone targets like fast_cgi or something similar? If so, what are the best practices for managing the different model types? Is there an easy way to switch between the 2 (i.e. with a va

Re: pagination django

2009-03-25 Thread Justin Lilly
I believe you're looking for the {% cycle %} template tag, which you can find more information about here: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle {% cycle '' '' %} -justin On Wed, Mar 25, 2009 at 6:15 AM, nicemira wrote: > > please friends, > how can I paginate my

Re: What's the most scalable Django deployment out there currently?

2009-03-25 Thread Oli Warner
David, slightly off-topic, but you should see some impressive gains if you move your static handling off Apache onto something lighter (Cherokee/Lighttpd/nginx/etc) and reverse-proxy the dynamic stuff through to a localhost-bound Apache. Hell, I use Cherokee for dynamic content too (via django's S

Limiting choices to a field in the user profile

2009-03-25 Thread DeviantBoi
Hi! In my models, I'm trying to limit the choices of a field based on the data stored in a field in the user profile table. However, I have not been successful. I'm trying to learn Django, so I'm still a noob when it comes to it. Also, is the user profile table supposed to have an id field that

Re: ImageField on ModelForm not working - v1.0.2

2009-03-25 Thread Oli Warner
Well now I feel like a moron! Not only did I forget to pass through request.FILES, but I needed enctype="multipart/form-data" on my too. Thanks to both of you! /me slaps himself with a hefty dose of RTFM --~--~-~--~~~---~--~~ You received this message because you

Re: has_add_permission() isn't working properly

2009-03-25 Thread Karen Tracey
2009/3/25 João Olavo Baião de Vasconcelos > 2009/3/25 João Olavo Baião de Vasconcelos > >> But such button stills appearing in the app page. > > when I access http://mysite/myproject/admin/myapp, the "Add" button >> appears next to every model. > > > Just to complete the problem description: eve

Re: What's the most scalable Django deployment out there currently?

2009-03-25 Thread David Holstius
We're migrating www.gigapan.org to Django (was: PHP/Smarty) on a page- by-page basis. We have a high read/write ratio, so judicious caching solves most of our scaling issues in the realm of dynamic web content. Most of our stress comes from serving static imagery. So, let me qualify that: we have

Re: ImageField on ModelForm not working - v1.0.2

2009-03-25 Thread Ayaz Ahmed Khan
On 25-Mar-09, at 5:45 PM, Oli Warner wrote: >if request.method == 'POST': >f = AdminEditForm(request.POST.copy(), instance = company) >if f.is_valid(): Contents of file input fields/objects are stored within request.FILES dict in Django. You need to add request.FILES as an ad

Re: ImageField on ModelForm not working - v1.0.2

2009-03-25 Thread Alex Koshelev
You don't pass request.FILES to form constructor [1] [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Wed, Mar 25, 2009 at 3:45 PM, Oli Warner wrote: > > I'm having a massive headache. I have a Model called companies with > vaious fields but for one

Filling ImageField/FileField info without using save() for an already created/stored file?

2009-03-25 Thread Lior
In a model, I have a field (ImageField) where I need to "manually" set an already existing file which is also already stored in my upload directory. My problem is that the only way to set this field correctly is by moving the file to a temporary place, as the save() method wants to create the fil

ImageField on ModelForm not working - v1.0.2

2009-03-25 Thread Oli Warner
I'm having a massive headache. I have a Model called companies with vaious fields but for one form, I want the user to be able to edit two ImageFields and a TextField. "Simple", I thought and quickly made a ModelForm class: class AdminEditForm(ModelForm): class Meta: model = Company

Re: HTML

2009-03-25 Thread phuong
TP wrote: > I have read the documentation and I am still a bit unsure as how I > make one web page for all Apps, how do I link them all to one page? > > Thanks. > > On Mar 25, 10:08 am, Kenneth Gonsalves wrote: > >> On Wednesday 25 March 2009 15:24:51 TP wrote: >> >> >>> I have designed a

Re: Django as a Template Engine?

2009-03-25 Thread bruno desthuilliers
On 24 mar, 19:33, Dave A wrote: > Hi, > > I'm new to Django -- I'm evaluating open source frameworks in an > attempt to port an existing application to a non-proprietary > platform. > I like Django, but am not sure about how to approach an application > templating function from the current system

pagination django

2009-03-25 Thread nicemira
please friends, how can I paginate my product with this method: I want to do a newline after every two products please,answer me as soon as possible --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: What's the most scalable Django deployment out there currently?

2009-03-25 Thread Dave Snider
We're using Django on giantbomb.com and comicvine.com . They are pushing 25 mil or so monthly pageviews. I'm not up on the community these days but I think we're one of the larger implementations. Most of our team came from PHP/SMARTY backgrounds and I can't recommend Django enough. Dave On Ma

Re: Bug report: Model.get(pk=None)

2009-03-25 Thread Michael Glassford
Karen Tracey wrote: > On Tue, Mar 24, 2009 at 8:15 PM, Michael Glassford > wrote: > > Django can be patched to do this automatically. There may be a better > way to do it, but I've figured out that in db/backends/mysql/base.py, > inside the DatabaseWrappe

Re: Bug report: Model.get(pk=None)

2009-03-25 Thread Michael Glassford
Malcolm Tredinnick wrote: > On Tue, 2009-03-24 at 20:40 -0400, Karen Tracey wrote: > [...] >> But the decision was made to not add this overhead to the start of >> every connection. If you read the last paragraph you'll note it wasn't >> an emphatic "no, never shall we do this" type of decision bu

ManyToMany

2009-03-25 Thread Bro
Hi, I'm trying to use ManyToMany in 2 sens : --- class Person(models.Model): name = models.CharField(max_length=128) groups = models.ManyToManyField(Group, through='Membership') def __unicode__(self): return self.name class Group(models.Model):

Re: request object in custom template filter code?

2009-03-25 Thread foxbunny
I forgot to mention I'm on django-trunk rev. 10163. Branko --~--~-~--~~~---~--~~ 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

request object in custom template filter code?

2009-03-25 Thread foxbunny
I am trying to write a custom template filter which takes a variable which is a model object and grabs fields from a related object based on request.session['lang'] parameter. Or it would if I knew how to get the `lang` parameter from within the filter code. Here is the code: http://dpaste.com/1

Re: has_add_permission() isn't working properly

2009-03-25 Thread João Olavo Baião de Vasconcelos
2009/3/25 João Olavo Baião de Vasconcelos > But such button stills appearing in the app page. when I access http://mysite/myproject/admin/myapp, the "Add" button appears > next to every model. Just to complete the problem description: even with the "Add" button appearing in the app page, when

has_add_permission() isn't working properly

2009-03-25 Thread João Olavo Baião de Vasconcelos
Hi there, In admin.py, some ModelAdmin classes have the method has_add_permission(), which just returns False. This way, the "Add" button is removed from the admin interface for some models. But such button stills appearing in the app page. I mean, when I'm at admin's Home page (http://mysite/myp

Re: Error when posting a comment

2009-03-25 Thread Daniel Roseman
On Mar 24, 8:58 pm, Tonu Mikk wrote: > I posted this on djangothreadedcomments list some days ago, but did not > get a response.  Perhaps django users can help me out? > > Hello, I am attempting to get threaded comments to work on a shared > bookmarking application.  It seems that I am almost the

Re: Template language into JS file

2009-03-25 Thread Daniel Roseman
On Mar 25, 10:45 am, Oumayrita wrote: > Hello Friends, > I have a  drop-down menu for navigation like this > on:http://www.softcomplex.com/products/tigra_menu/ > I need to display dynamically the list of Products Demo from the data > base. > So I need to know how return var to js file?? > And ho

Re: HTML

2009-03-25 Thread TP
Thanks for the help :) On Mar 25, 10:39 am, Kenneth Gonsalves wrote: > On Wednesday 25 March 2009 16:08:54 TP wrote: > > > That makes sense, thanks. > > > So if I situate the basic.html page into my main project dir, then > > have all other pages inherit from it that will work? > > yes > > -- >

Template language into JS file

2009-03-25 Thread Oumayrita
Hello Friends, I have a drop-down menu for navigation like this on: http://www.softcomplex.com/products/tigra_menu/ I need to display dynamically the list of Products Demo from the data base. So I need to know how return var to js file?? And how use template language in js file? Please answer me

Re: What's the most scalable Django deployment out there currently?

2009-03-25 Thread Darren Mansell
On Wed, Mar 25, 2009 at 5:09 AM, Alex Gaynor wrote: > > > On Wed, Mar 25, 2009 at 1:06 AM, Graham Dumpleton < > graham.dumple...@gmail.com> wrote: > >> >> >> >> On Mar 25, 3:45 pm, Alex Gaynor wrote: >> > On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: >> > >> > > Curse (http://www.curse.com/)

Re: HTML

2009-03-25 Thread Kenneth Gonsalves
On Wednesday 25 March 2009 16:08:54 TP wrote: > That makes sense, thanks. > > So if I situate the basic.html page into my main project dir, then > have all other pages inherit from it that will work? yes -- regards kg http://lawgon.livejournal.com --~--~-~--~~~---~-

Re: HTML

2009-03-25 Thread TP
That makes sense, thanks. So if I situate the basic.html page into my main project dir, then have all other pages inherit from it that will work? Or does the basic.html page have to be in each App folder? On Mar 25, 10:29 am, Kenneth Gonsalves wrote: > On Wednesday 25 March 2009 15:46:27 TP wr

Re: HTML

2009-03-25 Thread Kenneth Gonsalves
On Wednesday 25 March 2009 15:46:27 TP wrote: > I have read the documentation and I am still a bit unsure as how I > make one web page for all Apps, how do I link them all to one page? you have to have a basic.html page - and all your other pages inherit from that -- regards kg http://lawgon.li

Re: HTML

2009-03-25 Thread TP
I have read the documentation and I am still a bit unsure as how I make one web page for all Apps, how do I link them all to one page? Thanks. On Mar 25, 10:08 am, Kenneth Gonsalves wrote: > On Wednesday 25 March 2009 15:24:51 TP wrote: > > > I have designed a HTML webapge, and just wondered wh

Re: OT: svn and '$Id$'

2009-03-25 Thread Alan
'$Id$' is working too, if I do find . -name "*.py" -exec svn propset svn:keywords "Id" {} \; On Mar 24, 10:36 pm, Alan wrote: > I got a solution. > > I undid what I did in ~/.subversion/config > Forget about Id, and used just  "$Date$" in my *.py, then > find . -name "*.py" -execsvnpropsetsvn:ke

Re: HTML

2009-03-25 Thread Kenneth Gonsalves
On Wednesday 25 March 2009 15:24:51 TP wrote: > I have designed a HTML webapge, and just wondered where would be the > best place to put the HTML files within my Django project folder? > > And how do I link these to my Apps? look at the documentation on templates -- regards kg http://lawgon.live

Re: Is there a Country select feature in Local Flavors forms addon?

2009-03-25 Thread NoviceSortOf
What I've done in this case is rather than using local flavor is create a file called mysite.myproject.choices.py which includes country, state and all other questions in the form. Its a major improvement and cleanup on the html to say the least. Putting the choices in a separate .py file is also

  1   2   >