Re: Checking image isn't too big on upload

2008-07-25 Thread Darthmahon
Hi Marty, So currently there is no way of getting the dimensions for an image? On Jul 25, 6:09 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Fri, Jul 25, 2008 at 12:31 PM, Darthmahon <[EMAIL PROTECTED]> wrote: > > I've just upgraded my Django to the trunk and noticed some code I need > >

Checking image isn't too big on upload

2008-07-25 Thread Darthmahon
Hey, I've just upgraded my Django to the trunk and noticed some code I need to change. I've got a form that uploads images, looks like Django throws up an error if the file is not an image, which is nice but I also need to check if the image is too big/small. Here is the code: class

Re: Need help with some custom pagination

2008-07-25 Thread [EMAIL PROTECTED]
Thank you much. I'll be looking closer at your Django forum code, too. I'm liking what I see. On Jul 23, 9:56 am, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 23, 2008 at 3:26 PM, [EMAIL PROTECTED] > > > > <[EMAIL PROTECTED]> wrote: > > > On a forum I'm working on

per object permissions, caching and templates?

2008-07-25 Thread Bram de Jong
hello all, For freesound.org I really need per-object permissions and caching. I would also love to use the {% cache %} template tag as much as possible because it's so easy and transparent! Now, say for example I have a sound, and a user can either edit it or not, or vote for it or not. can

Inline Comments / Django Book

2008-07-25 Thread aleray
Hi, I'm looking for something similar to the inline comment system used in the Django book. Does anybody know if the code is available somewhere? I also would like to make a change: instead of parsing automatically the text, I would like to add where the comments go by myself. How could I do

Re: internal server error with new development version

2008-07-25 Thread ajo11
Thanks. After back-tracking through the updates, I've realised that I have a problem upgrading to version 7967. 7967 just gives the 500.html page, no Apache error message. So if I can just get 7967 working, that might also fix the problem with later versions too Thanks again for your

Re: extend Site Model

2008-07-25 Thread Nikolay Panov
Use monkey patching, Luke? Have a nice day, Nikolay. On Fri, Jul 25, 2008 at 20:35, José Moreira <[EMAIL PROTECTED]> wrote: > > Hello, > > is it possible to extend Site Model to add additional properties? > > thank you > > -- > José Moreira > Vila Nova de Gaia > Portugal > > > >

Filtering results of a custom manager that added attributes

2008-07-25 Thread clint
I have a model that computes a score based on several related models. I'd like to return a set of the instances with the score computed and added to the object for each item in the results. I'd also like to filter the results in different ways to get a list of more interesting items. Is this

Re: extend Site Model

2008-07-25 Thread Nikolay Panov
> monkey patching = alter django code? Not exactly. You should not modifying the django code, but alter the code dynamically. For instance, when I needed to add to model User an additional "Customer" field, I have made it as: # Monkey-patching User model User.add_to_class('customer',

Re: Checking image isn't too big on upload

2008-07-25 Thread Marty Alchin
On Fri, Jul 25, 2008 at 1:11 PM, Darthmahon <[EMAIL PROTECTED]> wrote: > So currently there is no way of getting the dimensions for an image? I'd call that a radical interpretation of the text. You were asking solely about the size of the file, not the dimensions of the image. Looking a bit at

Re: Checking image isn't too big on upload

2008-07-25 Thread Marty Alchin
On Fri, Jul 25, 2008 at 12:31 PM, Darthmahon <[EMAIL PROTECTED]> wrote: > I've just upgraded my Django to the trunk and noticed some code I need > to change. I've got a form that uploads images, looks like Django > throws up an error if the file is not an image, which is nice but I > also need to

Re: extend Site Model

2008-07-25 Thread José Moreira
monkey patching = alter django code? may the source be with you :) 2008/7/25 Nikolay Panov <[EMAIL PROTECTED]>: > Use monkey patching, Luke? > > Have a nice day, > Nikolay. > > > > On Fri, Jul 25, 2008 at 20:35, José Moreira <[EMAIL PROTECTED]> wrote: >> >> Hello, >> >> is it possible to

Re: URL RegEx problem for oembed

2008-07-25 Thread Fredrik Lundh
Marty Alchin wrote: > Also, though, I have to ask why you're using such a complicated URL > pattern in the first place? For some applications, I can understand > accepting a full URL, but your pattern is expecting something very > specific, which means you're not looking to accept just any

Re: Practical Django Projects - Problem with CMS Search

2008-07-25 Thread Adi J. Sieker
On Fri, 25 Jul 2008 13:36:57 +0200, ColdSun <[EMAIL PROTECTED]> wrote: > After removing the "=" between the return and the httpresponse, I > recieve a different error (perhaps progress? :)) > > Error is as follows: > > MultiValueDictKeyError at /search/ > "Key 'Q' not

Re: per object permissions, caching and templates?

2008-07-25 Thread Bram de Jong
Hello, On Fri, Jul 25, 2008 at 4:55 PM, Hanne Moa <[EMAIL PROTECTED]> wrote: > > AFAIK is_authenticated doesn't enter into it at all. I think I might not have explained very well... Newforms-admin ( i.e. "admin" now :) ) has per-object permissions. These are more programmatic than per-row

newforms generic and hidden fields in form

2008-07-25 Thread hotani
I had a form that was working with oldforms generic and had some hidden fields. After the newforms-admin merge and newforms-generic, the hidden fields are being passed as NULL. In 'BackwardsIncompatibleChanges,' it says "You'll probably need to update any templates used by these views." So what

Simple path issue ?

2008-07-25 Thread dbee
This path issue is really frustrating me. I've tried everything i can think of. I'm trying to use the fckeditor module for drupal ... INSTALLED_APPS = ( 'django.contrib.auth' 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',

Simple path issue ?

2008-07-25 Thread dbee
This path issue is really frustrating me. I've tried everything i can think of. I'm trying to use the fckeditor module for drupal ... INSTALLED_APPS = ( 'django.contrib.auth' 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',

URL RegEx problem for oembed

2008-07-25 Thread timc3
I am trying to match the following URL: http://127.0.0.1:8000/services/oembed/?ref=http://127.0.0.1:8000/media/slug/guid/ And the regex that I am using: urlpatterns = patterns('', url(r'^oembed/(?P[-\w]+)//(?[-\w]+)/media/(?P[- \w]+)/(?P[-\w]+)/$', 'brokersite.services.views.mediaoembed'),

File upload example is not working

2008-07-25 Thread Kushal Das
Hi, I am new to Django and looking into file upload example at http://www.djangoproject.com/documentation/upload_handling/ In def upload_file(request): if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) if form.is_valid():

Re: URL RegEx problem for oembed

2008-07-25 Thread Marty Alchin
On Fri, Jul 25, 2008 at 11:31 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Marty Alchin wrote: >> Also, though, I have to ask why you're using such a complicated URL >> pattern in the first place? For some applications, I can understand >> accepting a full URL, but your pattern is expecting

Simple path issue ?

2008-07-25 Thread dbee
This path issue is really frustrating me. I've tried everything i can think of. I'm trying to use the fckeditor module for drupal ... INSTALLED_APPS = ( 'django.contrib.auth' 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',

Re: Open Source Volunteer Position open for a Science Fiction Movie Project.

2008-07-25 Thread Douglas E
On Jul 25, 1:43 pm, "Ronaldo Zacarias Afonso" <[EMAIL PROTECTED]> wrote: > Hi Douglas, > > I'm interested in giving some help to this project. > I'm not a Django expert (I'm learning django right now), but I think I > can help you. > If you need more info about me, just let me know and just

Re: per object permissions, caching and templates?

2008-07-25 Thread Hanne Moa
On Fri, Jul 25, 2008 at 11:39 AM, Bram de Jong <[EMAIL PROTECTED]> wrote: > For freesound.org I really need per-object permissions and caching. > I would also love to use the {% cache %} template tag as much as > possible because it's so easy and transparent! > Now, say for example I have a

Re: Comparison of objects

2008-07-25 Thread Matthias Kestenholz
On Fri, 2008-07-25 at 03:42 -0700, Ryan wrote: > thank you kenneth and jukien > > this is what I tried on the python prompt. I was not sure where to run > the snippet. > from django import template > register = template.Library() > @register.filter > def LT(value,arg): return value < arg > >

Re: Filtering a choice field

2008-07-25 Thread [EMAIL PROTECTED]
On Jul 25, 2:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Oh, ignore me, it was something strange I was doing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Can't create superuser for admin

2008-07-25 Thread elithrar
On Jul 25, 3:49 pm, Joe_20 <[EMAIL PROTECTED]> wrote: > Im using trunk and when i do  syncdb  it just can't fine the part > where it prompts for the superuser so i start to look for and i found > it but it says that i dont have configure my db engine, and i do have > that in my setting of my

Re: Order by count

2008-07-25 Thread mtrythall
Thanks Dan. I was trying to avoid doing a custom query, but groupby would work. On Jul 24, 3:27 pm, Dan Lazewatsky <[EMAIL PROTECTED]> wrote: > I'm not sure if there's anything built into Django to do this, but you > should be able to accomplish it with a custom query and some crafty use > of

django-tagging and newforms admin

2008-07-25 Thread eka
Hi, Any one knows if the newforms-admin branch of the django-tagging project is merged in the trunk? or they will continue to update on that branch? Regars. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: URL RegEx problem for oembed

2008-07-25 Thread Marty Alchin
On Fri, Jul 25, 2008 at 8:23 AM, timc3 <[EMAIL PROTECTED]> wrote: > Just isn't working, and it looks like a RegEx problem to me, but I am > not sure why.. It's usually best to explain what isn't working, exactly. Is it just not being matched, and you're getting a 404? Is your urls.py giving you

Re: how to save

2008-07-25 Thread Matthias Kestenholz
On Fri, 2008-07-25 at 04:45 -0700, Will Rocisky wrote: > I am new to django. > > while using > f = ContactForm() > > I cannot use f.save() > > how can I save f to db? ContactForm inherits forms.Form, doesn't it? Any reason you are not using modelforms[1]? Anyway, if the data in the form is

Re: newforms-admin weird error ( 'str' object has no attribute '_default_manager' )

2008-07-25 Thread vv2
I am experiencing same error message with r8053, however my situation is a bit different: - commenting out fieldsets definition doesn't help, - everything works perfectly on local dev server and fails deployed through mod_wsgi and mod_python (I didn't try with fcgi) I managed to narrow down the

Local Django Sprint, Berlin, Germany, August 08, 2008

2008-07-25 Thread Jannis Leidel
Since the Django Sprint at Europython was great fun, there was some discussion in the django-de.org community about a local Django Sprint in Berlin. While we are still working out the details and location, we hope it’s not to late for others to chime in. We want to accompany the Beta2 Sprint in

Re: Practical Django Projects - Problem with CMS Search

2008-07-25 Thread ColdSun
Ah fantastic. I'm not sure why I overlooked that. Thank you very much. Its working fantastic now. -Logan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Admin interface: group window too narrow and too full

2008-07-25 Thread Torsten Bronger
Hallöchen! In order to have easier administration, I'd like to widen the group window in the "User" section of the admin interface (I can't see any text after the "Can ..." for some of my models). Additionally, I'd be nice to get rid of the default permissions. As far as I can see, their

Re: Open Source Volunteer Position open for a Science Fiction Movie Project.

2008-07-25 Thread Ronaldo Zacarias Afonso
Hi Douglas, I'm interested in giving some help to this project. I'm not a Django expert (I'm learning django right now), but I think I can help you. If you need more info about me, just let me know and just tell me what I should to do. Thanks, Ronaldo. P.S) I could not send this reply direct

Re: Practical Django Projects - Problem with CMS Search

2008-07-25 Thread ColdSun
After removing the "=" between the return and the httpresponse, I recieve a different error (perhaps progress? :)) Error is as follows: MultiValueDictKeyError at /search/ "Key 'Q' not found in " Request Method: GET Request URL:http://127.0.0.1:8000/search/

Practical Django Projects - Problem with CMS Search

2008-07-25 Thread ColdSun
Hello, I'm working through James Bennett's Practical Django Projects and am on chapter 3 and trying to implement the search function. Ive created the search/search.html pages, the views.py for the app etc, but when performing a search I receive the following error:

formatting queryset for tree view

2008-07-25 Thread Leppy
Hi all, Here I have a model called Product. It has a self relationship as shown below. class Product(models.Model): name = models.CharField(max_length = 200, blank = True) main_product = models.ForeignKey('self', verbose_name = "Subproduct of", help_text = "sl.no. of the containing

formatting queryset for tree view

2008-07-25 Thread Leppy
Hi all, Here I have a model called Product. It has a self relationship as shown below. class Product(models.Model): name = models.CharField(max_length = 200, blank = True) main_product = models.ForeignKey('self', verbose_name = "Subproduct of", help_text = "sl.no. of the containing

Defaulting Site in NewFormsAdmin

2008-07-25 Thread Tim Sawyer
Hi Folks, I'm trying to build a web app that has many sites, all of which share the same code and database. I'm therefore using the Sites framework, but I need to hide the site that is being edited in the admin. I have done this where my model has a Foreign Key of site, mainly by defining

Re: How to use dojo toolkit in django?

2008-07-25 Thread Wolfram Kriesing
Hi, I remembered seeing this topic mentioned here, and now there is a solution to it. http://code.google.com/p/dojango/ A quick summary of the main features of dojango: * a reusable django app that provides dojo * easy dojo setup inside django * build an optimized dojo * some

Re: forms.ChoiceField()

2008-07-25 Thread Rishabh Manocha
In your form field definition, set empty_labal = None This was somewhere in the docs, but am unable to find it in the 2 mins I spent on the search. Best, R On Fri, Jul 25, 2008 at 10:14 AM, JF Simon <[EMAIL PROTECTED]> wrote: > > hi ! > > How to remove the first --- in a from a >

Re: forms.ChoiceField()

2008-07-25 Thread Rishabh Manocha
That's "empty_label = None". Sorry for the typo Best, R On Fri, Jul 25, 2008 at 3:07 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote: > In your form field definition, set empty_labal = None > > This was somewhere in the docs, but am unable to find it in the 2 mins I > spent on the search. > >

Re: newforms-admin weird error ( 'str' object has no attribute '_default_manager' )

2008-07-25 Thread Bram de Jong
On Fri, Jul 18, 2008 at 5:45 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > > Determining which part of the fieldsets definition generates the error would > be helpful. You might be able to determine it by looking at the local vars > in the debug page. Alternatively you could experiment with

Key error at password2 while doing custom validation with user registration form

2008-07-25 Thread tom17
This is how I solved it! my model is like this: class userForm(forms.Form): username = forms.CharField() display_name = forms.CharField() email_address = forms.EmailField() timezone = TimeZoneField() password1 = forms.CharField(widget=forms.PasswordInput)

Re: Multi-Table DB Inheritance (Finding Child Model)

2008-07-25 Thread Bradley Wright
On Jul 25, 7:03 am, "Adam Fast" <[EMAIL PROTECTED]> wrote: > Hello, > > I'm using Multi-Table Inheritance as the basis of a tumblelog - all > the common pieces of data are stored on the base class / table > (StreamItem) > > I'm doing a StreamItem.objects.all() and looping through the items. > But