leave out through param on ManyToManyField

2009-08-24 Thread lenzo
I cant find something about this on the net. What is the difference if i leave out the through parameter on a ManyToManyField in a model definition like this one from the django docs: class Person(models.Model): name = models.CharField(max_length=128) def __unicode__(self):

Re: register() takes at most 3 arguments (4 given)

2009-08-24 Thread Kenneth Gonsalves
On Monday 24 Aug 2009 5:47:02 pm Gungor wrote: > class Admin_Panel(admin.ModelAdmin): > list_display=("name","surname","date","time") > ordering=["-date","time"] > search_fields=("name","surname","date") > class Filtre(admin.ModelAdmin): > fil =

Altering Settings in Tests leads to strange behaviour

2009-08-24 Thread Fergus
Running Django 1.1, and I get funny results in testing which indicate ordering. Two applications: A and B. A requires that you set settings.A_SETTING in your project's settings.py, which refers to an interface. It has a test case that modifies A_SETTING from its normal, default value in order

Re: mod_wsgi not serving uploaded media

2009-08-24 Thread Kenneth Gonsalves
On Monday 24 Aug 2009 5:41:07 pm Kenneth Gonsalves wrote: > > both admin media and sitemedia work perfectly. Only the uploaded media > > does not get served. It gets saved in the correct location, a look at the > > page source shows that the url is correct, but apache refuses to put it > > on the

Re: Scaling Thumbnails instead of Cropping or Squashing.

2009-08-24 Thread The Danny Bos
Thanks again Mike, this solved everything. d On Aug 24, 1:02 pm, Mike Ramirez wrote: > On Sunday 23 August 2009 06:48:33 pm The Danny Bos wrote: > > > > > > > Hey, so I've got this code to quickly create thumbnail files, below. > > When I give it a value, it squishes the

Re: Appeding entire table to a backup table

2009-08-24 Thread Mike
Thanks Tim, in that case I will carry on this way. 2009/8/23 Tim Chase : > >> The raw SQL is something along the lines of "INSERT INTO backup SELECT >> * FROM today; DELETE FROM today;". >> >> Is there a Django way of doing this? I would required something >>

Re: Is Django Right For My New Project... Details inside.

2009-08-24 Thread Gabriel Gunderson
On Mon, Aug 24, 2009 at 9:11 PM, Michael Thomason wrote: > Anyway, I have two concerns. I'm building a web application that will > be a portal for different companies. > > http://example.com/company1/webapp/ > http://example.com/company2/webapp/ >

Is Django Right For My New Project... Details inside.

2009-08-24 Thread Michael Thomason
I have a programming background, with C, C++, Objective C, and for web I've always used PHP, which I can build most anything with. Read a Python book, and I'm wondering if Django is right for my next project. I know MVC, so I think I know what the framework is about, but I haven't looked far

Re: html Escape

2009-08-24 Thread Parag Shah
Hi, You can use the strip_tags function to strip all html from text. from django.utils.html import strip_tags In your view comment = strip_tags(request.POST["comment"]) -- Regards Parag On Tue, Aug 25, 2009 at 4:25 AM, When ideas fail wrote: > > Hello, i want to

Change the where clause in a complex query involving a model with a self many to many

2009-08-24 Thread Jacob Fenwick
I have a hierarchy of models where the bottom object in the hierarchy has a many to many relationship to itself. Here are my models and views: models.py class Bar(models.Model): name = models.CharField(max_length=200) class BarPart(models.Model): bar = models.ForeignKey(Bar) name =

Re: Backend Neutral DictCursor

2009-08-24 Thread Chris
Note the normal method of creating a PG DictCursor doesn't seem to work through Django's db module. Is anyone aware of a workaround? import psycopg2.extras from django.db import connection connection.cursor(cursor_factory=psycopg2.extras.DictCursor) TypeError: cursor() got an unexpected keyword

Re: Backend Neutral DictCursor

2009-08-24 Thread Chris
There's no way to do this? On Aug 10, 8:47 am, Chris wrote: > You can get a backend neutral database cursor with > django.db.connection.cursor(). However, any results executed are > returned as nameless lists. Is there a way to get results returned as > dictionaries, via

Single Django Project, Multiple Apache Subdomains

2009-08-24 Thread Mark Stahler
I am using Nginx as a front end web server redirecting Python requests to Apache + mod_wsgi. Everything with that is working fine. I have one Django project running and I want to setup subdomains for a few of my project apps. Proposed structure: /www/project/ - -->/admin/ - admin.domain.com

Re: using mark_safe() in a view returns False

2009-08-24 Thread Karen Tracey
On Mon, Aug 24, 2009 at 7:01 PM, MIL wrote:Since I had the pleasure of getting help in here once I will try > again :o) > > I have read about the mark_safe, and I would like to use it, but it > just returns the value "False" > > What am I doing wrong? > > i my view: > from

Re: multi-tenant website

2009-08-24 Thread Fernando Correia
Thanks for the quick answer, Dan! That project is exactly what I was looking for. http://github.com/CrowdSense/django-saas-kit/tree/master Cheers! 2009/8/24 Daniel Hilton > > You might have alook at the saas kit which is availble on github, > which does subscription

Re: Fastest http+sql server combination

2009-08-24 Thread Graham Dumpleton
On Aug 25, 6:19 am, Michael wrote: > On Mon, Aug 24, 2009 at 3:57 PM, Léon Dignòn wrote: > > > Hello, > > > there are plenty of possible combinations out there. The suggested one > > is apache and mod_wsgi, but in the docs is also mentioned, that >

using mark_safe() in a view

2009-08-24 Thread MIL
Since I had the pleasure of getting help in here once I will try again :o) I have read about the mark_safe, and I woul like to use it, but it just returns the value "False" What am I doing wrong? i my view: context = RequestContext(request, { 'title' : title,

using mark_safe() in a view returns False

2009-08-24 Thread MIL
Since I had the pleasure of getting help in here once I will try again :o) I have read about the mark_safe, and I would like to use it, but it just returns the value "False" What am I doing wrong? i my view: from django.utils.safestring import mark_safe ... context =

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Merrick
Another thread today just clued me in. Adding @property to the model method made it work. Thank you for helping out Javier, I provided the full example below in case someone else looks for this: import urlparse def stripdomain(url): bits = urlparse.urlparse(url) return bits[1] class

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Javier Guerra
On Mon, Aug 24, 2009 at 5:37 PM, Merrick wrote: > Do you know if there is a way to have url.domain return what > stripdomain() did above? Otherwise I'll use a template filter and move > on. no need for a filter, {{url.stripdomain}} will call url.stripdomain() or, you could

Re: a bit like permission, but...

2009-08-24 Thread MIL
Exactly. Thats what I need to learn :o) Thanks alot :o) On 21 Aug., 17:25, David Zhou wrote: > On Aug 21, 2009, at 9:54 AM, MIL wrote: > > > this works fine but I dont want to repeat it in all my views: > > def my_profile(request): > >    gotta_go_through =

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Merrick
Looks like we were writing at the same time. I also was not aware you could call a model method in a template without the parenthesis, that's where I was getting hung up. Again thank you. On Aug 24, 3:54 pm, Javier Guerra wrote: > On Mon, Aug 24, 2009 at 5:37 PM,

html Escape

2009-08-24 Thread When ideas fail
Hello, i want to allow users to post comments and I don't want them to be allowed to put html in comments. However I would like the to be able to use paragraph p tags and tags but not anything other. Could someone tell me how to do this? Thanks Andrew

How does my model look?

2009-08-24 Thread rh0dium
Hi Guys, Relative newbie and I want to ensure I'm getting started on the right track. How does this model look? # encoding: utf-8 """ class P4Document(models.Model): depotfile = models.CharField(max_length=1024) action= models.CharField(choices=(("add","Add"),

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Merrick
url.stripdomain() returns: yourdomain.com Do you know if there is a way to have url.domain return what stripdomain() did above? Otherwise I'll use a template filter and move on. Merrick On Aug 24, 12:20 pm, Javier Guerra wrote: > On Mon, Aug 24, 2009 at 1:42 PM,

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
The reason I'm trying it is due to a requirement, the data rather than being sent using a normal post request in a multienc form has to be sent over in a json string in the post request containing the base64 encoded image. On Mon, 2009-08-24 at 18:38 +0200, Maksymus007 wrote: > On Tue, Aug 4,

Re: Union of types in Django model

2009-08-24 Thread christian.oudard
Maybe a generic foreign key would solve your problem. http://www.djangoproject.com/documentation/models/generic_relations/ On Aug 24, 7:38 am, Mikoskay wrote: > Hi, > > I'm searching for something like C++ union of types for my Django > models. I know I can do it by

Re: Fastest http+sql server combination

2009-08-24 Thread Michael
On Mon, Aug 24, 2009 at 3:57 PM, Léon Dignòn wrote: > > Hello, > > there are plenty of possible combinations out there. The suggested one > is apache and mod_wsgi, but in the docs is also mentioned, that > fastcgi could be faster if configured properly. Unfortunately it's

[solved] Re: error piping a file into manage.py flush

2009-08-24 Thread ringemup
A bunch of searching turned up the "expect" utility and "autoexpect", which seems to have done the trick. On Aug 24, 3:14 pm, ringemup wrote: > Maybe I'm just making some sort of stupid shell command mistake, but I > can't seem to automate the input to manage.py flush (I

Fastest http+sql server combination

2009-08-24 Thread Léon Dignòn
Hello, there are plenty of possible combinations out there. The suggested one is apache and mod_wsgi, but in the docs is also mentioned, that fastcgi could be faster if configured properly. Unfortunately it's not mentioned, what properly means. For a site with few users who upload images up to

Re: How I can add new functionality in homepage of admin site??

2009-08-24 Thread David Zhou
On Mon, Aug 24, 2009 at 3:29 PM, sandravigo wrote: > > Hi, friends. I have a problem. > I created a function (main) that displays a list on the first page > (index.html) of site administration. The problem is that for example, > if I put in URLConf: (r '^ admin /(.*)','

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Javier Guerra
On Mon, Aug 24, 2009 at 1:42 PM, Merrick wrote: url = yourmodel.objects.get(id=1) url.domain > u'http://yourdomain.com/' what does url.stripdomain() return? -- Javier --~--~-~--~~~---~--~~ You received this message because you are

Re: Newbie - Model column arithmetic

2009-08-24 Thread Ken
Excellent. Many 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-users@googlegroups.com To unsubscribe from this group, send email to

Re: Python/Django web programmer needed

2009-08-24 Thread ankit rai
india ,bangalore On Tue, Aug 25, 2009 at 12:09 AM, Michael wrote: > > Where are you located? > > On Aug 24, 12:17 pm, ankit rai wrote: > > can do for u .. > > > > > > > > On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote: > > > >

How I can add new functionality in homepage of admin site??

2009-08-24 Thread sandravigo
Hi, friends. I have a problem. I created a function (main) that displays a list on the first page (index.html) of site administration. The problem is that for example, if I put in URLConf: (r '^ admin /(.*)',' myproject.views.main '), I get this list as I want, but don't shows the view by

error piping a file into manage.py flush

2009-08-24 Thread ringemup
Maybe I'm just making some sort of stupid shell command mistake, but I can't seem to automate the input to manage.py flush (I need to do a lot of database reloading as part of my current testing sequence). It appears to fail when processing the email address. Any suggestions? I'm using the

Re: Python/Django web programmer needed

2009-08-24 Thread Jeffrey Johnson
Take this off of the list please. On Mon, Aug 24, 2009 at 11:39 AM, Michael wrote: > > Where are you located? > > On Aug 24, 12:17 pm, ankit rai wrote: >> can do for  u .. >> >> >> >> On Mon, Aug 24, 2009 at 11:30 PM, Michael

Re: Python/Django web programmer needed

2009-08-24 Thread Michael
Thank you for the help. On Aug 24, 12:18 pm, Daniel Roseman wrote: > On Aug 24, 7:00 pm, Michael wrote: > > > I own a web based medical recertification company and we are looking > > for a Python/Django web programmer to do some work for us.  The site

Re: Python/Django web programmer needed

2009-08-24 Thread Michael
Where are you located? On Aug 24, 12:17 pm, ankit rai wrote: > can do for  u .. > > > > On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote: > > > I own a web based medical recertification company and we are looking > > for a Python/Django web programmer

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Merrick
Thank you Javier, for some reason I cannot get it working. Using your example, I noticed the return value is stripdomain, I am assuming that function would be outside of the model? Assuming the code you provided, I would expect that adding the code below, directly above the class yourmodel

Re: Python/Django web programmer needed

2009-08-24 Thread ankit rai
can do for u .. On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote: > > I own a web based medical recertification company and we are looking > for a Python/Django web programmer to do some work for us. The site > is written in Python using Django 1.0. We need to switch

Re: how to use form_class with generic views?

2009-08-24 Thread Daniel Roseman
On Aug 24, 5:06 pm, BobZ wrote: > The real brain buster is that I get this error whether I'm passing a > form_class or a simple Model in urls.py > > On Aug 24, 11:05 am, BobZ wrote: > > > > > Thanks for the quick response! > > > forms.py > > > from

Re: Newbie - Model column arithmetic

2009-08-24 Thread Daniel Roseman
On Aug 24, 6:12 pm, Ken wrote: > Apologies if this is in an FAQ somewhere, but I've been unable to find > it... > > As a complete newcomer to Django (and Python, for that matter), I'd > like to present my users with an HTML table that contains columns a, b > and c from my

Re: Modify the value in a row before returning through a query

2009-08-24 Thread Javier Guerra
On Mon, Aug 24, 2009 at 1:01 PM, Merrick wrote: > I know how to parse the URL but am drawing a blank on how to > accomplish this at the model level. add a function to the model, that returns the parsed field. class yourmodel (models.Model): domain =

Re: Python/Django web programmer needed

2009-08-24 Thread Daniel Roseman
On Aug 24, 7:00 pm, Michael wrote: > I own a web based medical recertification company and we are looking > for a Python/Django web programmer to do some work for us.  The site > is written in Python using Django 1.0. We need to switch from using > Paypal to Authorize.net and

Python/Django web programmer needed

2009-08-24 Thread Michael
I own a web based medical recertification company and we are looking for a Python/Django web programmer to do some work for us. The site is written in Python using Django 1.0. We need to switch from using Paypal to Authorize.net and would like to add content to our site. We are based in

Modify the value in a row before returning through a query

2009-08-24 Thread Merrick
I have this in models.py: domain = models.URLField(...) Let's say one row in the table has this for domain: 'http://www.google.com' When the domain field is looked up, I would like to return: www.google.com I know how to parse the URL but am drawing a blank on how to accomplish this at the

Redirect loop

2009-08-24 Thread Kelvan
Hey folks, I've a strange problem at the moment with auth and login decorator. If a user is logged in index page have to redirect to portal, if the user is not logged in portal have to redirect to login-screen/index. Seems to be not a big problem, I thought, but my following code creates a loop.

Newbie - Model column arithmetic

2009-08-24 Thread Ken
Apologies if this is in an FAQ somewhere, but I've been unable to find it... As a complete newcomer to Django (and Python, for that matter), I'd like to present my users with an HTML table that contains columns a, b and c from my table in the database, and then do arithmetic on the Model columns

Re: JSON Serialization with ImageField

2009-08-24 Thread Maksymus007
On Tue, Aug 4, 2009 at 10:58 PM, scuzz wrote: > > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django deserialisation > like: > > serializers.deserialize("json", "...snip...,

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
The real brain buster is that I get this error whether I'm passing a form_class or a simple Model in urls.py On Aug 24, 11:05 am, BobZ wrote: > Thanks for the quick response! > > forms.py > > from django import forms > from django.forms import ModelForm > from models import

Re: Dates with varying specificity?

2009-08-24 Thread ringemup
When you do get to it, I'd love to see what you come up with. On Aug 23, 9:16 am, Doug Blank wrote: > On Sat, Aug 22, 2009 at 12:24 PM, ringemup wrote: > > > Has anyone here ever written an application that needed to be able to > > take a date field

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
Did you find a way to do this? I'm having the same problem. Lewis On Aug 4, 9:58 pm, scuzz wrote: > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django deserialisation > like: > >

Re: saving M2M with through table behavior change - (r.10189 vs. r.10190)

2009-08-24 Thread David Haas
Excellent. Thanks for the fix! On Aug 24, 5:55 am, Russell Keith-Magee wrote: > On Mon, Aug 24, 2009 at 6:27 AM, David Haas wrote: > > > Hi: > > > Yet again, I've run into a behavior change which seems to be linked to > > svn revision 10190.  

Re: how to use form_class with generic views?

2009-08-24 Thread Daniel Roseman
On Aug 24, 4:26 pm, BobZ wrote: > I'm having a similar problem actually. > > I'm trying to extend Photologue to offer front-end user upload > capability with generic views and I haven't been able to successfully > render a page yet. > Each of the commented-out "upload_args"

MEDIA on remote server only accessible over FTP and HTTP

2009-08-24 Thread TheMaTrIx
Hi all, One of my clients has asked me to implement a Django site where they host the application side on their own Internet connection (low latency 2Mbit fibre pipe) while hosting the static content on their ISP's provided web space. Which is high speed (I tested it as likely having multiple

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
Thanks for the quick response! forms.py from django import forms from django.forms import ModelForm from models import Photo class UserPhotoUploadForm(ModelForm): def __init__(self, *args, **kwargs ): self.user = kwargs.pop("user") super(UserPhotoUploadForm,

Re: Test client following redirects despite follow=False?

2009-08-24 Thread ringemup
Ah, that makes a lot more sense. Thank you. On Aug 23, 2:26 pm, Karen Tracey wrote: > On Thu, Aug 20, 2009 at 2:19 PM, ringemup wrote: > > > I'm running the test listed below, and the test client is submitting a > > request to /test2/ despite the

/// job offer: django-webdeveloper in vienna/austria

2009-08-24 Thread patrickk
I hope that this doesn´t violate any group-rules ... * * * * * * * * * * vonautomatisch is looking for a webdeveloper having profound knowledge and experience with django/python/html/css/javascript. – scope of work in collaboration with the concept- and graphics-department, you have to

Re: problem with u'' in template

2009-08-24 Thread Gustavo Henrique
Sorry, I forgot about json. Solved! 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-users@googlegroups.com To unsubscribe from this group,

Re: String aggregator

2009-08-24 Thread Chris Withers
hyuen wrote: > When I use aggregators, I do something like > > T.aggregate(Max('LastName')) > > but the problem is that for aggregators, it expects a float, not a > string. Is it possible to use strings as maximum/minimum values? Where are you importing Max from? What is the error and

Re: problem with u'' in template

2009-08-24 Thread Daniel Roseman
On Aug 24, 4:00 pm, Gustavo Henrique wrote: > Hi! > I'm sending unicode string for template page, whitin a javascript > code, and I have a problem with the char u before string value. > For example: > > > {{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name':

Re: how to use form_class with generic views?

2009-08-24 Thread BobZ
I'm having a similar problem actually. I'm trying to extend Photologue to offer front-end user upload capability with generic views and I haven't been able to successfully render a page yet. Each of the commented-out "upload_args" are variations I've tried to get something back and none of them

problem with u'' in template

2009-08-24 Thread Gustavo Henrique
Hi! I'm sending unicode string for template page, whitin a javascript code, and I have a problem with the char u before string value. For example: {{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name': u'cliente', 'value': u''} In the body there isn't a problem, but in the javascript code

fckeditor upload file security

2009-08-24 Thread Alessandro Ronchi
I must use fckeditor file upload but I want it to be possible only for django staff authenticated users. I'm using mod_python inside apache, is it possible ? -- Alessandro Ronchi SOASI Sviluppo Software e Sistemi Open Source http://www.soasi.com

Re: Caught an exception while rendering: Error binding parameter 0 - probably unsupported type.

2009-08-24 Thread mike171562
Would be nice if you would share your solution On Jul 26, 9:05 pm, nixon66 wrote: > ran into this error. Anyone familiar with it. > > TemplateSyntaxError at /lobby/lobbytype/public-relations/ > > Caught an exception while rendering: Error binding parameter 0 - > probably

Re: register() takes at most 3 arguments (4 given)

2009-08-24 Thread Daniel Roseman
On Aug 24, 2:45 pm, Hotmail wrote: > On Pzt, 2009-08-24 at 06:17 -0700, Daniel Roseman wrote: > > > On Aug 24, 12:51 pm, Gungor wrote: > > > I have a  register() takes at most 3 arguments (4 given) problem with > > > these codes. > > > > from

Re: register() takes at most 3 arguments (4 given)

2009-08-24 Thread Hotmail
On Pzt, 2009-08-24 at 06:17 -0700, Daniel Roseman wrote: > On Aug 24, 12:51 pm, Gungor wrote: > > I have a register() takes at most 3 arguments (4 given) problem with > > these codes. > > > > from randevu.rts.models import Randevu > > from django.contrib import admin > >

Re: register() takes at most 3 arguments (4 given)

2009-08-24 Thread Karen Tracey
On Mon, Aug 24, 2009 at 8:17 AM, Gungor wrote: > > I have register() takes at most 3 arguments (4 given) error with these > codes. > > from randevu.rts.models import Randevu > from django.contrib import admin > from datetime import datetime > > class

Re: register() takes at most 3 arguments (4 given)

2009-08-24 Thread Daniel Roseman
On Aug 24, 12:51 pm, Gungor wrote: > I have a  register() takes at most 3 arguments (4 given) problem with > these codes. > > from randevu.rts.models import Randevu > from django.contrib import admin > from datetime import datetime > > class Admin_Panel(admin.ModelAdmin): >

Re: Union of types in my models

2009-08-24 Thread Karen Tracey
On Mon, Aug 24, 2009 at 2:46 AM, Mikoskay wrote: > > Hi, > > Is there any equivalent of C++ union construction for my Django > models? I know I can do it at low-level, but I hope it's not > necessary. For example: there's a model Transaction with attribute > Client pointing

Re: saving M2M with through table behavior change - (r.10189 vs. r.10190)

2009-08-24 Thread Russell Keith-Magee
On Mon, Aug 24, 2009 at 6:27 AM, David Haas wrote: > > Hi: > > Yet again, I've run into a behavior change which seems to be linked to > svn revision 10190.  I've figured out a workaround for my code, but > I'm wondering if someone could provide some feedback if the change

Re: Django1.1 logs me out after few seconds inactivity

2009-08-24 Thread Florian Schweikert
Thanks for your patience, I created a new project with only a login-page and a small 'debug' page, seems to work at this stage. Next I will test my own auth_backend, if this problem appears again (I hope not), I'll be able to localise it a bit better. greetings, florian 2009/8/21 Russell

Union of types in Django model

2009-08-24 Thread Mikoskay
Hi, I'm searching for something like C++ union of types for my Django models. I know I can do it by low-level fun, but I really hope it's not necessary. For example: I've got Transaction model which has a Client field - a ForeignKey to Company model OR to Individual model - depending on what I

register() takes at most 3 arguments (4 given)

2009-08-24 Thread Gungor
I have a register() takes at most 3 arguments (4 given) problem with these codes. from randevu.rts.models import Randevu from django.contrib import admin from datetime import datetime class Admin_Panel(admin.ModelAdmin): list_display=("name","surname","date","time")

register() takes at most 3 arguments (4 given)

2009-08-24 Thread Gungor
I have register() takes at most 3 arguments (4 given) error with these codes. from randevu.rts.models import Randevu from django.contrib import admin from datetime import datetime class Admin_Panel(admin.ModelAdmin): list_display=("name","surname","date","time")

Re: mod_wsgi not serving uploaded media

2009-08-24 Thread Kenneth Gonsalves
On Monday 24 Aug 2009 5:03:47 pm Kenneth Gonsalves wrote: > my first foray into mod_wsgi and apache. I configured everything. There are > three media directories: > media - for admin > sitemedia - hard coded media > smedia - uploaded media > > both admin media and sitemedia work perfectly. Only

Union of types in my models

2009-08-24 Thread Mikoskay
Hi, Is there any equivalent of C++ union construction for my Django models? I know I can do it at low-level, but I hope it's not necessary. For example: there's a model Transaction with attribute Client pointing to model IndividualClient OR to model CompanyClient. How to do that? Thanks for

mod_wsgi not serving uploaded media

2009-08-24 Thread Kenneth Gonsalves
hi, my first foray into mod_wsgi and apache. I configured everything. There are three media directories: /media/ - for admin /sitemedia/ - hard coded media /smedia/ - uploaded media both admin media and sitemedia work perfectly. Only the uploaded media does not get served. It gets saved in

Re: request.FILES empty... only with IE!

2009-08-24 Thread James Bennett
On Mon, Aug 24, 2009 at 5:07 AM, OnCEL wrote: > This is a form created dynamically in JS and it contains only a file > input and a submit button (also created dynamically). > The entire form creating code is: I would wonder whether security restrictions in the browser are

Re: ModelForm and ForeignKeys

2009-08-24 Thread Léon Dignòn
Basically you have to link them with a foreign key. I hope this fits your needs with the legacy table. class Character(models.Model): guid = models.IntegerField(primary_key=True) name = models.CharField() … class CharacterHome(models.Model): character =

Re: request.FILES empty... only with IE!

2009-08-24 Thread OnCEL
Hi Emily, This is a form created dynamically in JS and it contains only a file input and a submit button (also created dynamically). The entire form creating code is: var upform = document.createElement('form'); upform.setAttribute('action','/engine/users/avatar/');

Re: ModelForm and ForeignKeys

2009-08-24 Thread Léon Dignòn
goobee, I am not sure, if I understand you. You have a person with a name, let's say "Max Mustermann". You want to show the ModelForm participant for this particular person? Is this correct? On Aug 24, 9:14 am, goobee wrote: > thanks Léon > > but I need name and firstname

Re: Gracefully uploading multiple images per post.

2009-08-24 Thread Anogar
Yeah, to finish this off, I got it working as I described below. On Aug 24, 12:16 am, Anogar wrote: > Sorry for the triple post - I think I'm going to be taking the image > field out of the main model, making it a custom model, then adding the > option for multiples with

Re: request.FILES empty... only with IE!

2009-08-24 Thread Emily Rodgers
On Aug 23, 11:31 pm, OnurCelebi wrote: > Hi all, > I have a very strange behaviour. I have an upload form like this: > > var upform = document.createElement('form'); > upform.setAttribute('action','/engine/users/avatar/'); >

Re: cannot store images into file system using Imageupload

2009-08-24 Thread djangonoob
hi Ronghui, may i know what do u mean by "didnt save the file" using the form save () method? Do u mean that in Guptha's views.py, the function should have: form.save() in order to save the image? Best Regards. On Jul 24, 7:20 pm, Ronghui Yu wrote: > You didn't save the

Unable to upload images via customized form

2009-08-24 Thread djangonoob
Hi all, I am creating a form ( a customized one ) which tries to upload ( bind ) an image file and save the file into my directory ( and its location in mysql database ) The code is right here : # views.py def customized_form(request): if request.method == 'POST': form =

Re: Gracefully uploading multiple images per post.

2009-08-24 Thread Anogar
Sorry for the triple post - I think I'm going to be taking the image field out of the main model, making it a custom model, then adding the option for multiples with the Inline option and extras. On Aug 24, 12:08 am, Anogar wrote: > For a simpler concept, just consider

Re: ModelForm and ForeignKeys

2009-08-24 Thread goobee
thanks Léon but I need name and firstname from the referenced table 'person', but only from ONE person; the person I read from 'participant'. goobee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Gracefully uploading multiple images per post.

2009-08-24 Thread Anogar
For a simpler concept, just consider what I'd do if I wanted to add multiple "title" fields or something basic and text based. On Aug 24, 12:02 am, Anogar wrote: > I've got iamge uploading working in a portfolio app I'm working on, > but only with a single image. I'm

Gracefully uploading multiple images per post.

2009-08-24 Thread Anogar
I've got iamge uploading working in a portfolio app I'm working on, but only with a single image. I'm trying to get it working so that you can add as many or as few images as you'd like, but I'm hitting a bit of a brick wall with the logic of how it should work. Does anyone have any pointers? I

Re: Error in setting up psycopg2

2009-08-24 Thread Thomas Guettler
Hi Simon, Simon Lee schrieb: > Thank you for being patient in helping me out. > > I checked it /etc/passwd and found this line which I think is the > reference for UID 70 > > _www:*:70:70:World Wide Web Server:/Library/WebServer:/usr/bin/false > > I did "su - _www" (I hope I did this

Re: multi-tenant website

2009-08-24 Thread Daniel Hilton
You might have alook at the saas kit which is availble on github, which does subscription billing, subdomain handling and multi user accounts. You could then write a decorator to wrap any db request to perform a test to check that only rows that are linked to that requesting user are returned or

Re: Permissions issue with image uploads

2009-08-24 Thread Anogar
I missed a step - I did go ahead and chown it over to www-data, but I needed to chmod x to u. sudo chmod u+x uploads/ I thought 777 would be a little insecure, you really don't need to give full permissions to group / others. I know it's probably not a huge deal, but I figure it's best