Re: How to filter a manytomany tag

2008-06-14 Thread joshuajonah
resolved. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

Re: How to handle all DoesNotExist?

2008-06-14 Thread Ronny Haryanto
On Sun, Jun 15, 2008 at 1:40 AM, Szymon <[EMAIL PROTECTED]> wrote: > What I need to import to handle DoesNotExist in process_exception? > Because DoesNotExist is part of every single model, so I can't import > it from model, because I don't know which model raises exception. from django.db

How to filter a manytomany tag

2008-06-14 Thread joshuajonah
Ok, i have a model like this: class Tag(models.Model): tagname = models.SlugField() def __str__(self): return self.tagname class Admin: pass class Post(models.Model): title = models.CharField(max_length=200) slug =

ManyToManyField-- any way to have it editable inline from both sides?

2008-06-14 Thread Jason
Sorry if this has been addressed-- having trouble figuring out how to search for this issue. Basically, I'd like to be able to edit many-to-many relationships from both admin screen, so if "articles" has a mtm relationship w/"categories", I can see both which categories are attached to articles

Dreamweaver extension for Django templates

2008-06-14 Thread ydjango
http://store1.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail=en_us=1557518 I know most people in this list are direct html coders(ie. no wysiwyg) but still checking if anyone has tried this extension and their experience so far.

Error while importing URLconf 'mysite.urls': 'module' object has no attribute 'views'

2008-06-14 Thread Chris Haynes
This error goes away if I remove the line (r'^ptree/$', mysite.trees.views.parse_tree), from the urlpatterns. But I can import trees.views from the shell ~/dj/mysite 144: manage.py shell Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help",

Re: Date based URLconf condition not working

2008-06-14 Thread joshuajonah
On Jun 14, 8:51 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > joshuajonah wrote: > > Is this not impossible? > > > 404 error: > > Using the URLconf defined in jj.urls, Django tried these URL patterns, > > in this order: > > >1. ^admin/ > >2. ^blog/$ > >3. ^blog/(?Pd{4})/?$ > >

Re: Date based URLconf condition not working

2008-06-14 Thread Jeff Anderson
joshuajonah wrote: Is this not impossible? 404 error: Using the URLconf defined in jj.urls, Django tried these URL patterns, in this order: 1. ^admin/ 2. ^blog/$ 3. ^blog/(?Pd{4})/?$ Hello! Put a \ in front of the 'd'. Right now, you have a regex that only matches: ^blog//

Date based URLconf condition not working

2008-06-14 Thread joshuajonah
Is this not impossible? 404 error: Using the URLconf defined in jj.urls, Django tried these URL patterns, in this order: 1. ^admin/ 2. ^blog/$ 3. ^blog/(?Pd{4})/?$ 4. ^$ 5. ^(?P\w+)/$ The current URL, blog/2008/, didn't match any of these.

Re: Form Validation for GET Request

2008-06-14 Thread [EMAIL PROTECTED]
I always use if(len(request.GET)>0): form=TestForm(request.GET) if(form.is_valid()): #process form else: form=Testform() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Session lost between two requests from the test client

2008-06-14 Thread ksachdeva
I did not have settings like this but re-organizing my project, installing django again, deleting and creating the database made the issue disappear. This implies that it must be my fault. Thanks for all the help and time you guys spent on my problem. I am very sure that I am going to enjoy the

Re: Value Error after update to latest Django

2008-06-14 Thread Steve Potter
> > Searching here: > > http://code.djangoproject.com/search > > for date_heirarchy brings up an open ticket: > > http://code.djangoproject.com/ticket/7199 > > So looks like someone else has hit this and reported it already. The report > includes some analysis of where the error is occurring

Re: DjangoAMF vs. pyAMF - any opinions?

2008-06-14 Thread Ederson Mota Pereira
Hi Cristopher, Thanks for you feedback. I'm working only with PyAMF now. My example application is working fine with Flex 3 and exposed methods in django side, but I'm having problem with class mapping of the Django models. (More specifically, in the Flex side: TypeError: Error #1034: Type

How to set SESSION_COOKIE_DOMAIN for multiple Domain Names

2008-06-14 Thread Siah
Hi, My django app must serve multiple domain names. I also have a need to have my session available on my domain and subdomains. So, reading up on Django docs, I realized I have to do this: SESSION_COOKIE_DOMAIN = '.mysite.com' So, my question is: How do I have my sub-domains share the same

Re: Multi-Table Saving Duplicates in Admin?

2008-06-14 Thread Karen Tracey
On Sat, Jun 14, 2008 at 5:33 PM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > Thanks! > > Any idea if this issue appears outside of the admin interface with > newforms in a regular view? This isn't a show-stopper if that's a > case, just a speed bump. > I have no idea. I've not had occasion to

Re: Multi-Table Saving Duplicates in Admin?

2008-06-14 Thread Greg Taylor
Thanks! Any idea if this issue appears outside of the admin interface with newforms in a regular view? This isn't a show-stopper if that's a case, just a speed bump. Thanks again, Greg On Jun 14, 2:43 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Jun 14, 2008 at 2:30 PM, Greg Taylor

Re: Model - Only allow One

2008-06-14 Thread Andrew Ingram
bruno desthuilliers wrote: > Anyway, why would you want such a thing ? I can think of one possible use, when you want some project settings to be configurable at run-time through the admin interface. At the moment I would probably relate a settings model to the site model, but I think the site

Re: Value Error after update to latest Django

2008-06-14 Thread Karen Tracey
On Sat, Jun 14, 2008 at 4:50 PM, Steve Potter <[EMAIL PROTECTED]> wrote: > On Jun 13, 7:47 pm, Steve Potter <[EMAIL PROTECTED]> wrote: > > I just updated the the latest version of Django and I started getting > > the following error in the admin interface: > > > > Caught an exception while

Re: Value Error after update to latest Django

2008-06-14 Thread Steve Potter
On Jun 13, 7:47 pm, Steve Potter <[EMAIL PROTECTED]> wrote: > I just updated the the latest version of Django and I started getting > the following error in the admin interface: > > Caught an exception while rendering: invalid literal for int() with > base 10: 'None' > > It seems to be the

Re: URLconf and style.css

2008-06-14 Thread Karen Tracey
On Sat, Jun 14, 2008 at 2:41 PM, LB <[EMAIL PROTECTED]> wrote: > >Hi, > > I've just finished my first template, it seems to work finie, but is > not properly displayed. > Indeed, the stylesheet seems not to be transmitted to firefox. > > When I look at the output of django web server, I can

Re: Multi-Table Saving Duplicates in Admin?

2008-06-14 Thread Karen Tracey
On Sat, Jun 14, 2008 at 2:30 PM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > Hello all, > > I'm running Django trunk, and have noticed that editing and saving an > object in the admin interface (an object that is a multi-table child > model) results in a duplicate object with the new attributes >

URLconf and style.css

2008-06-14 Thread LB
Hi, I've just finished my first template, it seems to work finie, but is not properly displayed. Indeed, the stylesheet seems not to be transmitted to firefox. When I look at the output of django web server, I can see this message : [14/Jun/2008 19:05:45] "GET /actu HTTP/1.1" 200 3158

Re: Model - Only allow One

2008-06-14 Thread bruno desthuilliers
On 14 juin, 15:53, ocgstyles <[EMAIL PROTECTED]> wrote: > Is there a way create a restriction that will only allow one instance > of a model? The closest you could get would be to define a model with a unique not editable field and override the save method to make this field a constant value.

How to handle all DoesNotExist?

2008-06-14 Thread Szymon
Hello, What I need to import to handle DoesNotExist in process_exception? Because DoesNotExist is part of every single model, so I can't import it from model, because I don't know which model raises exception. --~--~-~--~~~---~--~~ You received this message

Latest comments

2008-06-14 Thread veearrsix
Hi, I'm trying to list latest comments using the comments contrib in my django app, I would like to list both comments from users who are staff ('is_staff' in the auth_user table), and comments from users who are NOT staff members. My question is, how do I create 2 lists, 1 with the comments

Re: Filter based on empty date field

2008-06-14 Thread robbie
Thank you! Works perfectly! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Multi-Table Saving Duplicates in Admin?

2008-06-14 Thread Greg Taylor
Hello all, I'm running Django trunk, and have noticed that editing and saving an object in the admin interface (an object that is a multi-table child model) results in a duplicate object with the new attributes appearing. It should just set your new values on the existing object rather than

Re: Filter based on empty date field

2008-06-14 Thread Bartek Gniado
You could use the isnull filter: http://www.djangoproject.com/documentation/db-api/#isnull If your model is setup correctly, that'll do the trick On Sat, Jun 14, 2008 at 2:03 PM, robbie <[EMAIL PROTECTED]> wrote: > > Hi! > > I'd like to know if there is any way you can filter a data-set based

Filter based on empty date field

2008-06-14 Thread robbie
Hi! I'd like to know if there is any way you can filter a data-set based on an empty DateTimeField? Let's say I have a Message model with a DateTimeField named read; what I would like to do is to list all messages with an empty (null) read field. This is probably very easy, but I'm new to both

Re: DjangoAMF vs. pyAMF - any opinions?

2008-06-14 Thread Krzysztof Ciesielski
On 5/3/08, J Peyret <[EMAIL PROTECTED]> wrote: > > I am just starting out with Flex 3 and I'd like to know if anybody's > got any strong opinions on which AMF<=>Python bridge is best for using > AMF to talk to Django. > > I do know Python and am somewhat familiar with Django. > > Things that

Re: Timezone conversion

2008-06-14 Thread Rob Hudson
Check out the source of Brian Rosner's project here: http://code.google.com/p/django-timezones/ -Rob On Jun 13, 1:07 am, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi Guys, > > I want to convert a datetime field for an entry in my database to a > specified timezone. Here is the code I have so far:

Re: Django HTML Editor

2008-06-14 Thread mario
Hi, Have you tried using TinyMCE. It works and is compatible with Django Templates including bundled templates such as flatpages, etc. The URL is http://tinymce.moxiecode.com/?id=powered_by_tinymce_mini. Also check out Bill De Hora web site,

Re: Filtering a query based on potential arguments

2008-06-14 Thread Bartek Gniado
Thanks Tim for the code optimization ideas. Very pythonic of you ;) On Sat, Jun 14, 2008 at 10:55 AM, Tim Chase <[EMAIL PROTECTED]> wrote: > > >> cards = Card.objects.all() > >> if request.POST.get('brand') : > >> cards = cards.filter(brand = request.POST.get('brand')) > >> if

Re: Filtering a query based on potential arguments

2008-06-14 Thread Tim Chase
>> cards = Card.objects.all() >> if request.POST.get('brand') : >> cards = cards.filter(brand = request.POST.get('brand')) >> if request.POST.get('year') : >> cards = cards.filter(year = request.POST.get('year')) > > Scott: Very cool, didn't know that was possible. I'm sure this > does not

Re: Filtering a query based on potential arguments

2008-06-14 Thread Bartek Gniado
Scott: Very cool, didn't know that was possible. I'm sure this does not hurt performance much compared to the other method shown above? Needless to say it works great! Thanks much On Thu, Jun 12, 2008 at 5:58 AM, Scott Moonen <[EMAIL PROTECTED]> wrote: > You can take advantage of the fact that

Re: OneToOneField

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 5:08 AM, Juanjo Conti <[EMAIL PROTECTED]> wrote: > > Is that last note the change mentioned in the first note? Is the first > note out of date? > > I'd like to use OneToOneField, but I'am note sure because of the first note. The second note is correct - OneToOneFields

Re: Django HTML Editor

2008-06-14 Thread Peter Melvyn
> I want a free HTML editor that is compatible with Django template's > syntax. I just want to edit my Django power application's HTML faster. > When I say compatible, I mean that the editor shouldn't screw up all > the Django template's tags and variables. If you are on Windows, you can try

Model - Only allow One

2008-06-14 Thread ocgstyles
Is there a way create a restriction that will only allow one instance of a model? For example, if I have a model called Zebra, is there a way I can have the Admin interface only allow one Zebra? (In other words, the Add Zebra link will not be visible in the Admin interface. Keith

Re: Django HTML Editor

2008-06-14 Thread oliver
Hi, I can really recommend e-editor (text mate clone for windows), uses the same textmate bundles so it knows django and django html. light weight and quick and good support. http://www.e-texteditor.com/ On Jun 14, 7:36 am, Ngu Soon Hui <[EMAIL PROTECTED]> wrote: > Forgot to mention, it would

Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 8:26 PM, LB <[EMAIL PROTECTED]> wrote: > > Thanks for the fast replies ! No problems. > So I think I only have three options now : > > 1) change my model and replace the naissance field with three fields > corresponding to birth day, birth month and birth year. This is

Re: Basic database API questions

2008-06-14 Thread LB
Thanks for the fast replies ! > So - what you were trying to do was combine the `month` and `gt` > operators - you can't do that. Django interpreted your query as 'join > the Contact with the naissance table, and check that the month > attribute is greater than 5'. Obviously, this doens't work

Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 7:36 PM, LB <[EMAIL PROTECTED]> wrote: > > Thanks, > > Another question : > > why does > anniv = Contact.objects.filter(naissance__month=5) > works > > and > anniv = Contact.objects.filter(naissance__month__gt=5) > raise this exception : > : Join on field 'naissance' > not

Re: Django HTML Editor

2008-06-14 Thread Oscar Carlsson
I would go for Textmate (haven't tried E tho) even if it costs some money - it's a superb text editor! There are a few plugins for VIM that are very useful (especially http://tinyurl.com/cm4nm) for this kind of editing, but Textmate is a lot better. Oscar On Sat, Jun 14, 2008 at 1:19 PM,

Re: Basic database API questions

2008-06-14 Thread LB
Thanks, Another question : why does anniv = Contact.objects.filter(naissance__month=5) works and anniv = Contact.objects.filter(naissance__month__gt=5) raise this exception : : Join on field 'naissance' not permitted. --~--~-~--~~~---~--~~ You received this

Re: Django HTML Editor

2008-06-14 Thread Bradley Wright
On Jun 14, 7:06 am, Ngu Soon Hui <[EMAIL PROTECTED]> wrote: > I want a free HTML editor that is compatible with Django template's > syntax. I just want to edit my Django power application's HTML faster. > When I say compatible, I mean that the editor shouldn't screw up all > the Django template's

Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 6:56 PM, LB <[EMAIL PROTECTED]> wrote: > > 1 ) how to get all contacts with a known birthday ? I tried : > > m = Contact.objects.filter(naissance__is_null=False) > but I got the following exception : > : Join on field 'naissance' > not permitted. You are close - but with

Basic database API questions

2008-06-14 Thread LB
Hi, I'm new to django and also new to databases. I'm trying to make a simple contact editor. So I created the following model : class Contact(models.Model): nom_famille = models.CharField("nom de famille", max_length=30) # french for last name prenom =

Re: Django HTML Editor

2008-06-14 Thread Andre Meyer
Hi You might wanna take a look at Komodo Edit.It supports Django templates. It's not WYSIWYG, though. cheers André On Sat, Jun 14, 2008 at 8:36 AM, Ngu Soon Hui <[EMAIL PROTECTED]> wrote: > > Forgot to mention, it would be

Re: django-registration with my custom user profile

2008-06-14 Thread Chr1s
any help:? On Jun 13, 6:02 pm, Chr1s <[EMAIL PROTECTED]> wrote: > Hi thanks for your replay, > It is the second situation, I re-write the form.py like this > > class RegistrationForm(forms.Form): >   (other stuff  ) > def save(self, profile_callback=None): > >         new_user = >

Re: Django HTML Editor

2008-06-14 Thread Ngu Soon Hui
Forgot to mention, it would be definitely helpful if there is a WYSIWYG editor available. Thanks On Jun 14, 2:06 pm, Ngu Soon Hui <[EMAIL PROTECTED]> wrote: > I want a free HTML editor that is compatible with Django template's > syntax. I just want to edit my Django power application's HTML