Re: null=True conditionally

2006-05-17 Thread Malcolm Tredinnick
On Thu, 2006-05-18 at 04:51 +, qhfgva wrote: > Class Foo(Model): > blah = CharField(maxlength=20) > bar = ForeignKey(Qwerty) # requred field > baz = CharField(maxlength=20, null=False) > > In the above class I'd like to make baz a required field if bar is of a > certain value

null=True conditionally

2006-05-17 Thread qhfgva
Class Foo(Model): blah = CharField(maxlength=20) bar = ForeignKey(Qwerty) # requred field baz = CharField(maxlength=20, null=False) In the above class I'd like to make baz a required field if bar is of a certain value otherwise it can be blank. If there a way to accomplish this?

Re: Many to Many challenges

2006-05-17 Thread Chris Moffitt
> > Anyway, let us know if you find something and I'll keep this turning > over in the back of my mind. > > The problem seems to lie in the find_field function as called from lookup_inner in query.py. When I throw in some print statements it looks like it's doing a find_field for article

RE: Help please with get_absolute_url in admin and public pages

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 20:39 -0500, tsnyder wrote: > Along these lines, when I click on the "view on site" link, the server name > is > magically changed from 127.0.0.1:8000 to something that I must have typed in > somewhere (I can't find it, though). Can anyone point me in the right >

RE: Help please with get_absolute_url in admin and public pages

2006-05-17 Thread tsnyder
Along these lines, when I click on the "view on site" link, the server name is magically changed from 127.0.0.1:8000 to something that I must have typed in somewhere (I can't find it, though). Can anyone point me in the right direction - how can I get the correct server name to show up in the

Re: Error in model while trying to model a parent/child relation.

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 23:50 +0200, Frédéric Roland wrote: > Hello, > I'm both new to Python and to Django. > > I'm using Django from subversion (after magic removal has been merged in > trunk). > > When doing python manage.py install Manager I get the following error: > > NameError: name

Re: Best way to do a dynamic sidebar?

2006-05-17 Thread Don Arbow
On May 17, 2006, at 5:17 PM, Jay Parlar wrote: > > I'm not seeing 'inclusion_tag' in the docs anywhere, is it meant to be > a public API function? inclusion_tag is defined in django/template/__init__.py and is explained here http://code.djangoproject.com/ticket/625 Don

Re: Record is show in admin, not in view (0.95) Failure in inheriterance?

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 20:12 +, [EMAIL PROTECTED] wrote: > class Blog(BaseContent): > > def get_absolute_url(self): > return "/diario/%s/" % self.userId > > class Admin: > pass > > class Meta: > verbose_name= 'diario' > db_table=

Re: Tagging things

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 12:56 -0700, [EMAIL PROTECTED] wrote: > Hi list, > > I'm new to Django, but I've been writing web applications for years in > Perl and PHP. A popular feature these days, are of course tagging > things. > > Tagging things is easy. You have a relational table, containing

Re: Django and static files URLs

2006-05-17 Thread Malcolm Tredinnick
Hi, On Wed, 2006-05-17 at 18:10 +0200, [EMAIL PROTECTED] wrote: > Hi, > > My templates refer to CSS and images with absolute URL. I > cannot serve them with relative URLs, like I used to do in PHP > with: > > (or can I? If so please let me know). Sure you can; creating the ultimate URL that

Re: Best way to do a dynamic sidebar?

2006-05-17 Thread Jay Parlar
On 5/17/06, Adam <[EMAIL PROTECTED]> wrote: > > > It feels like I should be able to define a template just for the > > sidebar, and insert the content of that template into whatever > > template is being rendered. > > The way I look at it, that's pretty much what you're doing if you write > a

Re: Help please with get_absolute_url in admin and public pages

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 16:47 -0500, James Bennett wrote: > On 5/17/06, Paul Childs <[EMAIL PROTECTED]> wrote: > > I'm still looking for the answer to question 2. Any help would be > > appreciated. > > This is something that really desperately needs to be documented > somewhere obvious or, even

Re: Having problems with inspectdb / introspection

2006-05-17 Thread Adrian Holovaty
On 5/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm not sure why "year is out of range" is a problem - maybe because > the table has TIMESTAMP column types? Here is the SHOW CREATE TABLE > for the registrant table: > > CREATE TABLE `registrant` ( > `seminar_id` int(11) NOT NULL

Re: authentication style select box

2006-05-17 Thread Sean
Thanks for your reply, but I meant a similar interface for a one-to-one or many-to-one (not the one-to-many I mentioned before, that was nonsense), with only one select box shown. The select list is a little unhandy when searching through 200 entries. Is that possible? Wilson Miner wrote: >

Error in model while trying to model a parent/child relation.

2006-05-17 Thread Frédéric Roland
Hello, I'm both new to Python and to Django. I'm using Django from subversion (after magic removal has been merged in trunk). When doing python manage.py install Manager I get the following error: NameError: name 'Reference_Data_Value' is not defined here is my code: class

Re: Help please with get_absolute_url in admin and public pages

2006-05-17 Thread James Bennett
On 5/17/06, Paul Childs <[EMAIL PROTECTED]> wrote: > I'm still looking for the answer to question 2. Any help would be > appreciated. This is something that really desperately needs to be documented somewhere obvious or, even better, commented out in the default urls.py like the admin URLConf

Re: Having problems with inspectdb / introspection

2006-05-17 Thread josh
Great idea - forgot about that MySQL "gotcha" - but I checked and none of the dates in the TIMESTAMP column are invalid - they are all starting with 2005 or 2006. That is the only field in a date/time format so I'm still not sure what's going on. Thanks for your help, Josh

Re: Tagging things

2006-05-17 Thread [EMAIL PROTECTED]
Ian, Thanks for your quick reply. You have indeed implemented what I'm looking for, unfortunately, it is not as ellegant as I hoped for (no offense!). I'm perhaps mistaken, but it seems like you're brute-checking per-entry if all the tags exists. What I'd love to do is simply apply a .filter()

Re: .95 (2933) WSGI handler does not set request.user

2006-05-17 Thread [EMAIL PROTECTED]
ok that was the problem i had 0.91 installed via setuptools and although placing a symlink inside site-packages to point to trunk/django works as expected with the command python manage.py (displays version 0.95) for the standalone script django-admin.py it still points to the old script. and i

Re: Having problems with inspectdb / introspection

2006-05-17 Thread pbx
> ValueError: year is out of range > > I'm not sure why "year is out of range" is a problem - maybe because > the table has TIMESTAMP column types? It's probably because you have invalid data (like -00-00) in those columns. I encountered this on some of my legacy MySQL tables. In my case I

Re: Help please with get_absolute_url in admin and public pages

2006-05-17 Thread Paul Childs
OK, I was able to find the documentation on serving media files. I thought Django might have some automagic way of doing it so I really didn't clue into what my real problem was. I'm still looking for the answer to question 2. Any help would be appreciated. Thanks

Having problems with inspectdb / introspection

2006-05-17 Thread josh
I am new to Django and hoping to use it to replace a spider-web of php code I wrote for a registration system. I have some tables in a MySQL database so I thought I'd try to see if Django could inspect it. After updating settings.py I ran: > env

Record is show in admin, not in view (0.95) Failure in inheriterance?

2006-05-17 Thread [EMAIL PROTECTED]
Hi, I'm generating some test data for my models. I have Country, States and Citys, this are descending from models.Model. Example: class Country(models.Model): name= models.CharField('nombre',maxlength=50,blank=False,db_index=True,unique=True) language=

Tagging things

2006-05-17 Thread [EMAIL PROTECTED]
Hi list, I'm new to Django, but I've been writing web applications for years in Perl and PHP. A popular feature these days, are of course tagging things. Tagging things is easy. You have a relational table, containing your entry ID and a tag associated with it. This could easily be done with a

Re: Problems with list_filter

2006-05-17 Thread Guillermo Fernandez Castellanos
> > My problem is that 'department' in list_display works just great, > > while in list_filter in makes an error: > > Request Method: GET > > Request URL: http://127.0.0.1:8000/admin/unitmanager/unit/ > > Exception Type: FieldDoesNotExist > > Exception Value: name=branch > >

Re: Best way to do a dynamic sidebar?

2006-05-17 Thread Adam
> It feels like I should be able to define a template just for the > sidebar, and insert the content of that template into whatever > template is being rendered. The way I look at it, that's pretty much what you're doing if you write a custom inclusion tag: -- custom tag file --

Re: Django and static files URLs

2006-05-17 Thread Phil Powell
Surely you don't need to have the entire absolute URL - an sbsolute URL can be defined by just ensuring a preceeding forward slash appears in your paths - for example: should change to: This will cause the resource to be referenced from the root of your domain. Alternatively, you can use a

Django and static files URLs

2006-05-17 Thread [EMAIL PROTECTED]
Hi, My templates refer to CSS and images with absolute URL. I cannot serve them with relative URLs, like I used to do in PHP with: (or can I? If so please let me know). This is fine until the moment I put my work on production server, where I need to update all static URLs (from

Trying to use ado_mssql on MR to no success

2006-05-17 Thread reiale
It looks like introspection.py doesn't have any logic for get_table_list, etc. I can't do a basic manage.py install Can someone point me in the right direction? I'm running fine on sqllite but want to use mssql on windows. Thanks! --~--~-~--~~~---~--~~ You

Re: authentication style select box

2006-05-17 Thread Wilson Miner
Sean, You're looking for the filter_interface argument for the ManyToManyField: http://www.djangoproject.com/documentation/model_api/#many-to-many-relationships On 5/17/06, Sean <[EMAIL PROTECTED]> wrote: > > Hi, > I was wondering if the searchable select box as used in the add user > interface

Re: There is no v0.92 or v0.95 release of Django

2006-05-17 Thread coulix
i agree, its not clear at all. Documentation shows 0.95, but no 0.95 on the link. I have been using django long enough to guess i shoud take the svn trunk version but not everyone can do this. A solultin could be to put the doc 0.91 as main doc and the rest ad link on the top of the page (0.92

Help please with get_absolute_url in admin and public pages

2006-05-17 Thread Paul Childs
I am new to Django and so far have found it amazing. I have two simple questions based on the following models which I am running using the development server that comes with Django 0.91: #- class RepairType(meta.Model):

authentication style select box

2006-05-17 Thread Sean
Hi, I was wondering if the searchable select box as used in the add user interface (for selecting permissions) on the admin site is available for other fields, like in a one-to-many relationship with many entries (>200). I saw the ajax widget which was posted here some time ago but I really don't

Re: Using existing database shema

2006-05-17 Thread Michael Radziej
Hey Filipe, Filipe wrote: > Custom SQL + Manipulators does sound as the way to use my own model > classes. It doesn't seem as the most straightforward way to use Django > though, anyone out there actually working with Django this way? > > Michael, are you actually using Django (ORM included)

Re: Using existing database shema

2006-05-17 Thread Filipe
> Filipe, what kinds of tables use composite primary keys for you? > [ ] association tables for many-to-many relations > [ ] dependent tables > [ ] "inheritence" look-alikes The first two, "association tables for many-to-many relations" and "dependent tables". Inheritance look-alikes also

Re: Database table not found by extra lookup

2006-05-17 Thread olive
Thank you very much Malcom. Olive. --~--~-~--~~~---~--~~ 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

Re: Problems with list_filter

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 14:45 +0200, Guillermo Fernandez Castellanos wrote: > Hi, > > I'm very new to Django, and I'm a bit overhelmed with doc, so I might > have missed something. Thanks for redirecting me then :-) > > I've this model (simplified): > > class Department(models.Model): > name

Re: ManyToManyField reverse lookup not working

2006-05-17 Thread Jeff Forcier
Yea, oftentimes strange behavior is caused by stale .pyc/o files, so a good troubleshooting tactic (that I myself often overlook, unfortunately -_-) is to always blow away all such files in your project and then restart whatever server you're using. Note that there should never, to my knowledge,

Problems with list_filter

2006-05-17 Thread Guillermo Fernandez Castellanos
Hi, I'm very new to Django, and I'm a bit overhelmed with doc, so I might have missed something. Thanks for redirecting me then :-) I've this model (simplified): class Department(models.Model): name = models.CharField(maxlength=10,primary_key=True) class Admin: pass class

Re: There is no v0.92 or v0.95 release of Django

2006-05-17 Thread DavidA
I just googled: django 0.95 site:www.djangoproject.com and found one other thing that could be potentially confusing: http://www.djangoproject.com/documentation/tutorial1/ The sample output under "The development server" section shows: Django version 0.95 (post-magic-removal). Of course, that

Re: Trouble resolving URLs

2006-05-17 Thread Michael Radziej
Hi Simon! Simon Johnston wrote: > I have followed the tutorials in setting up a basic index and detail > page for one of my model classes. I created the project level urls.py > as follows: > > from django.conf.urls.defaults import * > urlpatterns = patterns('', > (r'^accounts/$',

Re: Trouble resolving URLs

2006-05-17 Thread Ivan Sagalaev
Simon Johnston wrote: >from django.conf.urls.defaults import * >urlpatterns = patterns('', >(r'^accounts/$', include('RealLife.crm.urls')), > > "$" is what breaks your URL. >Using the URLconf defined in RealLife.urls, Django tried these URL >patterns, in this order: > 1. ^accounts/$ >

Trouble resolving URLs

2006-05-17 Thread Simon Johnston
I have followed the tutorials in setting up a basic index and detail page for one of my model classes. I created the project level urls.py as follows: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^accounts/$', include('RealLife.crm.urls')), (r'^admin/',

Re: Admin stopped working for my model

2006-05-17 Thread [EMAIL PROTECTED]
I eventually found the error, an incorrect name in the admin list_display tuple, not such a friendly error message :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

.95 (2933) WSGI handler does not set request.user

2006-05-17 Thread [EMAIL PROTECTED]
Hi, I am trying the lastest .95 django but it fails when calling the admin interface with the message: WSGIRequest' object has no attribute 'user' it has an attribute USER though looking at the code in core/handlers/wsgi.py and comparing with the .91 it looks like a bunch of code related to

DateField without js in admin interface

2006-05-17 Thread Mayer Gerhard
Title: DateField without js in admin interface Hello, is there an option to omit the _javascript_ widget for DateField (DateTimeField) in the admin interrface? Gerhard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Database table not found by extra lookup

2006-05-17 Thread Malcolm Tredinnick
On Wed, 2006-05-17 at 00:07 -0700, olive wrote: > Hello, > > First of all, my model: > > class Application(models.Model): > name = > models.CharField(_('name'),maxlength=200,unique=True) > > class Screenshot(models.Model): > application = >

Re: Queryset depending on related objects existenz

2006-05-17 Thread olive
For now I am going to use: context["app"] = [app for app in Application.objects.all() if app.docchunk_set.count() == 0] Is it really the ony solution for that problem ? Olive. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the