getting request.user into a ModelForm?

2008-11-06 Thread Rob Hudson
I have the following: ## MODELS class Category(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=200) class Link(models.Model): user = models.ForeignKey(User) category = models.ForeignKey(Category) name = models.CharField(max_length=255) ur

Re: App initialized twice? plus, debugging tips.

2008-11-06 Thread Thomas Guettler
project2501 schrieb: > Hi, > I'm new to django and have a couple questions. > > I have a __init__.py in my app and try to declare a simple module wide > variable. I noticed __init__.py is called twice when I run "python > manage.py runserver". Is this normal? > I remember, that I had a proble

defaultdict is not working on "for" template tag iteration.

2008-11-06 Thread Hyungyong Kim
Hi, Since a few hours ago, I've suffered following problem. I found this problem is due to collections.defaultdict. Normal dictionary is working collectly, but defaultdict is not working. >>> from django.template import Template, Context >>> t = Template("{% for k,v in data.items %}{{ k }}: {{

Re: Is it possible to output JSON like this?

2008-11-06 Thread Darthmahon
Hi guys, I'll give both a try tomorrow when I am near my dev box again. Can't really do it in the template as I just want to dump out JSON only, but I'll give them both a go :) Cheers, Chris On Nov 6, 9:51 am, "Dj Gilcrease" <[EMAIL PROTECTED]> wrote: > If you dont mind using the template system

Submit button names are not showing up in request.POST

2008-11-06 Thread kesmit
I have a form where I need to know which submit button is being pressed in order to process the form. The inputs below are the submit buttons that I have. I've simplified the view down to the following just to see what's going on: @login_required def home(self, request, mode=

Re: One Question About Cache

2008-11-06 Thread DULMANDAKH Sukhbaatar
> I want to use per-view cache with memcached and low-level cache with > filesystem caching. what's the advantage of having both of them? -- Regards Dulmandakh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: Can I use more than one database handle with Django?

2008-11-06 Thread John M
Do you want to use more than one Database? Then NO, it's not available directly right now, that's supposed to be an upcoming feature. J On Nov 6, 4:28 pm, turbogears <[EMAIL PROTECTED]> wrote: > Hi, > Can I use more than one database handle with Django? > and how can I do it? > excuse my englis

Re: Logout- Back Button

2008-11-06 Thread jai_python
But closing browser after logout in not a proper solution for this issue right? just take gmail as example, after logout from gmail accont and hit back button, it will prompt to login page, this is one proper method for secure our data. Does django supports this methodology ? --~--~-~--~--

Re: Django GridContainers at Media Temple

2008-11-06 Thread Kegan
Anyone? On Oct 7, 5:04 pm, Kegan <[EMAIL PROTECTED]> wrote: > Wonder if anyone have had experience with the new Media Template > Django GridContainer? > > http://mediatemple.net/webhosting/gs/django.html --~--~-~--~~~---~--~~ You received this message because you a

filtering in a template based on foreign key or query params

2008-11-06 Thread Milan Andric
Hello, I have a view that displays hundreds of applications based on some filter params. But I want to render the actual template based on user (an fkey) and list their applications as sub objects. but only the applications that were filtered on. bleh. So in the view I do something like:

One Question About Cache

2008-11-06 Thread Rodrigo Lopes
Hi there, I would like help with this problem. I'm studying some cache strategies for my application, and I've got this doubt: I would like to know if is possible to use *TWO caching systems together*: memcached and filesystem caching I want to use per-view cache with memcached and low-level cac

Re: Using FileField and existing files

2008-11-06 Thread Chris
This should reference http://groups.google.com/group/django-users/browse_thread/thread/d7f97f909b2e5a5/6ef76fc78f820d09?lnk=gst&q=I+have+a+model+which+contains+a+FileField+newbie#6ef76fc78f820d09 but I can't seem to reply to the post, maybe too old (I did reply to the author). This refers to sett

Re: A question about models

2008-11-06 Thread Steve Holden
叮叮当当 wrote: > I have a problem with model, describe as follow: > > suppose i have two models: > class A: >pass > class B: >pass > > for some reason, i must quote B in class A, and also, i must quote A > in class B, how do i solve this question? > > Use the name of the class as a string.

Re: App initialized twice? plus, debugging tips.

2008-11-06 Thread Steve Holden
project2501 wrote: > Hi, > I'm new to django and have a couple questions. > > I have a __init__.py in my app and try to declare a simple module wide > variable. I noticed __init__.py is called twice when I run "python > manage.py runserver". Is this normal? > > I believe it can happen, yes. >

Re: how to get the id in an admin template

2008-11-06 Thread webcomm
ahh. Thanks. On Nov 6, 4:20 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > `example.com` is default Site added by the project setup into sites contrib > application [1] > > [1]:http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-s... > > On Fri, Nov 7, 2008 at 00:12, webcomm

A question about models

2008-11-06 Thread 叮叮当当
I have a problem with model, describe as follow: suppose i have two models: class A: pass class B: pass for some reason, i must quote B in class A, and also, i must quote A in class B, how do i solve this question? thanks. --~--~-~--~~~---~--~~ You receiv

Select a list item by index

2008-11-06 Thread jago
I have a for loop over a list A. inside the loop I want to print out the item of list B at the index 'forloop.counter0' of list A. It is really strange. One can select randon items in a list, or the first item in a list, but I did not find a way to select the list item by index. Am I missing so

Re: Forms Question

2008-11-06 Thread Robocop
Never mind, i finally realized what was so drastically different between .96 forms and 1.0 forms. Thanks for the help! On Nov 6, 4:33 pm, Robocop <[EMAIL PROTECTED]> wrote: > So i've just gotten back on this project, and it looks like i'm still > doing something wrong with my forms code. > > Wha

Re: Forms Question

2008-11-06 Thread Robocop
So i've just gotten back on this project, and it looks like i'm still doing something wrong with my forms code. What i have right now is: def timesheets_add(request): if request.method == 'POST': form = TimeSheetForm(request.POST) if form.is_valid(): form.save() return rende

Can I use more than one database handle with Django?

2008-11-06 Thread turbogears
Hi, Can I use more than one database handle with Django? and how can I do it? excuse my english! Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

App initialized twice? plus, debugging tips.

2008-11-06 Thread project2501
Hi, I'm new to django and have a couple questions. I have a __init__.py in my app and try to declare a simple module wide variable. I noticed __init__.py is called twice when I run "python manage.py runserver". Is this normal? Also, I tried to run "manage.py runserver" through my Wing IDE in d

Re: Getting non-related records

2008-11-06 Thread John M
WOW, I knew it would be easy, but that is ridiculous. Thanks Alex! John On Nov 6, 3:00 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > Hi, John > > Try this: > > Category.objects.exclude(bulletpoint__report=r) > > On Fri, Nov 7, 2008 at 01:54, John M <[EMAIL PROTECTED]> wrote: > > > i have a m

Re: Confused about unittests and fixtures

2008-11-06 Thread Russell Keith-Magee
On Fri, Nov 7, 2008 at 8:17 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > GenericForeignKey and content type application itself look very doubtful for > me. If you have a ForeignKey to the ContentType model then you depends on > order with ContentType objects creates on syncdb. Because ContentTyp

Re: Confused about unittests and fixtures

2008-11-06 Thread Alex Koshelev
GenericForeignKey and content type application itself look very doubtful for me. If you have a ForeignKey to the ContentType model then you depends on order with ContentType objects creates on syncdb. Because ContentType that references to some model can have different primary key any time you flus

Re: Confused about unittests and fixtures

2008-11-06 Thread Russell Keith-Magee
On Fri, Nov 7, 2008 at 1:00 AM, AndyH <[EMAIL PROTECTED]> wrote: > > Hello, > > I have the following simple test which demonstrates the confusing > behaviour I'm seeing: > > class AvailabilityTestCase(django.test.TestCase): >fixtures = FIXTURE_LIST >def setUp(self): >response = sel

Re: Getting non-related records

2008-11-06 Thread Alex Koshelev
Hi, John Try this: Category.objects.exclude(bulletpoint__report=r) On Fri, Nov 7, 2008 at 01:54, John M <[EMAIL PROTECTED]> wrote: > > i have a model at http://dpaste.com/88760/ > > for a particular Report (r), I'd like to get all categories that > aren't in it's bulletpoints. > > For example,

Getting non-related records

2008-11-06 Thread John M
i have a model at http://dpaste.com/88760/ for a particular Report (r), I'd like to get all categories that aren't in it's bulletpoints. For example, If there are four categories: one, two, three, four. there is a report with bullet points for one and two, how can I get a list of three and four.

Re: Apache Segmentation Fault on succesful authentication

2008-11-06 Thread Graham Dumpleton
On Nov 7, 2:38 am, huw_at1 <[EMAIL PROTECTED]> wrote: > Hi all. I am having some real problems with this. I have an LDAP > authentication backend that I have hooked up to my app. Standalone it > appears to run fine. However when running it through my apache server > I am seeing alot of segmentat

Re: Sort querysets by their data attribute values

2008-11-06 Thread John M
I had a similar need based on a calculated column, you'll have to turn it into a list (i.e. mylist = list(queryset) ) and then sort from there. You can still pass the list to a template a loop through it just like a regular queryset, since the objects in the list are just python objects. J On N

Re: model inheritance - getting data from child objects

2008-11-06 Thread Pawel Pilitowski
On 07/11/2008, at 3:01 AM, Alistair Marshall wrote: On Nov 6, 2:22 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > If all worker classes (cook, waiter, ...) are subclassed from Worker, > something like this should work: Worker.objects.filter(workplace=...) > Unfortunately the function that ea

Re: how to get the id in an admin template

2008-11-06 Thread Alex Koshelev
`example.com` is default Site added by the project setup into sites contrib application [1] [1]: http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites On Fri, Nov 7, 2008 at 00:12, webcomm <[EMAIL PROTECTED]> wrote: > > I don't understand the documentation. I am able to get

Re: how to get the id in an admin template

2008-11-06 Thread Steve Holden
It's in the only row in your sites table. regards Steve webcomm wrote: > I don't understand the documentation. I am able to get the "view on > site" link to show, but the URL is wrong. The correct URL for the > instance is... > > http://www.mysite.com/billing/321 > > ...so I tried this... > >

Re: how to get the id in an admin template

2008-11-06 Thread webcomm
I don't understand the documentation. I am able to get the "view on site" link to show, but the URL is wrong. The correct URL for the instance is... http://www.mysite.com/billing/321 ...so I tried this... def get_absolute_url(self): return "/billing/%i" % self.id ...but when I cl

Re: Best practice

2008-11-06 Thread Rajesh Dhawan
meppum wrote: > I've run into a funny case and I'm not sure how to best deal with it. > Basically, I have the following classes. > > class Profile(models.Model): > name = models.CharField() > foo = models.PositiveIntegerField(blank=True, default=0) > > class RegistrationForm(forms.Form): >

Re: Using Django

2008-11-06 Thread [EMAIL PROTECTED]
I think I had the .htaccess and dispatch.fcgi files in the wrong place. I had them in the django generated mysite directory rather the than the domain, but now when I go to mysite.com I get the 500 internal server error. This happened when I tried the Jeff Croft setup: http://jeffcroft.com/blog/2

Re: Apache Segmentation Fault on succesful authentication

2008-11-06 Thread huw_at1
I tried running a strace on apache for this but I am still no wiser? Anyone? On Nov 6, 3:38 pm, huw_at1 <[EMAIL PROTECTED]> wrote: > Hi all. I am having some real problems with this. I have an LDAP > authentication backend that I have hooked up to my app. Standalone it > appears to run fine. Howe

Re: Filtering the modelform in Admin on request.user

2008-11-06 Thread Rajesh Dhawan
Hi, > I have an Admin site which I want to filter based on request.user. > > My ModelAdmin class is something like this, > > class FilterOnUser(admin.ModelAdmin): > def queryset(self, request): > return self.model._default_manager.filter(user = request.user) > > def get_form(self,

Re: Sort querysets by their data attribute values

2008-11-06 Thread Alex Koshelev
There is no other way to do this in python/django layer. But you can try to add your temp data in database layer and sort where. On Thu, Nov 6, 2008 at 22:58, dexter <[EMAIL PROTECTED]> wrote: > > I have a queryset which I have looped thru and added a (temporary) > data attribute to each instanc

Sort querysets by their data attribute values

2008-11-06 Thread dexter
I have a queryset which I have looped thru and added a (temporary) data attribute to each instance. Now I would like to order the queryset by the value of the data attributes. If I do it like this: sorted(queryset, key=lambda x: x.data_attr) the queryset turns into a list and I can't use it like

Re: Newb help request about fields and and subfields

2008-11-06 Thread mondonauta
thank you so much the code u linked me help me a lot... i still used multivaluefield and multiwidget, i overrided the render method as u suggested an then i modified it copying a bit from the render method i found in the code u linked me :-) and well at list till i find any bug, it's working t

Re: Model ForeignKeys to other Models

2008-11-06 Thread joshuajenkins
That cleared it up, thanks! Great information which will definitely help me in the future. On Nov 6, 3:52 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 6, 10:27 am, Håkan Waara <[EMAIL PROTECTED]> wrote: > > > 6 nov 2008 kl. 10.05 skrev Daniel Roseman: > > > > The problem is not with the

Re: Logout- Back Button

2008-11-06 Thread Scott Moonen
Hi, This is why many secure web application (e.g., your bank or credit card company) ask that you close your browser after you logout -- so that no one else can get to any of your data that may be stored in the browser cache. If your users are using your application from https:, then this is all

Re: Logout- Back Button

2008-11-06 Thread Alex Koshelev
The is no way to do "redirect to login page, if i hit back button after logout". But what is wrong that user can see non-actual old data? I think it has no matter. On Nov 6, 8:27 pm, jai_python <[EMAIL PROTECTED]> wrote: > Please help me out --~--~-~--~~~--

Re: including javascript in templates

2008-11-06 Thread Steve Holden
You don't need to serve them from Apache for development - then it's OK to use Django. It's only in production you want to use some other server for media and static content. I have this at the end of my settings.py just to keep my test sites looking reasonable: # Serve static content so test si

Re: Design question : best way to show 1 .. N different categoried items

2008-11-06 Thread John M
Bruno, Thanks for pointing me in the right direction, the only thing I needed to as was an order_by("category") to make sure all the bullet points were grouped by category. Again, thank you so much for getting me past this. John On Nov 5, 1:02 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote:

Re: Newbie question: HTML formatting not applied to pages

2008-11-06 Thread Peter Rowell
You're being tripped up by auto-escaping of variable contents. This is a security feature that was first introduced in November of last year. (http://code.djangoproject.com/changeset/6671) See http://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape --~--~-~--~~

Re: date formats in settings.py

2008-11-06 Thread Benedict Verheyen
Karen Tracey wrote: > On Thu, Nov 6, 2008 at 11:30 AM, Benedict Verheyen > <[EMAIL PROTECTED] > wrote: > > > Hi, > > i have a question on the different date/time settings one can specify in > the settings.py. > I currently have these: > TIME_ZONE =

Re: Using Django

2008-11-06 Thread [EMAIL PROTECTED]
I used the Gordon Tillman setup: http://www.gordontillman.info/Development/DjangoDreamhost here are the dispatch.fcgi and .htaccess files: // dispatch.fcgi #!/usr/bin/env python2.4 import sys, os # Add a custom Python path. sys.path.insert(0, "/home/USERNAME/projects/django/trunk") sys.path.in

Re: Logout- Back Button

2008-11-06 Thread jai_python
Please help me out --~--~-~--~~~---~--~~ 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

Filtering the modelform in Admin on request.user

2008-11-06 Thread shabda
I have an Admin site which I want to filter based on request.user. My ModelAdmin class is something like this, class FilterOnUser(admin.ModelAdmin): def queryset(self, request): return self.model._default_manager.filter(user = request.user) def get_form(self, request, obj=None,

date formats in settings.py

2008-11-06 Thread Benedict Verheyen
Hi, i have a question on the different date/time settings one can specify in the settings.py. I currently have these: TIME_ZONE = 'Europe/Brussels' DATE_FORMAT = 'd/m/Y' DATETIME_FORMAT = 'd/m/Y H:i' TIME_FORMAT = 'H:i' YEAR_MONTH_FORMAT = 'm Y' MONTH_DAY_FORMAT = 'd m' However, any date i ente

Re: including javascript in templates

2008-11-06 Thread David Sáez
Hi Håkan, yes, I missed the reading of that link. Now that I have set up correctly it works fine. But it has a BIG disclaimer, and the reccommendation is to let the webserver to serve these files (that is what I really want) http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#servin

Re: don't escape html tags

2008-11-06 Thread gontran
Sorry but I was working with an old documentation! I fixed it with th e filter 'safe' thank you for the quick answer On 6 nov, 17:48, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 6, 2008 at 2:16 PM, gontran <[EMAIL PROTECTED]> wrote: > > > hello, > > > I just started to learn django

Re: date formats in settings.py

2008-11-06 Thread Karen Tracey
On Thu, Nov 6, 2008 at 11:30 AM, Benedict Verheyen < [EMAIL PROTECTED]> wrote: > > Hi, > > i have a question on the different date/time settings one can specify in > the settings.py. > I currently have these: > TIME_ZONE = 'Europe/Brussels' > DATE_FORMAT = 'd/m/Y' > DATETIME_FORMAT = 'd/m/Y H:i'

Re: including javascript in templates

2008-11-06 Thread Håkan Waara
6 nov 2008 kl. 17.35 skrev David Sáez: > > Hi, I'm a newbie to django and I'm dealing with some configuration > stuff that is making me going crazy. My problem is very simple and I > have a temporal solution, but I guess there might be a better way to > do it. So... there goes the question... > >

Re: Template inheritance

2008-11-06 Thread Alaric Haag
Belated thanks for that; the "specialization" tip helps. It feels a little like I haven't flopped over to the correct way of thinking about it. Custom tags and inclusion tags are helping me sort it out a bit though. --~--~-~--~~~---~--~~ You received this messa

including javascript in templates

2008-11-06 Thread David Sáez
Hi, I'm a newbie to django and I'm dealing with some configuration stuff that is making me going crazy. My problem is very simple and I have a temporal solution, but I guess there might be a better way to do it. So... there goes the question... ¿ How do I include javascript in a basic template ?

Re: don't escape html tags

2008-11-06 Thread Ramiro Morales
On Thu, Nov 6, 2008 at 2:16 PM, gontran <[EMAIL PROTECTED]> wrote: > > hello, > > I just started to learn django, so my question may be stupid: > > In my template, I would like to display a html string (stored in my > database). My problem is that it displays the string but it > automatically esca

Re: don't escape html tags

2008-11-06 Thread Håkan Waara
The documentation for the template system will give you the answer: http://docs.djangoproject.com/en/dev/topics/templates/ /Håkan 6 nov 2008 kl. 17.16 skrev gontran: > > hello, > > I just started to learn django, so my question may be stupid: > > In my template, I would like to display a html

Re: Newbie question: HTML formatting not applied to pages

2008-11-06 Thread Jeff Beckham
Sure. Here's /blog/models.py http://dpaste.com/89108/ /blog/urls.py http://dpaste.com/89109/ I've got nothing in /blog/views.py right now. As far as templates, this is /templates/base.html (it's got the autoescape tags included) http://dpaste.com/89112/ /templates/blog/list.html has only one

Logout- Back Button

2008-11-06 Thread jai_python
Hi, i have created a project named as Asset and application named as Management. The problem i am facing is after i logout form the project, if i hit the back button it fails to show the login window. I knew that some browsers don't actually hit the server on a "back". So can u tel me how to impl

don't escape html tags

2008-11-06 Thread gontran
hello, I just started to learn django, so my question may be stupid: In my template, I would like to display a html string (stored in my database). My problem is that it displays the string but it automatically escapes the html tags. for example, if my string is: my text instade of showing: my

Re: Oracle Clob Field type

2008-11-06 Thread Ian
On Nov 5, 3:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Noob here... > > I have an existing table with two Clob fields.  While defining the > model I use TextField as the filed type. > > running gives me back the error: > > cx_Oracle.DatabaseError: ORA-01754: a table may contain only

Re: sql error (1054, "Unknown column 'scripts_script.id' in 'on clause'")

2008-11-06 Thread sergo
I've tried to JOIN instead of ", " in sql query and it works but only in sql frontend. I don't know where to fix this statement in Django. On Nov 6, 5:52 pm, sergo <[EMAIL PROTECTED]> wrote: > I'm using django-tagging and django-multilingual applications in my > project. I don't know if the prob

Re: Having trouble with django-multilingual

2008-11-06 Thread Alex Koshelev
Django-multilingual has its own discussion group: http://groups.google.com/group/django-multilingual. Try to ask there. On Thu, Nov 6, 2008 at 18:44, Brandon Taylor <[EMAIL PROTECTED]>wrote: > > Hi Everyone, > > I'm having a hard time getting django-multilingual to work the way I > expect. > >

Re: model inheritance - getting data from child objects

2008-11-06 Thread Alistair Marshall
On Nov 6, 2:22 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > If all worker classes (cook, waiter, ...) are subclassed from Worker, > something like this should work: Worker.objects.filter(workplace=...) > Unfortunately the function that each child will run is a bit more complicated than just l

Confused about unittests and fixtures

2008-11-06 Thread AndyH
Hello, I have the following simple test which demonstrates the confusing behaviour I'm seeing: class AvailabilityTestCase(django.test.TestCase): fixtures = FIXTURE_LIST def setUp(self): response = self.client.login(username='testuser', password='password') self.assertTrue

Apache Segmentation Fault on succesful authentication

2008-11-06 Thread huw_at1
Hi all. I am having some real problems with this. I have an LDAP authentication backend that I have hooked up to my app. Standalone it appears to run fine. However when running it through my apache server I am seeing alot of segmentation faults in my error log coupled with the redirection page not

Having trouble with django-multilingual

2008-11-06 Thread Brandon Taylor
Hi Everyone, I'm having a hard time getting django-multilingual to work the way I expect. #settings.py LANGUAGES = ( ('en', 'English'), ('es', 'Spanish'), ) TEMPLATE_CONTEXT_PROCESSORS = ( ... 'multilingual.context_processors.multilingual', ) MIDDLEWARE_CLASSES = ( ..

Re: Installation of django in user account

2008-11-06 Thread Daniel Hepper
> On Wed, Nov 5, 2008 at 12:18 PM, Tim O'Toole <[EMAIL PROTECTED]> wrote: > > But I obviously cant do the following without root access > > > > ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django > > > > Whilst I can set the PYTHONPATH, I can't then write to PythonPath in > > the Apache conf

sql error (1054, "Unknown column 'scripts_script.id' in 'on clause'")

2008-11-06 Thread sergo
I'm using django-tagging and django-multilingual applications in my project. I don't know if the problem is in these packages or it is more general. Google gives this http://bugs.mysql.com/bug.php?id=16190 , so I thought it is more general problem. Error page says: Environment: Request Method:

Re: Using Django

2008-11-06 Thread Blu3ness
Hey there, I am running Django testing server on Dreamhost as well, and I can tell you it works fine. So I am sure you are probably just misconfiguring something. Like AndyB said, .htaccess needs to pass the URL to your dispatch.fcgi on the dreamhost server, all of your django projects and folde

Re: Installation of django in user account

2008-11-06 Thread James Bennett
On Wed, Nov 5, 2008 at 12:18 PM, Tim O'Toole <[EMAIL PROTECTED]> wrote: > But I obviously cant do the following without root access > > ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django > > Whilst I can set the PYTHONPATH, I can't then write to PythonPath in > the Apache configuration file

Re: Mysqldb adapter

2008-11-06 Thread achab61
Thanks, it works now! I found out the installation location of MySQLdb was wrong (my mistake...) On Nov 6, 1:55 pm, gv <[EMAIL PROTECTED]> wrote: > On 6 Nov, 12:30, achab61 <[EMAIL PROTECTED]> wrote: > > > I've got the same package but I'm getting the same error. > > Is there anything do once you

Re: model inheritance - getting data from child objects

2008-11-06 Thread Thomas Guettler
I have never used model inheritance, but I read the documentation If all worker classes (cook, waiter, ...) are subclassed from Worker, something like this should work: Worker.objects.filter(workplace=...) (Given that workers only work for one workplace) HTH, Thomas Alistair Marshall sch

Re: Installation of django in user account

2008-11-06 Thread [EMAIL PROTECTED]
No one? On Nov 5, 6:18 pm, "Tim O'Toole" <[EMAIL PROTECTED]> wrote: > Hi all, > > I was wondering how feasile it is it to install Django in a user > account without root access. I followed the instruction at: > > http://docs.djangoproject.com/en/dev/topics/install/#installing-devel... > > But I o

Re: multi foreign keys and ordering in admin

2008-11-06 Thread MikeKJ
Rephrased a little On Nov 6, 11:51 am, MikeKJ <[EMAIL PROTECTED]> wrote: > Got something like this > > class A(models.Model): >     x >     class Admin: >         x > > class B(models.Model): >     a =models.ForeignKey(A, edit_inline=models.TABULAR) >     xxx > > class C(models.Model)

Re: Help regarding Sqlite3

2008-11-06 Thread sergioh
Also you can use the python shell, you can import your models and create objects, the you can save them and also make queries to your model. is simple as: # manage.py shell >>> from django.contrib.auth.models import User >>>User.objects.all() .. Also the structure of the tables created

Re: setting value of a ModelForm field through Javascript

2008-11-06 Thread Donn
On Thursday, 06 November 2008 14:38:41 limas wrote: > can i set the value of a ModelForm field ,ie a text box, using > javascript. Try JQuery. If your input box has an id "blah" then: $('#blah').val("some new value") would set it for you. jQuery is very cool for this kind of thing. hth, \d --~

Re: syncdb problem with standalone applications

2008-11-06 Thread Ramiro Morales
On Thu, Nov 6, 2008 at 10:26 AM, cnole <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > i'm new to django framework and i found a problem during learning > django. I wrote a standalone application for my project and registered > it as installed applications in the project settings. But everytime i

Re: Getting a relationship using double underscores

2008-11-06 Thread Daniel Roseman
On Nov 6, 12:10 pm, gv <[EMAIL PROTECTED]> wrote: > On 6 Nov, 11:56, Daniel Roseman <[EMAIL PROTECTED]> wrote: > > > On Nov 6, 10:25 am, gv <[EMAIL PROTECTED]> wrote: > > > Well, you don't appear to have any foreign keys linking Backup and > > Server. You'd need something like this in your Backup

Re: setting value of a ModelForm field through Javascript

2008-11-06 Thread bruno desthuilliers
On 6 nov, 13:38, limas <[EMAIL PROTECTED]> wrote: > hello > > please help me... > can i set the value of a ModelForm field ,ie a text box, using > javascript. This is totally unrelated to Django and ModelForms. javascript runs on the browser, *after* the whole page containing the form has be

Re: Help regarding renaming the uploaded file name in Django.

2008-11-06 Thread Alex Koshelev
Django uploading mechanism allow you to add date-bases values to path. See `upload_to` section in [1] [1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield On Thu, Nov 6, 2008 at 15:45, sadeesh Arumugam <[EMAIL PROTECTED]>wrote: > Hi Friends, > > I need a help from you. How to

Re: multi foreign keys and ordering in admin

2008-11-06 Thread Alex Koshelev
Try to set meta [1] `ordering` setting [1]: http://docs.djangoproject.com/en/dev/ref/models/options/ On Thu, Nov 6, 2008 at 14:51, MikeKJ <[EMAIL PROTECTED]> wrote: > > Got something like this > > class A(models.Model): >x >class Admin: >x > > class B(models.Model): >

Re: Mysqldb adapter

2008-11-06 Thread gv
On 6 Nov, 12:30, achab61 <[EMAIL PROTECTED]> wrote: > I've got the same package but I'm getting the same error. > Is there anything do once you run the exe ? Did you make any special > configuration in your Windows (I'm on XP SP2) i.e. PATH etc... I cannot remember doing anything extra. My under

Help regarding renaming the uploaded file name in Django.

2008-11-06 Thread sadeesh Arumugam
Hi Friends, I need a help from you. How to rename the uploaded file name in django. Example if we upload a file named "a.jpg" at first time, and at next upload it is uploaded as "a_.jpg", and at the third time "a__.jpg", likewise the Underscore after the filename is increasing one time for each u

Re: Getting a relationship using double underscores

2008-11-06 Thread gv
On 6 Nov, 12:33, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > If you have `serverid` field in database so you can add reference with > custom column name [1]. For example: > > server = models.ForeignKey(Server, db-column="serverid") > > [1]:http://docs.djangoproject.com/en/dev/ref/models/fields/#d

syncdb problem with standalone applications

2008-11-06 Thread cnole
Hi everybody, i'm new to django framework and i found a problem during learning django. I wrote a standalone application for my project and registered it as installed applications in the project settings. But everytime i made a change to models of the standalone application and run the syncdb com

syncdb problem with standalone applications

2008-11-06 Thread cnole
Hi everybody, i'm new to django framework and i found a problem during learning django. I wrote a standalone application for my project and registered it as installed applications in the project settings. But everytime i made a change to models of the standalone application and run the syncdb com

setting value of a ModelForm field through Javascript

2008-11-06 Thread limas
hello please help me... can i set the value of a ModelForm field ,ie a text box, using javascript. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: Getting a relationship using double underscores

2008-11-06 Thread Alex Koshelev
If you have `serverid` field in database so you can add reference with custom column name [1]. For example: server = models.ForeignKey(Server, db-column="serverid") [1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#db-column On Thu, Nov 6, 2008 at 15:10, gv <[EMAIL PROTECTED]> wrote:

Re: Mysqldb adapter

2008-11-06 Thread achab61
I've got the same package but I'm getting the same error. Is there anything do once you run the exe ? Did you make any special configuration in your Windows (I'm on XP SP2) i.e. PATH etc... Thanks On 6 Nov, 12:15, gv <[EMAIL PROTECTED]> wrote: > On 6 Nov, 10:39, achab61 <[EMAIL PROTECTED]> wrote:

Re: Getting a relationship using double underscores

2008-11-06 Thread gv
On 6 Nov, 11:56, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 6, 10:25 am, gv <[EMAIL PROTECTED]> wrote: > > Well, you don't appear to have any foreign keys linking Backup and > Server. You'd need something like this in your Backup declaration: > >     server = models.ForeignKey('Server')

Re: Help regarding Decimal Field in models.py in Django

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:32 am, "sadeesh Arumugam" <[EMAIL PROTECTED]> wrote: > Hi Friends, >     I'm a newbie to Django, i'm doing a registration form to be displayed in > Admin section. In my form i'm giving two fields namely latitude and > longitude and setting them as a DecimalField. My question how to se

Re: Getting a relationship using double underscores

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:25 am, gv <[EMAIL PROTECTED]> wrote: > Hello > > What I want to achieve is the equivalent of this: > select * from server, backup where backup.serverid=server.id and > servername={backupserver} > > To do that the django way is proving challenging, maybe because the > database was an e

multi foreign keys and ordering in admin

2008-11-06 Thread MikeKJ
Got something like this class A(models.Model): x class Admin: x class B(models.Model): a =models.ForeignKey(A) xxx class C(models.Model): a = models.ForeignKey(A) x classD(models.Model): a=models.ForeignKey(A) xx how do I control th

Re: Model ForeignKeys to other Models

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:27 am, Håkan Waara <[EMAIL PROTECTED]> wrote: > 6 nov 2008 kl. 10.05 skrev Daniel Roseman: > > > The problem is not with the imports (you were fine with the original > > method - in fact I'd recommend it, to avoid any future problems with > > circular imports), but with the __unicode_

Re: Best practice

2008-11-06 Thread TiNo
> > class Profile(models.Model): >name = models.CharField() >foo = models.PositiveIntegerField(blank=True, default=0) > > class RegistrationForm(forms.Form): >name = forms.CharField() >foo = forms.IntegerField(min_value=0, max_value=55, > required=False) > > a) If your form is the

Re: post data and @login_required

2008-11-06 Thread James Bennett
On Thu, Nov 6, 2008 at 5:12 AM, coan <[EMAIL PROTECTED]> wrote: > Why isn't there an option to have the request object passed to the > login form? The login view in the Django admin actually used to do this; see our most recent security-oriented release for the reasons why it doesn't do that anym

Re: Mysqldb adapter

2008-11-06 Thread gv
On 6 Nov, 10:39, achab61 <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm in trouble trying to get running the Mysqldb adapter on Windows. > > My configuration is MySQL vers. 5.0.67, PythonWin vers. 2.5.2 I use much the same as you, but got mysql-python from Sourceforge - no problems: http://sourcefo

  1   2   >