Re: Admin Model Validation on ManyToMany Field

2010-07-15 Thread Heleen
Thanks very much for your reply! I got it working now. At first I couldn't get my head around how it would work using the clean of the intermediary model. But after a night's sleep it made sense to me. In the Admin my Permission model (the users field) is an inline of Application and when I put the

Re: Redefine True and False for Boolean and/or NullBoolean Fields?

2010-07-15 Thread Tom Evans
On Thu, Jul 15, 2010 at 7:47 AM, rmschne wrote: > Oh ... by the way, we aren't using Access as a front end to Django. > There is nothing (far as I know) in Django to front-end to! > > This app has been successfully making us money for more than 20 > years.  The data side moved to MySQL a long time

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-15 Thread Daniel Roseman
On Jul 15, 5:56 am, Chris Seberino wrote: > How can a view tweak the response object so that client sees a > specific anchor  instead of the top of the page? > > Chris The fragment - the bit of the URL after the "#" which determines which anchor to scroll to - is never sent to the client, so Djan

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-15 Thread Oleg Lomaka
I see two ways to implement this. First without javascript. You cat check URL of HttpRequest and if it is without #anchor element, then send redirect to the same URL with #anchor. Second using javascript. For example in jquery you can include something like this in your head tag: ... ht

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-15 Thread Oleg Lomaka
Opps, Daniel is right, #anchor element isn't contains in URL, so the only way is javascript. On Jul 15, 2010, at 11:57 AM, Oleg Lomaka wrote: > I see two ways to implement this. > > First without javascript. You cat check URL of HttpRequest and if it is > without #anchor element, then send r

Re: Error with passing 'form_class' arg in urls.py for Django Profiles app

2010-07-15 Thread Subhranath Chunder
Could you provide the code for the custom ProfileForm class and the views first. Thanks, Subhranath Chunder. On Thu, Jul 15, 2010 at 2:49 AM, Ricko wrote: > Using ubernostroms Django Registration app coupled with his Profile > app, both highly recommended, got the default app up and running no

Re: www.djangoproject.com

2010-07-15 Thread George Sakkis
On Jul 15, 4:55 am, Danny Adair wrote: > Hi, > > I had the exact same problem, and I had _not_ installed Weave. > The offending config entry in my case was: > "chrome://global/locale/intl.properties" > and it was at the bottom of the accepted languages list. This is on > Firefox 3.6.6 > > I can r

Re: Plain Python traceback (not error page)

2010-07-15 Thread Tom Evans
On Wed, Jul 14, 2010 at 8:48 PM, Jonathan Hayward wrote: > I am working on debugging a basic template, and after correcting some other > error, I got: > > Traceback (most recent call last): > > File > "/usr/local/lib/python2.6/site-packages/django/core/servers/basehttp.py", > line 280, in run >

Re: www.djangoproject.com

2010-07-15 Thread Nick Raptis
On 07/15/2010 05:55 AM, Danny Adair wrote: Hi, I had the exact same problem, and I had _not_ installed Weave. The offending config entry in my case was: "chrome://global/locale/intl.properties" and it was at the bottom of the accepted languages list. This is on Firefox 3.6.6 I can reproduce the

Re: www.djangoproject.com

2010-07-15 Thread Tom Evans
On Thu, Jul 15, 2010 at 11:02 AM, George Sakkis wrote: > On Jul 15, 4:55 am, Danny Adair wrote: > >> Hi, >> >> I had the exact same problem, and I had _not_ installed Weave. >> The offending config entry in my case was: >> "chrome://global/locale/intl.properties" >> and it was at the bottom of th

Re: www.djangoproject.com

2010-07-15 Thread George Sakkis
On Jul 15, 1:14 pm, Tom Evans wrote: > On Thu, Jul 15, 2010 at 11:02 AM, George Sakkis > wrote: > > On Jul 15, 4:55 am, Danny Adair wrote: > > >> Hi, > > >> I had the exact same problem, and I had _not_ installed Weave. > >> The offending config entry in my case was: > >> "chrome://global/local

Re: www.djangoproject.com

2010-07-15 Thread Russell Keith-Magee
On Thu, Jul 15, 2010 at 7:11 PM, Nick Raptis wrote: > On 07/15/2010 05:55 AM, Danny Adair wrote: >> >> Hi, >> >> I had the exact same problem, and I had _not_ installed Weave. >> The offending config entry in my case was: >> "chrome://global/locale/intl.properties" >> and it was at the bottom of t

Apache, wsgi and templates

2010-07-15 Thread lupuscramus
Hi. I've made an app (django 1.2) which works fine for tests, on my laptop with the django built-in web server. I want to put in production my app, with Apache and mod_wsgi. I've verified I've django 1.2 on the production server. The problem is I've no images. When I connect to the admin site

check md5sum on an uploaded file

2010-07-15 Thread Hawit
how do we check the md5sum / checksum an uploded file in django? -- 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 email to django-users+unsu

retrieving record id after form save with generic views

2010-07-15 Thread MarcoS
Hi people, I use django.views.generic.create_update.create_object to save a record and I need to retrieve the id of the record from the just-saved form. It's possible to do this using generic views? -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: www.djangoproject.com

2010-07-15 Thread Nick Raptis
On 07/15/2010 02:20 PM, Russell Keith-Magee wrote: You, mean, like... oh, I don't know... one of the core developers of Django? Like the one that's been asking for details on how to reproduce the problem? :-) Yours, Russ Magee %-) Ahaha! Exactly! Nice to make your acquittance Russ. Kn

Re: check md5sum on an uploaded file

2010-07-15 Thread Jim
Could you clarify what you want to do beyond saving the file somewhere and running md5 on it? -- 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, se

Re: Apache, wsgi and templates

2010-07-15 Thread jaymzcd
There's a few ways to do it. An easy way if your just serving up some css, images etc is to symlink your admin_media folder in your media directory to the media folder in your django admin install: [ja...@293230-app1 ~]$ ls /var/django-projects/udox/public/media/ -l total 28 lrwxr-xr-x 1 root ro

Re: Django 1.2.1, Postgres 8.3 - Cast (text to int) Issue

2010-07-15 Thread rd-london
Hi, Fixed it. I took the following (from http://bit.ly/bO8m9A): Comment.objects.filter(content_type=ContentType.objects.get_for_model(Entry ), object_pk__in=Entry.objects.filter(category="some category")). and used it as follows: Comment.objects.filter(content_type=ContentType.objects.get_for_m

Re: ordering a model on multiple fields?

2010-07-15 Thread Scott Gould
The Django *admin* only uses one field, ever. Bit of an irritating limitation, I grant you, but with the use of date hierarchies and list filters it's not too bad. On Jul 14, 7:40 pm, hjebbers wrote: > is there a way to have a model class sorted on multiple fields? > in the meta class of my mode

Re: Anyone want to take over maintaining Instant Django?

2010-07-15 Thread Sid
I would be willing to take it on or we can also do it as a community effort? Instant Django is how i got started into web dev and now i'm a full time django freelancer so would love to give some love back. -Sid http://sidmitra.com -- You received this message because you are subscribed to the G

Re: altering the sessions class

2010-07-15 Thread Sid
I think a custom middleware solution might work here? Just have a custom middleware run initially that adds the instance of your session class to the request object. I haven't tried anything like this before but it might work. -Sid On Jul 14, 11:42 pm, "T.L" wrote: > So, I am using request.sess

Re: altering the sessions class

2010-07-15 Thread David De La Harpe Golden
On 14/07/10 19:42, T.L wrote: > So, I am using request.sessions in one of my views functions but I > want to add a few more fields to the Session class so it will be > customized for my project. > To sum it up, can anyone tell me some way to customize the Session > class to my liking? > It see

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 13:40, justin jools wrote: > 2. base.html with jquery nav, exactly the same except for > {{ MEDIA_URL }} which is correct. > FWIW, we use a jquery load line in our base template and it works fine (pretty disastrous for us if it didn't). You're 100% sure the pathss correct (like when

Re: www.djangoproject.com

2010-07-15 Thread Russell Keith-Magee
On Thu, Jul 15, 2010 at 7:33 PM, Nick Raptis wrote: > On 07/15/2010 02:20 PM, Russell Keith-Magee wrote: >> >> You, mean, like... oh, I don't know... one of the core developers of >> Django? Like the one that's been asking for details on how to >> reproduce the problem? :-) >> >> Yours, >> Russ Ma

Re: Plain Python traceback (not error page)

2010-07-15 Thread Jonathan Hayward
Thank you; noted; that fixed it. On Thu, Jul 15, 2010 at 5:51 AM, Tom Evans wrote: > On Wed, Jul 14, 2010 at 8:48 PM, Jonathan Hayward > wrote: > > I am working on debugging a basic template, and after correcting some > other > > error, I got: > > > > Traceback (most recent call last): > > > >

Re: Apache, wsgi and templates

2010-07-15 Thread lupuscramus
Le Thursday 15 July 2010 14:25:27, jaymzcd a écrit : > There's a few ways to do it. An easy way if your just serving up some > css, images etc is to symlink your admin_media folder in your media > directory to the media folder in your django admin install: > > [ja...@293230-app1 ~]$ ls /var/django

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
Hi thanks for your reply the links are correct because the css works fine... I do have blocks andchild templates but I took all this out to figure out why the jquery nav function was being reset/disabled... I tested alert('hello') function with $(document).ready(function() {

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
the paths are correct, as I have tested the jquery click function with alert () I do have child templates and blocks but I took all this out to see why the jquery was being overriden/reset/disabled by django. It finds the jquery no problem but always resets to the default base template, and doesn't

debug.py list index out of range

2010-07-15 Thread shwetanka
All of a sudden I'm being shown this error. Please if anyone knows tell me why i'm getting this error. I haven't changed debug.py at all. Traceback (most recent call last): File "C:\Python26\lib\site-packages\django\core\servers \basehttp.py", line 280, in run self.result = application(sel

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
tried putting the nav function in the child template made no difference. I have another button jquery script which is working fine, so maybe it is my script but when I test in straight in html it works... bizarre complete script: http://www.w3.org/ TR/html4/strict.dtd">

custom form field validation

2010-07-15 Thread refreegrata
Hello list. I'm a newie in django with many questions. I want to do something like this: def (valor): raise ValidationError("A") class Mm

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 15:19, justin jools wrote: > > $(document).ready(function() { > $('#nav li a').click(function() { > $('.active').removeClass('active'); > $(this).addClass(

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
Solved it!!! really stupid! I knew it would be something like this. I removed class="active" on home, now it works. Seems django was resetting to default base.html settings. It doesn't do this in straight HTML. So now I'll have to set the home active onload dynamically. hope this tip helps someon

How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
I'm looking at a problem and see how to solve it, probably badly, with eval(), but don't see what the right solution is. I want to use Jeditable more or less to make fields on models editable. Jeditable sends the HTML ID, as well as updated value, when someone makes an in_place edit. I am followin

Re: custom form field validation

2010-07-15 Thread Oleg Lomaka
http://docs.djangoproject.com/en/1.2/ref/forms/fields/#required usu = forms.CharField(required=False, ...) On Jul 15, 2010, at 5:25 PM, refreegrata wrote: > Hello list. I'm a newie in django with many questions. I want to do > something like this: > --

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
I thought I had solved but I haven't. Re: That means a whole different page is requested by the browser. I get your point, you are saying when clicking a link even though the script and navigation are in base.html it is still loading a new instance of base.html and therefore can't keep state for jq

Re: problem models.py code

2010-07-15 Thread Jagdeep Singh Malhi
Problem solve Thanks Django users - jagdeep singh -- 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 email to django-users+unsubscr...@google

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Daniel Roseman
On Jul 15, 4:19 pm, Jonathan Hayward wrote: > I'm looking at a problem and see how to solve it, probably badly, with > eval(), but don't see what the right solution is. > > I want to use Jeditable more or less to make fields on models editable. > Jeditable sends the HTML ID, as well as updated val

Re: custom form field validation

2010-07-15 Thread refreegrata
ok, for my problem that don't works because when i set required=False the field isn't evaluated when it is in blank. I want an evaluation for my function in every situation. With required=True and a custom error message an evaluation can be simulated but if i do a code inside the function in that c

Re: debug.py list index out of range

2010-07-15 Thread Tom Evans
On Thu, Jul 15, 2010 at 3:17 PM, shwetanka wrote: > All of a sudden I'm being shown this error. > Please if anyone knows tell me why i'm getting this error. I haven't > changed debug.py at all. > > > Traceback (most recent call last): > >  File "C:\Python26\lib\site-packages\django\core\servers >

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 16:31, justin jools wrote: > I thought I had solved but I haven't. > [...] > using seperate block nav for evey page seems like a lot of > duplication... Well, you could also pass through a context variable to the template from each of your view functions telling what item in your navba

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
Thank you! Let me play with it. On Thu, Jul 15, 2010 at 10:41 AM, Daniel Roseman wrote: > On Jul 15, 4:19 pm, Jonathan Hayward > wrote: > > I'm looking at a problem and see how to solve it, probably badly, with > > eval(), but don't see what the right solution is. > > > > I want to use Jeditable

Re: Error with passing 'form_class' arg in urls.py for Django Profiles app

2010-07-15 Thread Ricko
Yep, here is the ProfileForm class from django import forms from django.forms import ModelForm from django.contrib.auth.models import User class ProfileForm(ModelForm): def __init__(self, *args, **kwargs): super(ProfileForm, self).__init__(*args, **kwargs) try: se

Re: Error with passing 'form_class' arg in urls.py for Django Profiles app

2010-07-15 Thread Ricko
I've got the reason, so I thought I'd post it here, and I'll raise a ticket with the Debug app. It's an error with the Debug app I use for developing. If you switch it off with Local_Dev = False, everything works. On Jul 15, 9:24 am, Ricko wrote: > Yep, here is the ProfileForm class > > from dja

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Ben Atkin
You could use Django's content types, too. from django.contrib.content_types.models import ContentType my_ct = ContentType.objects.get(app_label='my_app', model='MyModel') # ...or you could leave off app_label, if there are no conflicting model names my_ct.get_object_for_this_type(pk=my_pk) That

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Ben Atkin
Oops - I should have copied and pasted from my repl. The first line should be: from django.contrib.contenttypes.models import ContentType Ben On Thu, Jul 15, 2010 at 10:52 AM, Ben Atkin wrote: > You could use Django's content types, too. > > from django.contrib.content_types.models import Cont

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread natebeacham
Or, if you don't want to over complicate things... $(function() { $('#nav li a').each(function() { if ($(this).attr('href') == window.location.pathname) { $(this).addClass('active'); } }); }); On Jul 15, 12:15 pm, David De La Harpe Golden wrote: > On 15/07/10

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
I'm just going to go with nav blocks for the time being and find something dynamic later... I was looking at Jquery json cookies but seems a lot of effort for a small menu very interesting about context variables, I'll look into this ;) Thanks On Jul 15, 5:15 pm, David De La Harpe Golden wrote:

Re: debug.py list index out of range

2010-07-15 Thread shwetanka
Thank you very much. You saved my day! Actually I did some cut-copy-paste with my app folder while learning git. Actually I'm new to python and django so i didn't realise it's functionality. Now everything is working fine. Thanks a lot man! On Jul 15, 9:12 pm, Tom Evans wrote: > On Thu, Jul 15, 2

Re: Easiest way to pass variables between modelforms (genericforms)

2010-07-15 Thread Erich
Inline FormSets work great for somethings that I'm doing, but to solve the problem that I had originally I passed a variable to the template that i specified as a value in a hidden field. I don't know if that is bad form or not, but it's working. On Jul 13, 4:39 pm, Erich wrote: > I think I found

Re: debug.py list index out of range

2010-07-15 Thread shwetanka
Thanks a lot man. You saved my day! Actually i did some cut-copy-paste with my app folder files. I'm new to python and django so i didn't realize the functionality. Thanks again everything is working fine now. On Jul 15, 9:12 pm, Tom Evans wrote: > On Thu, Jul 15, 2010 at 3:17 PM, shwetanka wrot

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread justin jools
wow works like a dream :) perfect time saver bit of script thanks :) On Jul 15, 6:00 pm, natebeacham wrote: > Or, if you don't want to over complicate things... > > $(function() { >     $('#nav li a').each(function() { >         if ($(this).attr('href') == window.location.pathname) { >          

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
Thank you. I'm off and running. On Thu, Jul 15, 2010 at 11:54 AM, Ben Atkin wrote: > Oops - I should have copied and pasted from my repl. The first line should > be: > > from django.contrib.contenttypes.models import ContentType > > Ben > > > On Thu, Jul 15, 2010 at 10:52 AM, Ben Atkin wrote: >

Re: None field : Admin save setting it to empty value instead of NULL during save

2010-07-15 Thread rahul jain
anyone on this ? On Tue, Jul 13, 2010 at 2:44 PM, rahul jain wrote: > Could it be generic ?. I mean i don't want to specify self.naughty_field. > > How to do it for self.any_field ? > > RJ > > On Tue, Jun 29, 2010 at 9:29 AM, euan.godd...@googlemail.com > wrote: >> Django admin can't differentia

Re: list display based on logged-in user

2010-07-15 Thread rahul jain
nope there is a problem after overriding it, i cannot see the check boxes now. One which is used for performing admin actions, even though i can see all the admin actions. If I uncomment the CustomAdmin then i am able to see the select boxes on the individual rows as well as "select all". What cou

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread David De La Harpe Golden
On 15/07/10 18:00, natebeacham wrote: > Or, if you don't want to over complicate things... Heh. yes, well. :-) Though doing it on the server does mean it stays working for people who disable javascript. -- You received this message because you are subscribed to the Google Groups "Django users"

Temporary group membership tally - Any clever way to do it?

2010-07-15 Thread Continuation
I have groups that users can join. The difference between this and "normal" groups is that membership is temporary - a user decides on joining to be a member for 5 days, a week, 2 weeks, etc (choices are pre-defined). Or potentially all memberships could be set to be of the same length - say a we

Re: Temporary group membership tally - Any clever way to do it?

2010-07-15 Thread Greg Pelly
Why not have a "user.membership_exp_date" field. If a user signs up on day 0, the membership_exp_date could be set to now() + 5 days. This will let you query the results in real-time. No cron job needed. On Thu, Jul 15, 2010 at 12:27 PM, Continuation wrote: > I have groups that users can join.

Re: None field : Admin save setting it to empty value instead of NULL during save

2010-07-15 Thread Derek
On 15 July 2010 21:10, rahul jain wrote: > anyone on this ? > > On Tue, Jul 13, 2010 at 2:44 PM, rahul jain > wrote: > > Could it be generic ?. I mean i don't want to specify self.naughty_field. > > > > How to do it for self.any_field ? > > > > RJ > > > > On Tue, Jun 29, 2010 at 9:29 AM, euan.go

broken default view of the django admin site

2010-07-15 Thread Colleen A Josephson
Hello, I'm very new to django. I just set up my first site using apache and mod_wsgi. The admin area does not seem to have the nice, neat blue default theme...its horrifically ugly and difficult to navigate. Here's a screenshot of the login area: http://web.mit.edu/~cjoseph/Public/fugly.png Be

Most common uses of Django templates

2010-07-15 Thread fabiofz
Hi All, I'm currently working on providing an editor for django templates in Pydev (http://pydev.org). Now, while I do work with django templates sometimes, my experience is a bit limited with it -- so far I used it only for .html files, sometimes with some javascript in it, so, that's what I'm c

A UX question and edit-in place implemention

2010-07-15 Thread burg
Hi everybody, I am developing a platform for building websites called www.9folds.com using Django/AppEngine. I bumped in an issue that is more of a user experience issue rather than technical: Currently when a user wants to start building a new website for himself, the back-office UI makes it almo

Re: No module named site - error deploying a django-jython war in tomcat

2010-07-15 Thread Jose Flores
Hi guys, Any workaround on this issue? Regards, Jose On Jul 8, 2:43 pm, Rafael Nunes wrote: > Same problem here. > > Any thoughts? > > On Jun 29, 10:50 am, tobycatlin wrote: > > > > > Hello everybody, > > > I have followed the install instructions for the latest versions of > > the following: j

Re: Apache, wsgi and templates

2010-07-15 Thread lupuscramus
> > Another way is to set your admin_media_prefix to something like / > admin_media/ and then in your apache conf set an alias for it. > > Alias /admin_media/ /usr/local/pyvans/lib/python2.6/site-packages/ > grappelli/media/ > > > jaymz > In fact, this way works for me. Thanks for your help

Re: Existing sites using Django

2010-07-15 Thread bobhaugen
http://www.djangosites.org/search/?query=onion Huge. Massively popular. -- 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 email to django-us

Re: broken default view of the django admin site

2010-07-15 Thread Brian Neal
On Jul 15, 2:05 pm, Colleen A Josephson wrote: > Hello, > > I'm very new to django. I just set up my first site using apache and mod_wsgi. > > The admin area does not seem to have the nice, neat blue default theme...its > horrifically ugly and difficult to navigate. > Here's a screenshot of the

Re: ordering a model on multiple fields?

2010-07-15 Thread Ben Atkin
I have a solution for you: http://github.com/benatkin/tuneage/blob/master/tunes/admin.py I'm going to post a blog entry to http://python-web.blogspot.com/ explaining my code, but it might take a little while. In the meantime, let me know if you need any help understanding the code, or run into an

Re: ordering a model on multiple fields?

2010-07-15 Thread Ben Atkin
I spoke too soon! While I was writing the blog entry, I realized that due to some fixture mistake, I hadn't shuffled the data that I was sorting, so it was sorted properly without my help! I fixed the glaring mistake, and then realized that column sorting isn't applied by django.contrib.admin.Model

Re: broken default view of the django admin site

2010-07-15 Thread Graham Dumpleton
On Jul 16, 12:51 pm, Brian Neal wrote: > On Jul 15, 2:05 pm, Colleen A Josephson wrote: > > > Hello, > > > I'm very new to django. I just set up my first site using apache and > > mod_wsgi. > > > The admin area does not seem to have the nice, neat blue default > > theme...its horrifically ugl