DjangoCon US 2011: September 6-8, in Portland, Oregon

2010-11-21 Thread Russell Keith-Magee
Hi all, The DjangoCon organizing committee, led by Steve Holden, has just announced that DjangoCon US 2011 will be held in Portland, Oregon, from September 6-8 2011. This will be followed by a couple of days of sprints. We are also exploring the possibility of running tutorials on the day before

AttributeError: Model object has no attribute "attributename"

2010-11-21 Thread Jean-Pierre De Villiers
Hi, I've been using Djangos manytomany functionality to add values into the auto generated table, here are my model classes: class Contract_Item(models.Model): quant = models.DecimalField(max_digits=10, decimal_places=4) item = models.OneToOneField(Item) class Contract(models.Model):

How to join a search on user and user profile

2010-11-21 Thread Rogério Carrasqueira
Hello Folks! I'm working on my system that has 2 classes to work with user managemet: User and UserProfile, and I would like to make on admin an unified search. For example I would like to find a user by e-mail at User class and all User that is female or something like that. So, Is there anyway

Re: database relationships, many to one

2010-11-21 Thread Bruno Amaral
It Worked :) Thank you both for the guidance. Here's the final result in case it will help anyone else http://dpaste.com/278230/ On Nov 21, 5:09 pm, Carlos Daniel Ruvalcaba Valenzuela wrote: > The first error is simple, university models is defined after your > department

Use Django's url template tag with special characters

2010-11-21 Thread Ed
I'm using django's url tag to move from one view to another: Read more here For most "items" this works perfectly. But I have an "item" with a / character: Sci-Fi/Fantasy. In this instance, I get an error Caught NoReverseMatch while rendering: Reverse for 'wiki_view' with arguments

Re: Not main content on site - how to?

2010-11-21 Thread Kenneth Gonsalves
On Sun, 2010-11-21 at 03:54 -0800, robos85 wrote: > I'm wondering how to make a sidebars on my site. Main content is not a > problem - I use views to do that. What about the rest of site content? > I want for example to have last comments, last posts, the most popular > posts and the most rated.

Re: Conf/locale

2010-11-21 Thread Kenneth Gonsalves
On Sun, 2010-11-21 at 19:46 +1100, Lachlan Musicman wrote: > So if you just want to "see" you site in the other languages, to > confirm that it's working, try loading another browser and setting > it's locale to the language you are after. well ... there is setlang, which if activated will help

Serve different page to IE7/8?

2010-11-21 Thread Victor Hooi
Hi, We're currently development a small Django webapp for use internally. The page renders fine on Firefox and Webkit-based browsers. However, many of our users are still on Internet Explorer 7, and the CSS/HTML we're using seems to bork really badly on that. I'm definitely not a web-designer

Re: Pydoc and security

2010-11-21 Thread Robert S
Thanks, I've just added the following line near the start of my settings file ... __all__ = ['INSTALLED_APPS'] ... that looks much better On Nov 21, 8:24 pm, Masklinn wrote: > On 2010-11-21, at 21:19 , Robert S wrote: > > > I'm not! > > Pydoc is picking up any

django.contrib.sitemaps unit tests dependency on django.contrib.auth

2010-11-21 Thread Frank
It appears that at some where between development of 1.2.1 and 1.2.3, django.contrib.sitemaps becomes dependent on django.contrib.auth for unit tests. Since not all Django apps will use the auth system, I'm curious if that dependency should exist? I ask because I was going to file a report in

Re: restrict downloading files based on user-permission

2010-11-21 Thread Łukasz Rekucki
I'm guessing that your original problem was that HTTP headers can only contain ASCII characters. To have a UTF-8 encoded name, you should use percent-encoding. I'm using this code on production site: quoted_name = urllib.quote(file.name.encode('utf-8')) response['Content-Disposition'] =

Re: Pydoc and security

2010-11-21 Thread Masklinn
On 2010-11-21, at 21:19 , Robert S wrote: > I'm not! > Pydoc is picking up any variables that are not hidden in classes of > functions. > > Is there a command to (selectivly) stop this? PyDoc respects __all__. -- You received this message because you are subscribed to the Google Groups

Re: Pydoc and security

2010-11-21 Thread Robert S
I'm not! Pydoc is picking up any variables that are not hidden in classes of functions. Is there a command to (selectivly) stop this? On Nov 21, 11:35 am, Łukasz Rekucki wrote: > On 20 November 2010 23:31, Robert S wrote: > > > Hi > > I'm trying

Re: django.contrib.sitemaps unit tests dependency on django.contrib.auth

2010-11-21 Thread Karen Tracey
On Sun, Nov 21, 2010 at 2:59 PM, Frank wrote: > It appears that at some where between development of 1.2.1 and 1.2.3, > django.contrib.sitemaps becomes dependent on django.contrib.auth for > unit tests. > > Since not all Django apps will use the auth system, I'm

Re: Django UserProfile's - the hardest part of the whole framework

2010-11-21 Thread Rogério Carrasqueira
Hi, I liked your example, but I'd like to do on a single funcion at my view. On you example your steps are going to to work two functions: a profile created (not described) and a profile_edit. So, my intention is make everything on a one single function using the max powerful DRY concept of

Re: Static files ...

2010-11-21 Thread Steve Holden
On 11/21/2010 10:52 AM, jonno wrote: > I think I'm getting there, and thanks Steve! I've switched my > directory structure around a bit, but I'm now able to make changes > with predictable results. Still no image, however, but I can't be too > far off. I'll return to the context processor thing

Re: restrict downloading files based on user-permission

2010-11-21 Thread patrickk
well ... yes, but if someond uploads "äöü.PDF" I want the user to download "äöü.PDF" again ... and not %C3%83%C2%A4%C3%83%C2%B6%C3%83%C2%BC.PDF. did you test your code with IE7/IE8? I just did and the name of the downloaded file differs from the upload. regards, patrick On 21 Nov., 20:39,

Re: Multiple inheritance model

2010-11-21 Thread Joseph (Driftwood Cove Designs)
this is django.db.models.base.Model.save_base() a comment in the code for ModelA indicates the call to save_base() is required for Mptt. On Nov 21, 5:43 am, Marc Aymerich wrote: > On Sun, Nov 21, 2010 at 5:31 AM, Joseph (Driftwood Cove Designs) < > > powderfl...@gmail.com>

'utf8' codec can't decode byte 0xe9 in position 303: invalid continuation byte

2010-11-21 Thread Alex s
Hi, In homepage.html file, I am trying to write the letter "é". So I have the following error: 'utf8' codec can't decode byte 0xe9 in position 303: invalid continuation byte How can I resolve this ? I am trying to use brazilian language. Thanks Alex -- You received this message because you

Re: Not main content on site - how to?

2010-11-21 Thread robos85
Thanks for all replies. I've read a bit about template tags. It looks fine for me. Write one tag for each side plugin. Then prepare some sets of these tags and call it whether set I want. I hope my approach is good. On 21 Lis, 19:40, "Joseph (Driftwood Cove Designs)"

How can I set a flatpage to be my homepage?

2010-11-21 Thread mongoose
Hi there, I've created some flatpages and they work great. For example http://127.0.0.1:8000/home/ and http://127.0.0.1:8000/blog/ I'm catching my flatpages with urlpatterns += patterns('', (r'', include('darren_web.flatpages.urls')), ) What I want though is for http://127.0.0.1:8000/home/

Re: How can I set a flatpage to be my homepage?

2010-11-21 Thread Joseph (Driftwood Cove Designs)
mongoose - all you need to do is specify the url: / for the flatpage you want to be homepage. a flatpage can only have one URL - if you want it to show up on 2 urls (e.g. / and /home/), you'll need a re-direct, a view, a re-write rule, or some other trick. good luck. On Nov 21, 2:48 am,

Re: Not main content on site - how to?

2010-11-21 Thread Joseph (Driftwood Cove Designs)
robos85 - there are a couple ways to go - - context processor: this can add a set of context variables so they are available in every template - very easy to write - just a function that takes a request object, returns a context dictionary. Add to your CONTEXT_PROCESSORS setting

Re: How can I set a flatpage to be my homepage?

2010-11-21 Thread vikalp sahni
Hi, If i understood ur question properly you need a URL rewrite. you can try either Apache Rewrite (1st Preference) or you can also import a django app "django.contrib.redirects" which will help u in redirecting URL's Regards //Vikalp On Sun, Nov 21, 2010 at 4:18 PM, mongoose

restrict downloading files based on user-permission

2010-11-21 Thread patrickk
I need to serve media-files uploaded by users, but only the user who uploaded a file should be able to download that file again. therefore, I need to check whether the currently logged-in user is the creator of that file (ok, that´s easy with using a view). – of course, serving the media-file via

Re: Askani

2010-11-21 Thread Joseph (Driftwood Cove Designs)
Hey Alvaro - I only meant that this tool might allow non-programmers (web designers, maybe even clients) to collaborate in the model proto- typing. Currently must use diagramming tools that don't generate Django code (mostly these tools want to generate the SQL directly) - would be great to have

Current Django 1.3 Alpha 2 Documentation as PDF

2010-11-21 Thread ckar...@googlemail.com
Are you interested in the current Django 1.3 Alpha 2 documentation as PDF? -- 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

Re: Current Django 1.3 Alpha 2 Documentation as PDF

2010-11-21 Thread ckar...@googlemail.com
Sry for dublepost. For those who don't want to install all the *tex* libraries. Here is the link: http://ubuntuone.com/p/QFl/ Have fun with printing and reading ;-) On 21 Nov., 18:00, "ckar...@googlemail.com" wrote: > Are you interested in the current Django 1.3 Alpha 2

Re: restrict downloading files based on user-permission

2010-11-21 Thread patrickk
just for the records ... it seems to work when filename is not defined with response["Content-Disposition"] = "attachment; filename=äöü &%%%.pdf" instead just use response["Content-Disposition"] = "attachment" and add the filename to the URL, e.g. /user/downloads/15/äöü &.pdf where 15 is the

Re: User model optional

2010-11-21 Thread Scot Hacker
On Nov 20, 2:55 pm, VB wrote: > If I intend to write my own authentication, can I use my define my own > User model? Or, am I better off naming the model something else? > Why write your own authentication? That wheel's been invented so excellently by django-registration

Re: Not main content on site - how to?

2010-11-21 Thread Daniel Roseman
On Nov 21, 11:54 am, robos85 wrote: > I'm wondering how to make a sidebars on my site. Main content is not a > problem - I use views to do that. What about the rest of site content? > I want for example to have last comments, last posts, the most popular > posts and the most

Re: database relationships, many to one

2010-11-21 Thread Carlos Daniel Ruvalcaba Valenzuela
The first error is simple, university models is defined after your department model, thus is not found, you can define the foreign key as a string in the form of "appname.ModelName", so you will define it like this: class departments(models.Model): university =

Re: Static files ...

2010-11-21 Thread jonno
I think I'm getting there, and thanks Steve! I've switched my directory structure around a bit, but I'm now able to make changes with predictable results. Still no image, however, but I can't be too far off. I'll return to the context processor thing as soon as I see an image. I now have:

Re: database relationships, many to one

2010-11-21 Thread Bruno Amaral
Carlos, Thank you for this! Your solution is what I am looking for,but for some reason I get an error message: "NameError: name 'university' is not defined" Figuring this could an issue with Python and not Django, i added university ='' to the top. The validate

Re: Multiple inheritance model

2010-11-21 Thread Marc Aymerich
On Sun, Nov 21, 2010 at 5:31 AM, Joseph (Driftwood Cove Designs) < powderfl...@gmail.com> wrote: > Below is the basic layout - I posted a simplified version of the two > model classes here: http://pastebin.com/Xc3KLrQx > > ModelA.save(): > if (some condition): > super().save_base() > Hi

Re: Askani

2010-11-21 Thread Alvaro Mouriño
2010/11/21 Joseph (Driftwood Cove Designs) : > Alvaro - > this is a nifty idea - will save time and improve consistency. > > Opens up model proto-typing to non-Django, non-Python, maybe even non- > programmer?  Could be used for collaboration during model design - >

Re: Not main content on site - how to?

2010-11-21 Thread Jonas Geiregat
Inside your views.py file you define functions where you render the template and do your queries. For example: def last_post(req): # Get some results out of your database post = Post.objects.order_by('-pub_date')[0] # render the results return

Not main content on site - how to?

2010-11-21 Thread robos85
I'm wondering how to make a sidebars on my site. Main content is not a problem - I use views to do that. What about the rest of site content? I want for example to have last comments, last posts, the most popular posts and the most rated. How to plan that. Which Django structures should I use?

Re: Pydoc and security

2010-11-21 Thread Łukasz Rekucki
On 20 November 2010 23:31, Robert S wrote: > Hi > I'm trying generate documentation for a django project. > > The obvious tool is pydoc, which does work.  The trouble is, pydoc > publishes everything ... including passwords. Why would you put any passwords in

Re: problems with model inheritance if base class is not abstract

2010-11-21 Thread Marco Ferragina
Mmm yes it seems you are right. But I think this is a bit confusing thinking about object oriented programming, it is not? Then the only way to avoid this seems to be use an abstract base class or use some not so clean way to simulate this behavior. On 21 Nov, 01:36, Ramiro Morales

Re: django charts

2010-11-21 Thread rattanpriya bhasin
thank you so much.it was quite helpful. On Sat, Nov 20, 2010 at 6:40 PM, Darrel Herbst wrote: > I haven't used this, but this provides a way to interface with google > charts: > https://github.com/jacobian/django-googlecharts/blob/master/docs/examples.txt > > On Nov 19, 1:56

Re: Conf/locale

2010-11-21 Thread Lachlan Musicman
On Sat, Nov 20, 2010 at 23:29, Tsolmon Narantsogt wrote: > Hello fellows. > I'm using Django 1.1 version. My goals is create multiple language site. > I make po file > myprojectname/conf/locale/mn/LC_MESSAGES/django.po > and some msgid, msgstr. > But it's don't work. It's too