Re: Dango-tagging incompatibilities?

2010-08-05 Thread Lachlan Musicman
I am using django-tagging with trunk and am not experiencing any real problems. Admittedly, I'm not under massive load, but it's working fine... cheers L. On Fri, Aug 6, 2010 at 08:18, adelein wrote: > Has anyone used django-tagging lately with Django 1.1 and above? I am >

Re: Dango-tagging incompatibilities?

2010-08-05 Thread adelein
Hi, Thanks, I will continue with it then. On Aug 5, 4:40 pm, creecode wrote: > Hello Adelein, > > I used a version of django-tagging with Django v1.1 without any > noticeable problems.  Which revision it was I can't say off the top of > my head.  A look at the django-tagging

Re: Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread Paulo Almeida
A function or property in the model would do nicely. You can check this page for more information: http://www.b-list.org/weblog/2006/aug/18/django-tips-using-properties-models-and-managers/ - Paulo On

debugging template inheritance

2010-08-05 Thread msoulier
Hi, I have a framework on a product that allows new django projects to make use of an existing project's code, so new projects can reduce duplication. It does this in templates by some trickery with the TEMPLATE_DIRS. For example, I have a base project here

Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread flowpoke
I have a simple model that includes two DateField fields. I have everything passing to the template, as I would like but i'd like to add one more variable, duration. I want {{ duration }} to be that of the delta between the two DateField fields, in years. It's simple arithmetic but im not sure

django comments problem

2010-08-05 Thread ignacio.arriaga
Hello, I have a problem with django.contrib comments application. I have installed the applicacion and made the synchronization with the database. I create a comment form in this way: {% render_comment_form for project %} When I push either preview or submit I get a 403 error related with csrf

Re: Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-05 Thread Paulo Almeida
In the third case, I didn't understand why you didn't divide (his_to - his_from) / (my_to - my_from). Bearing that in mind, this made sense in my head, but analyze it carefully: def match(mf,mt,hf,ht): mydiff = diff_in_seconds(mf,mt) if (mf >= hf and mt <= ht) or (mf < hf and mt > ht):

Re: Python question about subprocess.Popen() and stdout

2010-08-05 Thread Steve Holden
On 8/5/2010 7:16 PM, Joshua Russo wrote: > On Aug 4, 6:49 pm, Hassan wrote: >>> Ok, so it appears that (in Python 2.5 at least) there is no way to capture >>> the stdout of subprocess.Popen() >> >> just do this >> >> from subprocess import Popen, PIPE >> p = Popen([cmd],

Re: Dango-tagging incompatibilities?

2010-08-05 Thread creecode
Hello Adelein, I used a version of django-tagging with Django v1.1 without any noticeable problems. Which revision it was I can't say off the top of my head. A look at the django-tagging website may provide the answers. Toodle-looo... creecode On Aug 5, 3:18 pm, adelein

Re: Python question about subprocess.Popen() and stdout

2010-08-05 Thread Joshua Russo
On Aug 4, 6:49 pm, Hassan wrote: > > Ok, so it appears that (in Python 2.5 at least) there is no way to capture > > the stdout of subprocess.Popen() > > just do this > > from subprocess import Popen, PIPE > p = Popen([cmd], stdout=PIPE) > p.stdout.readlines() > > thats it!

Re: TemplateDoesNotExist: 500.html error when trying to run server

2010-08-05 Thread Steve Holden
On 8/5/2010 6:27 PM, meenakshi wrote: > > I am a beginner working through the Django tutorial. When I try to > run the development server at http://127.0.0.1:8000/, I get a > TemplateDoesNotExist: 500.html error. >I have no problems linking to http://127.0.0.1:8000/admin, > however.

TemplateDoesNotExist: 500.html error when trying to run server

2010-08-05 Thread meenakshi
I am a beginner working through the Django tutorial. When I try to run the development server at http://127.0.0.1:8000/, I get a TemplateDoesNotExist: 500.html error. I have no problems linking to http://127.0.0.1:8000/admin, however. Whats going on? Here is what I get when I try to run

Dango-tagging incompatibilities?

2010-08-05 Thread adelein
Has anyone used django-tagging lately with Django 1.1 and above? I am starting to use it but saw some comments in stackoverflow about incompatibilities. Dont want to go down a dead end. Appreciate your tips! Thanks, Adelein -- You received this message because you are subscribed to the

Custom management command using sql_delete fails

2010-08-05 Thread Mathias De Maré
Hi, I've created a custom management command for django-admin.py, but the sql execution (using statements created by sql_delete) keeps failing on django.db.utils.DatabaseError: unrecognized token: " " I'm afraid I'm not sure what's wrong. I'm currently thinking it's some kind of encoding problem,

Re: overriding model.save()

2010-08-05 Thread Alec Shaner
The "new" values are what you just set: in your example, self.a=3 and self.b=4 if you're inside your custom save method. Then you can get the current values from the database from inside your custom save with something like: current = Foo.objects.get(pk=self.pk) and inspect current.b for special

Re: django.views.static.serve issue

2010-08-05 Thread bagheera
Dnia 05-08-2010 o 14:57:04 Reinout van Rees napisał(a): On 08/05/2010 01:36 PM, bagheera wrote: Hi, i set up static files for development purposes in following way: urls.py: if settings.DEBUG: urlpatterns += patterns('',(r'^site_media/(?P.*)$',

Re: portable apps problem

2010-08-05 Thread bax...@gretschpages.com
I came up with a solution using if 'foo' in settings.INSTALLED_APPS: but it feels pretty hackish. If there's a better way, I'd love to hear it. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: intermediate table in manytomany relationship not created

2010-08-05 Thread Carlos Daniel Ruvalcaba Valenzuela
There is an option to default to InnoDB tables on the configuration: http://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables Regards, Carlos Daniel Ruvalcaba Valenzuela On Thu, Aug 5, 2010 at 12:48 PM, bksfu wrote: > When Django created the above

Re: intermediate table in manytomany relationship not created

2010-08-05 Thread bksfu
When Django created the above tables, they were created with the MyISAM engine. If the intermediate table has to have foreign keys back to the Phone and Room tables, this would be illegal from MySQL's perspective, which can apparently only form foreign key constraints between InnoDB tables. If

portable apps problem

2010-08-05 Thread bax...@gretschpages.com
I try to make my apps portable between the various sites/projects that use them, but I'm running into some problems doing so. I'm hoping there's some good way to handle this I just don't understand or know about. In a nutshell, I've got multiple sites/projects, and I'd like them to all use the

error: 'get format is not defined' in DateTimeShortcuts.js

2010-08-05 Thread Ogi Vranesic
Hi dear django users After I updated Django to version 1.2.1 and in myproject/media/js replaced the old javascripts with the new from site-packages/django/contrib/admin/media/js and site-packages/django/contrib/admin/media/js/admin I become in DateTimeShortcuts.js the error 'get format is not

RE: overriding model.save()

2010-08-05 Thread Sells, Fred
That part makes sense, but where would I find the "new" values that have been set but not saved when my custom save() method is called? Like X.a=3 X.b=4 X.save() I want to see if b is a special value before saving. -Original Message- From: django-users@googlegroups.com

Specifying column names for ManyToMany fields

2010-08-05 Thread Steven L Smith
Hello, I've been charged with creating a front-end in Django for a MSSQL database. It has to stay in MSSQL for various other reasons, so just using our normal Postgres stuff won't work. It is all working, except for the internal names of ManyToMany Fields. Our DBA likes to follow the

intermediate table in manytomany relationship not created

2010-08-05 Thread bksfu
Hi, I have the following model: -- from django.db import models class Phone(models.Model): id = models.AutoField(primary_key=True, db_column='id') type = models.CharField(max_length=1, db_column='Type', null=False, blank=False) status = models.CharField(max_length=1,

Re: admin framework help

2010-08-05 Thread Steve Holden
On 8/5/2010 12:42 PM, snipinben wrote: > > I need help doing something probably very simple. so i have two tables, > Customers and Orders. now i know how to make access to both tables sepratly > in the admin framework. but i need something else. i was wondering if there > was a way to access the

Re: how to make readonly in change but editable in add?

2010-08-05 Thread Shawn Milochik
On Thu, Aug 5, 2010 at 12:31 PM, shmengie <1st...@gmail.com> wrote: > I think it's better to let the user know the fields exist and may not > be changed, than to present them with editable fields that may not. > I agree. That's not incompatible with my solution. I would expect the user to be

admin framework help

2010-08-05 Thread snipinben
I need help doing something probably very simple. so i have two tables, Customers and Orders. now i know how to make access to both tables sepratly in the admin framework. but i need something else. i was wondering if there was a way to access the orders table through thr Customers page. like say

Re: how to make readonly in change but editable in add?

2010-08-05 Thread shmengie
I think it's better to let the user know the fields exist and may not be changed, than to present them with editable fields that may not. Has to do with consistent presentation and notification. Data validation needs to be implemented in either event, because you cannot guarantee the user will

Re: Jquery-ui in admin: c is undefined

2010-08-05 Thread shacker
On Aug 5, 5:22 am, David De La Harpe Golden wrote: > > In theory you could probably "re-conflict" it, i.e. grab the > django.jQuery and put it back into the global scope as >  Query (and maybe $ - jquery-ui uses jQuery) ...but I wouldn't > recommend it, just look

Re: model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
On Aug 5, 2010, at 3:15 PM, Roald de Vries wrote: On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote: On Aug 5, 1:50 pm, Roald de Vries wrote: Dear all, I have the following error, and don't know what it means: Error: One or more models did not validate:

Re: View Decorator

2010-08-05 Thread Steve Holden
I don't know whether it will help, but it seems that it isn't the top-level urls.py that the error is complaining about but the one in your persons app. Presumably the top-level urlconf includes that? As to why applying a decorator should trigger the problem, I am a bit stumped. regards Steve

Re: how to make readonly in change but editable in add?

2010-08-05 Thread Shawn Milochik
You can do this very easily by tweaking your model as follows: 1. Override __init__() and store the value of that field in a temporary value, such as self.old_status. 2. Override save() and before you call the super() save, check if self.pk (meaning the instance is not new). If so, and

Linkedin Search

2010-08-05 Thread kostia
Yes, Linkedin mostly is written on Java. Did you see its menu and the search to the right? People, Jobs, Answers, Groups. I would like to add something similar to this on my site. I wish to learn about search mechanisms. Could you please point me at positive direction? -- You received this

Re: How to record users ip address every-time user logs in

2010-08-05 Thread Shawn Milochik
Maybe a combination of these two things will get you going. 1. A way to store additional information about users (such as IP addresses). http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#storing-additional-information-about-users 2. Get the IP address from the META attribute of the

Re: View Decorator

2010-08-05 Thread Dan Gentry
Steve, thanks for the guidance. I'm heading in the right direction with a better understanding of the concept, but still stymied by the urls error. Not seeing the connection between adding a decorator and having trouble with urls.py. I'll get there. Dan On Aug 4, 11:31 am, Steve Holden

Re: Need help with my Form.save() method. Trouble with ForeignKey and ManyToMany Fields.

2010-08-05 Thread strayhand
Yep. I used Firebug to look at the HTTP information and "username" is in there. Here's what firebug shows: Parametersapplication/x-www-form-urlencoded address P.O. Box 56868 areas 1 birth_date 1979-10-09 cityPuyallup country USA csrfmiddlewaretoken 0258a209df8a7df0ccca24ce789a448e

Re: Jquery-ui in admin: c is undefined

2010-08-05 Thread Alessandro Ronchi
2010/8/5 David De La Harpe Golden : > > In theory you could probably "re-conflict" it, i.e. grab the > django.jQuery and put it back into the global scope as >  Query (and maybe $ - jquery-ui uses jQuery) ...but I wouldn't > recommend it, just look at the admin

Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-05 Thread Alexandre González
I've develope a "simple" function to calculate the difference between 2 dates, and the time that they are interpolated. I need it to: I arrive to a site at a hour (my_from), I go out from the site at a hour (my_to). Some friend arrive at the site at a hour (his_from) and let it at a hour (his_to)

Re: How to get the model name of an object in template?

2010-08-05 Thread David.D
TemplateSyntaxError at /products/Product/263/ Variables and attributes may not begin with underscores: 'object._meta' Request Method: GET Request URL:http://127.0.0.1:8000/products/Product/263/ Django Version: 1.3 pre-alpha Exception Type: TemplateSyntaxError Exception Value: Variables and

Re: django mail_admins source code

2010-08-05 Thread Tom Evans
On Thu, Aug 5, 2010 at 10:31 AM, kostia wrote: > ... > I think to use something like > recipients = [] > for admin in settings.ADMINS: >     recipients += admin[1] > > But it seems to be unprofessional. > 'List comprehension' recipients = [ email for name, email in

Re: model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote: On Aug 5, 1:50 pm, Roald de Vries wrote: Dear all, I have the following error, and don't know what it means: Error: One or more models did not validate: update.personupdate: 'address' has a relation with model

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Sven Broeckling
> > I got another clue, it seems that the python process runs out of > > file handles. After 10k requests (via ab -c 1 -n 1) i got > > several "not found" io exceptions like "/dev/urandom not found", > > TemplateError: Template xy not found and this one : Error Opening > > file

[solved] Re: Python Segfaults with Django 1.1

2010-08-05 Thread Sven Broeckling
> > I got another clue, it seems that the python process runs out of > > file handles. After 10k requests (via ab -c 1 -n 1) i got > > several "not found" io exceptions like "/dev/urandom not found", > Some tempfile that isn't getting closed? Watch your /tmp size, for > instance. Normally if

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Graham Dumpleton
On Aug 5, 10:06 pm, Sven Broeckling wrote: > > > i have a problem on a debian lenny machine which is not easy to > > > track down. It started with Apache2 mod_wsgi crashes (segfault in > > > libapr) after the migration from mod_python. The server crashes > > > sporadic and

Re: model inheritance, abtract=True

2010-08-05 Thread Emily Rodgers
On Aug 5, 1:50 pm, Roald de Vries wrote: > Dear all, > > I have the following error, and don't know what it means: > >      Error: One or more models did not validate: >      update.personupdate: 'address' has a relation with model Address,   > which has either not been

Re: django.views.static.serve issue

2010-08-05 Thread Reinout van Rees
On 08/05/2010 01:36 PM, bagheera wrote: Hi, i set up static files for development purposes in following way: urls.py: if settings.DEBUG: urlpatterns += patterns('',(r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),) settings.py: MEDIA_ROOT =

Re: Creating a html table...

2010-08-05 Thread Reinout van Rees
On 08/05/2010 02:00 PM, ROger wrote: I want to create a html table containing taking from database , this table should be sortable and searchable.. How do i do that?? There are javascript libraries for showing so-called grids. The more elaborate ones allow you to sort on various colums.

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Graham Dumpleton
On Aug 5, 10:06 pm, Sven Broeckling wrote: > > > i have a problem on a debian lenny machine which is not easy to > > > track down. It started with Apache2 mod_wsgi crashes (segfault in > > > libapr) after the migration from mod_python. The server crashes > > > sporadic and

Re: Apache and mod_wsgi memory help

2010-08-05 Thread Graham Dumpleton
On Aug 5, 10:14 pm, Albert Hopkins wrote: > ... Or perhaps mod_wsgi is not the way to go. > > Basically I have this situation.  I have a Django app that also has an > xmlrpc interface via the wiki recipe[1].  All works fine until I enabled > the ability to upload files.  

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Reinout van Rees
On 08/05/2010 02:06 PM, Sven Broeckling wrote: I got another clue, it seems that the python process runs out of file handles. After 10k requests (via ab -c 1 -n 1) i got several "not found" io exceptions like "/dev/urandom not found", Some tempfile that isn't getting closed? Watch your

model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
Dear all, I have the following error, and don't know what it means: Error: One or more models did not validate: update.personupdate: 'address' has a relation with model Address, which has either not been installed or is abstract. I did a pretty big refactoring, but I think the

Re: Jquery-ui in admin: c is undefined

2010-08-05 Thread David De La Harpe Golden
On 05/08/10 08:59, Alessandro Ronchi wrote: > Is there a way to avoid attaching two times the same jquery library in > admin? Well, the noConflict(true) is a Feature, deliberately decoupling the bundled jquery the admin uses from any jquery (and other "$" snaffling libraries - the "true" stops

Re: Creating a html table...

2010-08-05 Thread Franklin Einspruch
I would start with learning how models work in Django. http://docs.djangoproject.com/en/dev/topics/db/models/ Franklin On Thu, Aug 5, 2010 at 8:00 AM, ROger wrote: > I want  to create a html table containing taking from database , this > table should be sortable and

Apache and mod_wsgi memory help

2010-08-05 Thread Albert Hopkins
... Or perhaps mod_wsgi is not the way to go. Basically I have this situation. I have a Django app that also has an xmlrpc interface via the wiki recipe[1]. All works fine until I enabled the ability to upload files. Since they're binary files I use the xmlrpc binary type. Well this loads

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Sven Broeckling
> > i have a problem on a debian lenny machine which is not easy to > > track down. It started with Apache2 mod_wsgi crashes (segfault in > > libapr) after the migration from mod_python. The server crashes > > sporadic and everytime with another view called, but everytime > > after a while (2-7

Re: Question on databases

2010-08-05 Thread Steve Holden
On 8/5/2010 7:53 AM, cootetom wrote: > Is it better to have one large database with all the data for a web > site in it or many smaller databases that hold data for specific > area's of a web site in it? > > Thinking that one database with some sort of clustering technology is > better than

Creating a html table...

2010-08-05 Thread ROger
I want to create a html table containing taking from database , this table should be sortable and searchable.. How do i do that?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: overriding model.save()

2010-08-05 Thread Sam Lai
On 5 August 2010 03:05, Sells, Fred wrote: > I would like to prevent saving a new value if the database contains a > specific value.  This is on a per field, per record basis. > > If I override the save() method; is there a way to find the existing (in > the DB)

Question on databases

2010-08-05 Thread cootetom
Is it better to have one large database with all the data for a web site in it or many smaller databases that hold data for specific area's of a web site in it? Thinking that one database with some sort of clustering technology is better than trying to manage many smaller databases? Also, if

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-05 Thread Russell Keith-Magee
On Thu, Aug 5, 2010 at 3:32 AM, lukaszb wrote: > Thanks for the comment! I really do think that this "backends ready && > included" parts of Django are extremely useful (and fun to extend if > needed). > > About the admin, I haven't really get into admin integration yet

Re: overriding model.save()

2010-08-05 Thread Paulo Almeida
I never tried this, but I think you could just delete the value from the form.cleaned_data dictionary, if you don't want it: if instance.my_field == some_value: del form.cleaned_data['my_field'] This would be in the view, before saving, so you wouldn't need to override anything. - Paulo On

Re: Getting old projects to run on 1.2 with Ubuntu

2010-08-05 Thread Nikhil Somaru
"And one more thing, read something about python path, eggs, *.pth files, you will need this knowledge to understand how this whole import machinery works, else it will be very confusing." Any links you can suggest for this? On Sun, Jul 25, 2010 at 6:17 PM, Martin Tiršel

Re: django mail_admins source code

2010-08-05 Thread Steve Holden
On 8/5/2010 7:18 AM, euan.godd...@googlemail.com wrote: > AFAIK mail_admins is designed to send error messages to the site > administrator, not for the purpose you are proposing, so you won't get > the original email. Your proposal seems reasonable enough to me since > you're not using mail_admins

django.views.static.serve issue

2010-08-05 Thread bagheera
Hi, i set up static files for development purposes in following way: urls.py: if settings.DEBUG: urlpatterns += patterns('',(r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),) settings.py: MEDIA_ROOT =

Re: Need help with my Form.save() method. Trouble with ForeignKey and ManyToMany Fields.

2010-08-05 Thread Paulo Almeida
Can you check the POST data and see if 'username' is there? You can do it easily with Firefox's Firebug extension. - Paulo On Thu, Aug 5, 2010 at 6:24 AM, strayhand wrote: > So I'm rolling out my own registration form that should update the > following models: > > - User

Re: Issue with loading fixtures in tests with multi database in Django 1.2

2010-08-05 Thread Russell Keith-Magee
On Thu, Aug 5, 2010 at 3:44 PM, Xavier Ordoquy wrote: > Hi Russ, > > Indeed, my investigations have lead me to #14025 which fixed the major issue. > > If I remember correctly the corrupted file part was due to the fact that I > was still using an "old style" fixture

Re: Python Segfaults with Django 1.1

2010-08-05 Thread Reinout van Rees
On 08/05/2010 12:50 PM, Sven Broeckling wrote: i have a problem on a debian lenny machine which is not easy to track down. It started with Apache2 mod_wsgi crashes (segfault in libapr) after the migration from mod_python. The server crashes sporadic and everytime with another view called, but

Re: Jquery-ui in admin: c is undefined

2010-08-05 Thread euan.godd...@googlemail.com
It looks like order is important. I don't think there's much you can do other than declare it twice in this case. On Aug 5, 8:59 am, Alessandro Ronchi wrote: > If I load jquery-ui (a custom full download) in my admin I get this script > error: > c is undefined > > If

Re: django mail_admins source code

2010-08-05 Thread euan.godd...@googlemail.com
AFAIK mail_admins is designed to send error messages to the site administrator, not for the purpose you are proposing, so you won't get the original email. Your proposal seems reasonable enough to me since you're not using mail_admins as designed. Why take only the second admin email address? On

Re: no such table: django_session when doing the tutorial

2010-08-05 Thread Alexandre González
Sorry Yoji, I did a fast read and I didn't see it. Can you paste your complete settings.py On Wed, Aug 4, 2010 at 13:40, Yoji H wrote: > this is just a guess but i think the path is not set right. > but i don know how to set it correctly. > > > On Wed, Aug 4, 2010 at 8:39

Re: How to get the model name of an object in template?

2010-08-05 Thread Paulo Almeida
But _meta starts with an underscore, so you can't use it in the template, right? I'm still using Django 1.0.2, so I don't know if that has changed along the way. - Paulo On Thu, Aug 5, 2010 at 8:52 AM, Daniel Roseman wrote: > On Aug 4, 7:27 pm, "David.D"

Python Segfaults with Django 1.1

2010-08-05 Thread Sven Broeckling
Hi, i have a problem on a debian lenny machine which is not easy to track down. It started with Apache2 mod_wsgi crashes (segfault in libapr) after the migration from mod_python. The server crashes sporadic and everytime with another view called, but everytime after a while (2-7 Days, depending

Re: Error with Apache and mod_wsgi

2010-08-05 Thread Graham Dumpleton
On Aug 5, 12:27 pm, Vikas Mahajan wrote: > Hello to all. > I am new baby to python and django. I have installed the django-1.21 > in my pc. I am able to create mysite as mentioned in tutorial and > mysite also works fine using django web server (on port 8000), but now

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-05 Thread derek
On Aug 4, 9:18 pm, lukaszb wrote: > Welll, at the django.contrib.auth there are only those (User and > Group) models for which one may define permission sets and I wanted > guardian to be as simply as possible - so it is not possible to assign > permission to other

Re: Error with Apache and mod_wsgi

2010-08-05 Thread commonzenpython
please check the apache error logs, and post the info so i can be of more assistance to you -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send

Re: importing models to script file

2010-08-05 Thread Reinout van Rees
On 08/04/2010 08:32 PM, Tony wrote: Hi, Im trying to import my models to another python file that I am making to use the database data. The problem is, I can't import the models for some reason. It keeps saying "ImportError: Settings cannot be imported, because environment variable

Re: Django IDE

2010-08-05 Thread Kenneth Gonsalves
On Thu, 2010-08-05 at 10:10 +0200, bagheera wrote: > I have eclipse/aptana + PyDev but i did not found it comfortable, mb > i > just gave it too little time to get familiar with, or i'm too stick > to > NetBeans. However, i'll give a try to SPE mentioned in other post, > never > heard of

newbie: how to do a simple join query?

2010-08-05 Thread xpanta
Hi. I have read the (excellent) documentation but I can't figure out how to do this. I know I might have to use annotations but I need some extra help. here it is, then. I have a table which represents user friendships called "Shortlist" (with fields from_user, to_user: both Foreign Keys to the

django mail_admins source code

2010-08-05 Thread kostia
I have a contact form on my site. The code which send the emails after successful validation is below: def contact(request): if request.method == 'POST': form = ContactForm(request.POST) if form.is_valid(): if request.POST['send_me']:

Re: New tutorial added to Django by Example

2010-08-05 Thread Nikhil Somaru
Ah, thanks On Tue, Aug 3, 2010 at 8:40 PM, Rainy wrote: > > > On Aug 3, 2:25 am, Nikhil Somaru wrote: > > How to set up a virtual python/django installation > > > > There is already a tutorial for this here: > > >

Re: Django IDE

2010-08-05 Thread bagheera
Dnia 05-08-2010 o 00:12:41 Carlos Daniel Ruvalcaba Valenzuela napisał(a): If you are looking for a "Full IDE" I have used Eclipse+PyDev (and other plugins) and works quite well, completion is reasonable and you have a wealth of extensions such as VCS support, Mylyn

Jquery-ui in admin: c is undefined

2010-08-05 Thread Alessandro Ronchi
If I load jquery-ui (a custom full download) in my admin I get this script error: c is undefined If I load 2 times jquery with ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ class Media: js = ( settings.MEDIA_URL + 'admin/jquery-ui/js/jquery-1.4.2.min.js',

Re: How to get the model name of an object in template?

2010-08-05 Thread Daniel Roseman
On Aug 4, 7:27 pm, "David.D" wrote: > I just wonder if there's some way requires writing nothing. Just like > an attribute. > > thanks. Yes, there is. Each model and model instance object has a _meta attribute, which contains information about the model - the .app_label,

Re: Django, Rails but a cost to pay ?

2010-08-05 Thread Sithembewena Lloyd Dube
You mean conclusions like "and solely written for getting hits"? I am not saying don't critique things. Just try to remember that you don't know the OP's intentions in asking and adapt your tone accordingly. On Wed, Aug 4, 2010 at 5:47 PM, Masklinn wrote: > On

Re: multi_db support for doctests? How to enable?

2010-08-05 Thread Reinout van Rees
On 08/05/2010 07:27 AM, Xavier Ordoquy wrote: I'll do some experimenting with django versions. I clearly remember adding code to my router to allow django to create those 5 tables in my second database, so it *did* work. Perhaps 1.2.1 broke something that 1.2betasomething did right? Gotta

Re: Flexible relationships - tips/advice?

2010-08-05 Thread Daniel Roseman
On Aug 5, 12:32 am, v0idnull wrote: > I want to be able to link one model to another model, regardless of > what models they are. Articles can be related to Photos, Videos, other > Articles, etc etc etc. > > I have created a Relationship model to represent these relationships,

Re: Forms and 'prefix' parameter

2010-08-05 Thread Daniel Roseman
On Aug 5, 7:16 am, Ed Schofield wrote: > On Aug 5, 2:23 pm, Karen Tracey wrote: > > > > > > > On Thu, Aug 5, 2010 at 12:10 AM, Ed Schofield wrote: > > > Hi everyone, > > > > I'm trying to use a view with multiple forms under

Re: Issue with loading fixtures in tests with multi database in Django 1.2

2010-08-05 Thread Xavier Ordoquy
Hi Russ, Indeed, my investigations have lead me to #14025 which fixed the major issue. If I remember correctly the corrupted file part was due to the fact that I was still using an "old style" fixture filename - ie .json instead of ..json with data on both databases. If you find it useful, I

Re: Issue with loading fixtures in tests with multi database in Django 1.2

2010-08-05 Thread Russell Keith-Magee
On Thu, Jul 29, 2010 at 6:02 PM, Xavier Ordoquy wrote: > Hi there. > > I'm currently working on a project where I use a legacy database with a > django one. > I've setup the multi database support and it seems to work pretty well. > However, I'm getting an issue with

Re: Auto-truncated fields at max_length

2010-08-05 Thread Xavier Ordoquy
Hi, > I would prefer to instead auto-truncate the value (so I don't have an > exception). Now, I can do this manually, but what I would really want is to > have all of my models auto-truncate the value. (Not necessarily > intelligently. Just cutting it off at the 999th character is fine.) >

Re: Auto-truncated fields at max_length

2010-08-05 Thread Masklinn
On 5 août 2010, at 01:35, Samuel Clay wrote: > I have a field that has a max_length set. When I save a model instance, and > the field's value is > than max_length, Django enforces that max_length at > the database level. (See Django docs on models: >

Re: Forms and 'prefix' parameter

2010-08-05 Thread Ed Schofield
On Aug 5, 2:23 pm, Karen Tracey wrote: > On Thu, Aug 5, 2010 at 12:10 AM, Ed Schofield wrote: > > Hi everyone, > > > I'm trying to use a view with multiple forms under Django 1.2.1. I'm > > puzzled that the prefix parameter seems to screw up validation.