Re: Help with apache mod rewrite engine

2009-12-08 Thread Thomas Sutton
Hi Amit, 2009/12/9 Amit Sethi > Hi all , I need some help understanding the mod rewrite module of apache . > What I wished to do want that i had a comments folder by the name of > /comments/ . Now i run a django project on /sees and i want all the call to > /comments/

Re: Help with apache mod rewrite engine

2009-12-08 Thread Lakshman Prasad
You can just replace the regex ^/comments/$ with ^/sees/comments/$ within the urls.py Why can't you do that? On Wed, Dec 9, 2009 at 12:10 PM, Amit Sethi wrote: > Hi all , I need some help understanding the mod rewrite module of apache . > What I wished to do want that

django-syncr - twitter.User.profile_image_url - deprecated attribute?

2009-12-08 Thread neridaj
Hello, I'm just curious if anyone else has run into this problem using the twitter app in django-syncr. I looked on the twitter API docs but didn't find anything. t.syncTwitterUserTweets('twitteruser') Traceback (most recent call last): File "", line 1, in File

Help with apache mod rewrite engine

2009-12-08 Thread Amit Sethi
Hi all , I need some help understanding the mod rewrite module of apache . What I wished to do want that i had a comments folder by the name of /comments/ . Now i run a django project on /sees and i want all the call to /comments/ be redirected to /sees/comments and than be handled by the wsgi

Re: 'QuerySet' object has no attribute 'ordered' Error When Using Inline Formset

2009-12-08 Thread Karen Tracey
On Tue, Dec 8, 2009 at 11:13 PM, saved...@gmail.com wrote: > Every time I try to access a formset via inlineformset_factory I get > the following error messages: > > Traceback: > [snip] > File "/home/luckybs/webapps/django1/lib/python2.5/django/forms/ > models.py" in

Re: Viewing uploaded files via the admin interface

2009-12-08 Thread Karen Tracey
On Tue, Dec 8, 2009 at 4:42 PM, Lukas wrote: > Hi everyone, > > i've a problem viewing uploaded files via the admin interface. When I > try to view the file, everything I get is a ValueError exception: > invalid literal for int() with base 10... > I know it goes wrong,

Re: CharField cannot have a "max_length" greater than 255 when using "unique=True"

2009-12-08 Thread Karen Tracey
On Tue, Dec 8, 2009 at 1:21 PM, germ wrote: > > The point is that utf8 can use up to 3 bytes per character... > > i appreciate your reply. interesting distinction between bytes and > chars. i think i still need some more guidance. still not sure how to > resolve with

Re: Initial values and unbound forms (apparently a bug?)

2009-12-08 Thread Info Cascade
Hi, Manu, Thanks for writing. I tried what you suggested, and the forms were displayed exactly as I wanted. However, when I tried to submit the form, it triggered validation errors for all the fields that were left blank. So, the behavior is not quite what I want. I'm guessing that setting the

Re: UserProfile and Admin interface

2009-12-08 Thread Victor Hooi
heya, I should probably add an example - we want to add a Title field to the user form. Ideally, this would appear seamlessly as part of the User form, next to the name fields, rather than it's own separate sub- section below. What would be a Django-esque way of achieving that? Cheers, Victor

question about modelform lifecycle

2009-12-08 Thread chefsmart
At what point in a modelform's lifecycle does the underlying object become accessible? Specifically, can I access the underlying object in a modelform's "clean" method? Or is it only after one does form.save () with or without commit = False? I basically need to do some custom validation and

Re: PIL zip decoder error (while installed) refering to a template tag ?!

2009-12-08 Thread Karen Tracey
On Sun, Dec 6, 2009 at 9:04 PM, GoSantoni wrote: > Hi all, > What does this mean? It doesn't make sense doesn't it? Line 25 isn't > referring to the PIL... > Thanks > > I've seen that before. Whatever calculates the line number in the template isn't getting it right. In

Re: MySQLdb (python 2.6/django from subversion)

2009-12-08 Thread Karen Tracey
On Fri, Dec 4, 2009 at 6:16 AM, Peter wrote: > Hi, > > I've installed django on an XP box and am trying to work through the > tutorial. > > I got django from svn using the url from the django site: > > http://code.djangoproject.com/svn/django/trunk > > All is well until I

Re: newbie problem with ModelForm

2009-12-08 Thread Karen Tracey
On Fri, Dec 4, 2009 at 6:04 AM, Andreas Kuntzagk < andreas.kuntz...@mdc-berlin.de> wrote: > Hi, > > have a (probably simple) problem using ModelForms. I'm following this > guide: > http://docs.djangoproject.com/en/1.0/topics/forms/modelforms/ > > Here are my models: > > class Run(models.Model): >

Re: UserProfile and Admin interface

2009-12-08 Thread Victor Hooi
heya, Well, now that was a bit silly of me. I just noticed that I was importing with "from django.contrib.auth.admin import UserAdmin", but then I was calling "admin.UserAdmin" below, rather than "UserAdmin". I've fixed that now, and the "People" app is now appearing in the admin interface. I'm

'QuerySet' object has no attribute 'ordered' Error When Using Inline Formset

2009-12-08 Thread saved...@gmail.com
Every time I try to access a formset via inlineformset_factory I get the following error messages: Traceback: File "/home/luckybs/webapps/django1/lib/python2.5/django/core/handlers/ base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File

UserProfile and Admin interface

2009-12-08 Thread Victor Hooi
heya, I'm having issues extending Django's user model via UserProfile, and then editing this through the admin interface. Essentially, what I want is to add some extra fields to the User model (I've called this model "Person"), and be able to edit these along with the normal User attributes

Re: how to avoid pk collisions at loaddata time

2009-12-08 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 8:28 AM, Phlip wrote: > Djangoids: > > Does the data fixture support automatically generated primary keys? > > We need to add a tiny stretch of new data to an existing website. A > fixture, such as new_data.json, would work great for both the new data >

how to avoid pk collisions at loaddata time

2009-12-08 Thread Phlip
Djangoids: Does the data fixture support automatically generated primary keys? We need to add a tiny stretch of new data to an existing website. A fixture, such as new_data.json, would work great for both the new data and for their new feature's unit tests. Then we would just run loaddata on the

Re: How to get the last item of array in a built-in template tag?

2009-12-08 Thread pjrhar...@gmail.com
Whoops, didn't actually try that as I'm not at my normal pc, I just remembered reading it somewhere. Thinking about it now, you can actually just do: {{ my_list|last }} Pete On Dec 7, 8:35 pm, Gaffar Overcomes wrote: > hey pete this does not work :S > negative index

Re: Test Application Without it's own models

2009-12-08 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 5:07 AM, spool wrote: > Hi I've got the same problem. > > Here's what I'd like to do: I'm trying to create a generic > "time_series" app, which has models which are inherited by other apps > but are not functional by themselves. I would like to create

Re: FieldError on Django's sessions

2009-12-08 Thread dlrust
Starting to experience this error on our development server as well. I'm beginning to think its some conflict in Django itself. We even started getting other `FieldError`s like: " FieldError: Cannot resolve keyword 'username' into field. Choices are: id, username " Any input would be

Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch wrote: > one to many from year to user is same as many to one from a > user to a year. > Yes, but how? :D I can't place a FK on the User... -- You received this message because you are subscribed to the Google Groups "Django

Viewing uploaded files via the admin interface

2009-12-08 Thread Lukas
Hi everyone, i've a problem viewing uploaded files via the admin interface. When I try to view the file, everything I get is a ValueError exception: invalid literal for int() with base 10... I know it goes wrong, when your MEDIA_URL is not set correctly. The link to the file in the admin

Re: Test Application Without it's own models

2009-12-08 Thread spool
Hi I've got the same problem. Here's what I'd like to do: I'm trying to create a generic "time_series" app, which has models which are inherited by other apps but are not functional by themselves. I would like to create test models in tests.py, and then run unittests on them. from django.test

Accessing foreign key related item

2009-12-08 Thread lfrodrigues
I have this structure: class Album(models.Model): caption = models.CharField(max_length=500) def get_album_type(self): if self.a_set.count() > 0: return 'a' if self.b_set.count() > 0: return 'b' def _get_a(self): return self.a_set.all()[0] def _get_b(self):

Filter queryset by foreignkey or manytomany count

2009-12-08 Thread pbzRPA
Hi Does anyone know if its possible to filter a queryset by the count of it's foreignkey or manytomany set? For example: class Y(models.Model): name = models.CharField(...) class X(models.Model): name = models.CharField(...) y_rec = models.ManyToManyField(Y) class Z(models.Model): x =

Re: Filtering queryset using two fields in one model

2009-12-08 Thread pbzRPA
Excellent thank you. So the solution is: from django.db.models import F X.objects.filter(id = F('new_id')) Thanks for the help guys. On 8 Gru, 19:38, Boris Schäling wrote: > > -Original Message- > > From: django-users+ow...@googlegroups.com [mailto:django- > >

RE: Filtering queryset using two fields in one model

2009-12-08 Thread Boris Schäling
> -Original Message- > From: django-users+ow...@googlegroups.com [mailto:django- > users+ow...@googlegroups.com] On Behalf Of pbzRPA > Sent: Tuesday, December 08, 2009 7:19 PM > To: Django users > Subject: Filtering queryset using two fields in one model > > Hi, > > I am not sure if

Re: Filtering queryset using two fields in one model

2009-12-08 Thread Peter Sagerson
Assuming you're using Django 1.1, take a look at: http://docs.djangoproject.com/en/1.1/topics/db/queries/#filters-can-reference-fields-on-the-model On Dec 8, 2009, at 10:18 AM, pbzRPA wrote: > Hi, > > I am not sure if this is a really stupid question but how can you > filter a model by

Re: CharField cannot have a "max_length" greater than 255 when using "unique=True"

2009-12-08 Thread germ
> The point is that utf8 can use up to 3 bytes per character... i appreciate your reply. interesting distinction between bytes and chars. i think i still need some more guidance. still not sure how to resolve with your suggestion to consdier the character set. i am able to create the django

Filtering queryset using two fields in one model

2009-12-08 Thread pbzRPA
Hi, I am not sure if this is a really stupid question but how can you filter a model by comparing two of it's own fields? for example: class X(models.Model): id = models.IntegerField() new_id = models.IntegerField() now I want to say X.objects.filter(id = new_id) Thanks -- You received

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Paul Menzel
Am Dienstag, den 08.12.2009, 08:54 -0800 schrieb Jenn Hughes: > I'm not sure what you mean by box. »box« in this case means computer or system. Thanks, Paul signature.asc Description: Dies ist ein digital signierter Nachrichtenteil

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Shawn Milochik
On Dec 8, 2009, at 11:38 AM, Jenn Hughes wrote: > I checked and no proxy is in place. I tried the other IPs, two > wouldn't let me assign it and the third went through but gave me the > same error that I began with. How odd. > I suspect there may be some other tiny but very important problem

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Peter Rowell
OK, let's do a little Networking 101. 127.0.0.1 is an unroutable address (that means you'll never see it on the Internet) that *always* means the local host; in fact it's called 'localhost' in your 'hosts' file. For Linux this is /etc/hosts, for Windows it's in

Re: how to allow RSS aggregators to use feeds available only for logged-in users?

2009-12-08 Thread Alex Robbins
Maybe you could just make another url that wasn't password protected. If the token doesn't get used up in your plan, you have roughly the same security (not much). def rss_view(request): askdmalkdmakds protected_rss_view = login_required(rss_view) Hope that helps, Alex On Dec 7, 8:57 am,

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Jenn Hughes
I'm not sure what you mean by box. Jenn On Dec 8, 11:26 am, Tom Evans wrote: > On Tue, Dec 8, 2009 at 4:18 PM, Jenn Hughes wrote: > > I gave this a try and I got this error: > > [jjhug...@silo cms]$ python manage.py runserver 156.56.137.131:8000 > >

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Jenn Hughes
I checked and no proxy is in place. I tried the other IPs, two wouldn't let me assign it and the third went through but gave me the same error that I began with. How odd. On Dec 8, 11:24 am, Shawn Milochik wrote: > I don't think they can prevent you from using it locally.

Re: admin with data filtered with user scope

2009-12-08 Thread gaddoz
Just wondeful Thank you gaddoz On 8 Dic, 15:04, Xia Kai(夏恺) wrote: > Hi~ > > you can customize your admin interface by overriding default admin functions > in django/contrib/admin/options.py > > These links might be helpful to you: > >

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Tom Evans
On Tue, Dec 8, 2009 at 4:18 PM, Jenn Hughes wrote: > I gave this a try and I got this error: > [jjhug...@silo cms]$ python manage.py runserver 156.56.137.131:8000 > Validating models... > 0 errors found > > Django version 1.1.1, using settings 'cms.settings' > Development server

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Shawn Milochik
I don't think they can prevent you from using it locally. The fact that I can ping the IP address you provided means that it's publicly available. This either means that your machine has its own direct connection to the Internet, or ipconfig returned multiple addresses, including the address of

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Jenn Hughes
I gave this a try and I got this error: [jjhug...@silo cms]$ python manage.py runserver 156.56.137.131:8000 Validating models... 0 errors found Django version 1.1.1, using settings 'cms.settings' Development server is running at http://156.56.137.131:8000/ Quit the server with CONTROL-C. Error:

Re: settings caching?

2009-12-08 Thread Benjamin Wolf
Hi Daniel, thanks for your reply - yes indeed it was the server restart. I found it out a while after writing this post, but I still don' know why a apache restart is needed? Maybe somebody can give me a short explain thx a lot ;) Daniel Roseman schrieb: > On Dec 8, 1:54 pm, Benjamin Wolf

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Shawn Milochik
Sorry, I should have said 'ipconfig' instead of 'ifconfig' if you're running on Windows, and you mentioned IE so I guess you are. Unless you're running your Django server on one machine and trying to access it from another, which would definitely cause the exact problem you're seeing, but

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Shawn Milochik
If you run 'ifconfig' on the command line, you will get your IP address. Let's pretend that your IP address is 192.168.1.105. Try this: python manage.py runserver 192.168.1.105:8000 See if you can visit http://192.168.1.105:8000 instead. I don't know what the problem is, but maybe it's

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Jenn Hughes
Error on IE: Internet Explorer cannot display the webpage Most likely causes: You are not connected to the Internet. The website is encountering problems. There might be a typing error in the address. Error on Firefox: Failed to Connect Firefox can't establish a connection to the server at

Re: New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Shawn Milochik
We'll need some more information. What error messages are you getting, if anything. How do you know the CMS works at all, if it hasn't been run locally? Have you followed the official tutorial to get a basic understanding of how Django works? If not, please do:

New to Django, can't get it running on the web through http://127.0.0.1:8000/

2009-12-08 Thread Jenn Hughes
Hi, I'm new to django and fairly new to programming. I have django installed (and it give no errors when imported on python). I also have a cms made and configured. However I cannot anything to come up on the page when I ran the server and checked http://127.0.0.1:8000/. I have tried some other

Re: Forms ForeignKeyField does not populate with initial value

2009-12-08 Thread bruno desthuilliers
On 8 déc, 13:26, Michael wrote: > ^ Thanks for that.  Have been scratching my head for a while as .id is > not a field/property for model.user, according to the doco I am > reading anyway (http://docs.djangoproject.com/en/dev/topics/auth/ > #topics-auth). When no primary

Re: Format fields in list, but keep sortable?

2009-12-08 Thread Shawn Milochik
Bear in mind that the admin has a limited scope. This is intentional. It was meant to be a friendly replacement for having to hit the Postgres/mySQL command line interface, and that's about it. It's trivial to create your own form for dealing with your model which can be customized in any way

Re: settings caching?

2009-12-08 Thread Daniel Roseman
On Dec 8, 1:54 pm, Benjamin Wolf wrote: > Hi there, > > I've just put my first little django app online (at webfaction) and I > have the problem that when I change my database connection in the > settings.py, > the application always tries to connect with my old connection data. >

Re: Styling widgets with django.forms

2009-12-08 Thread Daniel Roseman
On Dec 8, 9:28 am, playfire wrote: > I am using django.forms for my forms and I want to style my > tags using css. I know I can customize the form template, but how do i > customize the widget itself? Normally I would do > and then put the style in my css file but all I have

ne field lookup revival request

2009-12-08 Thread chefsmart
There used to be an "ne" field lookup (for expressing "not equal to" conditions). Now we can do similar things with the "exclude" filters. But I really think having ne back as a field lookup would help in situations like when I would like to do a quick: Issue.objects.get(type__ne='immediate')

Re: admin with data filtered with user scope

2009-12-08 Thread 夏恺
Hi~ you can customize your admin interface by overriding default admin functions in django/contrib/admin/options.py These links might be helpful to you: http://www.slideshare.net/road76/customizing-the-django-admin-euro-django-con09

admin with data filtered with user scope

2009-12-08 Thread gaddoz
Hi all I'm pretty new to django and I'm trying to figure out if it's possible to use the wonderful admin feature filtering by user data scope. What I mean? I think that for non admin users could be really nice to use admin interface to manage their own data, for example, managing comments, but

settings caching?

2009-12-08 Thread Benjamin Wolf
Hi there, I've just put my first little django app online (at webfaction) and I have the problem that when I change my database connection in the settings.py, the application always tries to connect with my old connection data. I just got no idea what I could try to fix this, hope you have a

Coltrane Weblog Practical Django Projects 2nd Ed, page not found for http://127.0.0.1:8000/weblog/

2009-12-08 Thread bernard
Hi all, I am reading through the Practical Django Projects 2nd Edition book and i am now on the weblog entries_index part (page 84) where im trying to view the weblog entry index but I get an error No FlatPage matches the given query. I followed exactly what's written in the book. Please help,

Re: django error page: traceback too shallow?

2009-12-08 Thread Karen Tracey
On Thu, Dec 3, 2009 at 1:24 AM, notcourage wrote: > def home (request): > >if (request.user.is_authenticated()): >artifacts = Artifact.objects.filter > (member__exact=request.user.profile.id) > ... >else: > ... > > In this case, the user is

Re: Format fields in list, but keep sortable?

2009-12-08 Thread Chris Lawlor
You could add a field to store the calculated size, and override the model's save method to perform the necessary calculation. Something like: def save(self, force_insert=False, force_update=False): self.size_formatted = self.width * self.height // or whatever your calculation actually is

Re: Forms ForeignKeyField does not populate with initial value

2009-12-08 Thread Michael
^ Thanks for that. Have been scratching my head for a while as .id is not a field/property for model.user, according to the doco I am reading anyway (http://docs.djangoproject.com/en/dev/topics/auth/ #topics-auth). I should have just tried .id in the first place : \ ... actually you'd think

Re: ManyToOne to auth.models.User

2009-12-08 Thread Itay Donenhirsch
oopsy, one to many from year to user is same as many to one from a user to a year. On Tue, Dec 8, 2009 at 1:57 PM, Itay Donenhirsch wrote: > hey there, > why not do one to many from each user to a year? same thing as many to > one from a year to a user... > itay > > > On Tue, Dec

Re: ManyToOne to auth.models.User

2009-12-08 Thread Itay Donenhirsch
hey there, why not do one to many from each user to a year? same thing as many to one from a year to a user... itay On Tue, Dec 8, 2009 at 1:51 PM, TiNo wrote: >> TiNo wrote: >> > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker >> > wrote: >> > >> >

Format fields in list, but keep sortable?

2009-12-08 Thread philomat
Hi, I keep numeric fields like "size", "width", "height" in my database. In the admin, I want to render them in a friendly format and attach units like "KiB" or "pixels" to them when showing them in the change list. I know this could easily be achieved by adding callables such as "size_formatted"

Styling widgets with django.forms

2009-12-08 Thread playfire
I am using django.forms for my forms and I want to style my tags using css. I know I can customize the form template, but how do i customize the widget itself? Normally I would do and then put the style in my css file but all I have is {{ form.fieldname }} to create the widget. -- You received

Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
> > TiNo wrote: > > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker < > den...@kaarsemaker.net>wrote: > > > > > >> On za, 2009-11-14 at 15:53 -0800, TiNo wrote: > >> > >> > >>> In my apps, Users of the app participate in a certain Year. I would > >>> like a Year to continue a ManyToOne

Re: admin app doesn't find template

2009-12-08 Thread bruno desthuilliers
On 8 déc, 01:47, Xbiton wrote: (snip) > unfortunately when I try to access the admin  interface I recive an > error saiying me that ther's no template for the apps, even I added > the template folder ti the TEMPLATE_DIRS. > > Now I wondering why, in the debug page

Re: Custom get/set from model

2009-12-08 Thread bruno desthuilliers
On 7 déc, 18:55, Waqqas Jabbar wrote: > I want that I could override get/set on a field of my model. I want to > redirect get/set > to another field of some other model. So what you want is not "a field of your model", it's to expose another field of another model as if

Re: How to change default template name for django.views.defaults.page_not_found ?

2009-12-08 Thread David De La Harpe Golden
mateusz.szulc wrote: >>From Django Part 3 tutorial: > "The 404 view is also called if Django doesn't find a match after > checking every regular expression in the URLconf." > > The 404 default view in django is defined as: > def page_not_found(request, template_name='404.html'): > > How can I

Re: Queryset filter on foreign key

2009-12-08 Thread Daniel Roseman
On Dec 8, 2:47 am, GoSantoni wrote: > Guys, i'm struggling with this problem for more than a week now. My > goal is to use a queryset filter with a foreign key. > Issues are > 1) column generates a list, what is the right way to get the blog id > for a post? So whether the

Re: CharField cannot have a "max_length" greater than 255 when using "unique=True"

2009-12-08 Thread bruno desthuilliers
On 7 déc, 23:46, germ wrote: > my platform: django 1.1.1, mysql 5.0.67, python 2.6.2 > > why does syncdb complain >  CharField cannot have a "max_length" greater than 255 when using > "unique=True" > > when mysql 5.0.67 does allow greater tan 255? is there a way to >

Re: Field in admin not editable but still visible

2009-12-08 Thread gentlestone
There are many posibilities: 1. Update the admin template for the app and model and include field variable into appropriate block 2. Update the form in admin and include the field with editable=false in widget properties 3. Update the view function and include a new value into template data On

djangp translates does not work

2009-12-08 Thread Sameer Rahmani
hi i use django internationalize documents to translate my project , but when i use that i just see that only some string are translated and font direction still is ltr , can any one help me to do it step by step? -- You received this message because you are subscribed to the Google Groups