Re: urls question

2008-07-04 Thread [EMAIL PROTECTED]
Look up how to do an or using python regexs. http://docs.python.org/lib/re-syntax.html On Jul 5, 12:46 am, Luis Sanchez <[EMAIL PROTECTED]> wrote: > Hi, > > I want to do this: > > www.domain.com/part1/ > > if part1 is :  someword1 , someword2 or someword3   go to the view: > view1 > if part1 is

urls question

2008-07-04 Thread Luis Sanchez
Hi, I want to do this: www.domain.com/part1/ if part1 is : someword1 , someword2 or someword3 go to the view: view1 if part1 is : someword6 , someword7 or someword9 go to the view: view2 How can I do that using urls.py ?? --~--~-~--~~~---~--~~ You receive

Re: Another error

2008-07-04 Thread Leaf
I really need to stop making assumptions about Python. Again, I assumed that the parameters wouldn't be case-sensitive. Most of my programming experience has been in BASIC and PHP, which aren't quite as picky. Thanks for all your help. Regards, Leaf On Jul 4, 10:56 pm, Malcolm Tredinnick <[EMAIL

Re: Another error

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 19:53 -0700, Leaf wrote: [...] > I'm not sure why maxlength.py was invoked at all, since as you can > clearly see I used the newer max_length version. At any rate, it seems > like I need help again. Can anyone explain what this error is, why it > got called, and how to fix i

Another error

2008-07-04 Thread Leaf
After fixing the Style model in Dj Style by replacing all the hyphens with underscores, the syntax checked out completely. I ran manage.py syncdb on it, and it returned this traceback: Traceback (most recent call last): File "C:\django-project\firstsite\manage.py", line 11, in execute_mana

File Browser and Editor with Django,any help?

2008-07-04 Thread Darren Lee
Hi,all I am new to this community. these days My leader give me a mission ,describe as below: the httpd server was installed under a linux server ,and the it use Django tech. I should add the web server with a funtion like Windows Explorer and Editor in the WebBrowser like firefox. any o

Re: Syntax error: "can't assign to operator"

2008-07-04 Thread Leaf
Okay. I'll run a quick find-and-replace to set all my identifiers to use underscores instead of hyphens. I'm not that familiar with Python, so I assumed that it would recognize hyphens as a seperator and not a minus sign. Regards, Leaf On Jul 4, 10:27 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> w

Re: Syntax error: "can't assign to operator"

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 19:24 -0700, Leaf wrote: > I'm still working on the models.py for Dj Styles. I'm trying to create > a "Style" class, and the part of my code in question looks something > like this: > > class Style(models.Model): > Style-Name = models.CharField("Style Name", Max_length

Syntax error: "can't assign to operator"

2008-07-04 Thread Leaf
I'm still working on the models.py for Dj Styles. I'm trying to create a "Style" class, and the part of my code in question looks something like this: class Style(models.Model): Style-Name = models.CharField("Style Name", Max_length = 32, Default = "Styles Upon Styles", Help_text = "A user-fr

Re: Copyright issues for an application developed using django, python and mySQL

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 19:03 -0700, Nagu wrote: > Thank you very much for your explanations. From the above > explanations, I can infer that I do not have to worry about any > copyright or licensing issues. Please correct me if I am wrong. Well, you have to respect them and know what the valid li

Re: Copyright issues for an application developed using django, python and mySQL

2008-07-04 Thread Nagu
Thank you very much for your explanations. From the above explanations, I can infer that I do not have to worry about any copyright or licensing issues. Please correct me if I am wrong. A little context may help here. Our company is a reseller. We sell computer products. I make mathematical model

Re: Defaults with "choices"

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 18:28 -0700, Leaf wrote: > I'm working on an app called Dj Styles. It generates stylesheets > dynamically. Anyway, I'm laying out the Style model, and I need to > know: If you're using the "choices" parameter on a CharField, then > which do you put for the "default" paramete

Defaults with "choices"

2008-07-04 Thread Leaf
I'm working on an app called Dj Styles. It generates stylesheets dynamically. Anyway, I'm laying out the Style model, and I need to know: If you're using the "choices" parameter on a CharField, then which do you put for the "default" parameter - the value that gets recorded to the database or the

Re: DateTimeField 12-hour input form. Easy way?

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 14:17 -0700, mw wrote: > Hello, > > I get the feeling that this isn't the easiest thing to accomplish > given the different posts about it on the list, the lack of response > to questions around in in IRC, and etc, though it strikes me as > something that should be easy to

Re: Help with templatetags

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 08:44 -0700, [EMAIL PROTECTED] wrote: > i setup a custom template tag for my index page called recent_news. > > i tried to setup a second template tag for the page called > more_news.py. the first is working as recent_news.py. > > recent_news.py gets the more recent entry,

Re: Dynamic models keyError

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 09:28 -0700, mwebs wrote: > Hello, > > I am trying to generate models at runtime. For this purpose I am using > the method create_model() provided at > http://code.djangoproject.com/wiki/DynamicModels > > create_model(name, fields, module='app.models' ) > > When I am doin

Re: syncdb

2008-07-04 Thread [EMAIL PROTECTED]
Thanks a lot!! I am used to rails. Hopefully django will have some sort of db migrate ability in the future. On Jul 4, 5:02 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Jul 4, 2008 at 7:37 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have a new user question. I am working

Re: "Eval" in templates?

2008-07-04 Thread [EMAIL PROTECTED]
I don't think it would be difficult to implement, either as a block tag, or as a regular tag with context. On Jul 4, 7:29 pm, Ben Kovitz <[EMAIL PROTECTED]> wrote: > Is there an easy way in Django to do the following? > > In blah.html: > >    {{ buttonDecidedAtRunTime }} blah blah blah > > In the

"Eval" in templates?

2008-07-04 Thread Ben Kovitz
Is there an easy way in Django to do the following? In blah.html: {{ buttonDecidedAtRunTime }} blah blah blah In the Context passed to blah.html at run-time: buttonDecidedAtRunTime: '{% include "button4.html %}' thisPage: "/some/path" Naturally, the included template might be butt

Re: Editing content in Django Admin change-list

2008-07-04 Thread Itai Tavor
On 03/07/2008, at 11:23 AM, David Melton wrote: > > I would like to be able to change the status of an item (Yes/No Field) > in a list of items from the change-list view without having to open > the item and change it within the change form. Is there an easy way > (built in) to the Django admin f

Re: MySQL Errors Using syncdb

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 6:01 PM, Arif <[EMAIL PROTECTED]> wrote: > > Hi, > > I hope someone can shed some light on this as I have been trying to > get Django to work for hours and hours. > > If I run a Django site that does not have a database connection the > localserver starts correctly, however

Re: syncdb

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 7:37 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a new user question. I am working on a sight using the .96 > version of django. I created a model with fields and ran "python > manage.py syncdb", which worked fine. After doing some work I > realized I needed

Re: Type error: Cannot resolve keyword 'name' into field

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 6:02 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm having troubles with an admin portion. I am brand new at django, > so any help would be greatly appreciated. I am trying to make a class > of family members. > > This works correctly when I use the admin to add ne

syncdb

2008-07-04 Thread [EMAIL PROTECTED]
I have a new user question. I am working on a sight using the .96 version of django. I created a model with fields and ran "python manage.py syncdb", which worked fine. After doing some work I realized I needed to add a new field to one of the models. How do I tell django to re-sync the db? I

Re: Determining Multi-Table Child Type

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 6:52 PM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > So I've got a Multi-Table parent model, CalendarEvent, and two child > models: Regatta and Meeting. > > I've got a calendar view that shows all of the upcoming events like > this: > events = CalendarEvent.objects.all() > >

Re: Include django views in other web sites

2008-07-04 Thread Alessandro Ronchi
2008/7/4, Alaa Salman <[EMAIL PROTECTED]>: > If i understand you correctly, what you need is just AJAX. Just have > your views produce xml or json or perhaps even html snippets. And use > any javascript suite to call this view and then insert the data into > your page. I prefer spitting out dat

Determining Multi-Table Child Type

2008-07-04 Thread Greg Taylor
So I've got a Multi-Table parent model, CalendarEvent, and two child models: Regatta and Meeting. I've got a calendar view that shows all of the upcoming events like this: events = CalendarEvent.objects.all() But I want to determine what kind of event each of these are (Regatta or Meeting) from

MySQL Errors Using syncdb

2008-07-04 Thread Arif
Hi, I hope someone can shed some light on this as I have been trying to get Django to work for hours and hours. If I run a Django site that does not have a database connection the localserver starts correctly, however if I run a site that requires a database connection I get the following error

Type error: Cannot resolve keyword 'name' into field

2008-07-04 Thread [EMAIL PROTECTED]
I'm having troubles with an admin portion. I am brand new at django, so any help would be greatly appreciated. I am trying to make a class of family members. This works correctly when I use the admin to add new names to it. But when I try to change an element I get this error: TypeError at /admin

Re: Simple object creation in postgresql with django views code...

2008-07-04 Thread Daniel Roseman
On Jul 4, 5:00 pm, RossGK <[EMAIL PROTECTED]> wrote: > I'm trying to do a bit of simple Django access to a postgresql > database, and must be missing something. Using the tutorial info, I've > had mixed success. I can pull a bit of stuff form the database, but > have some curious behaviour that

DateTimeField 12-hour input form. Easy way?

2008-07-04 Thread mw
Hello, I get the feeling that this isn't the easiest thing to accomplish given the different posts about it on the list, the lack of response to questions around in in IRC, and etc, though it strikes me as something that should be easy to do I want to switch the DateTimeField to having a 12-hr c

Re: streaming upload

2008-07-04 Thread umrzyk
On 29 Cze, 22:15, umrzyk <[EMAIL PROTECTED]> wrote: > hi there, > i would like to give my users ability to upload a huge (i.e. 10-20 MB) > files, mostly images. standard uploading using django newforms and > FileField is at the moment not an option. it kills my > server immediately. recently i rea

Re: Displaying Child Records in a list of the Parent Records

2008-07-04 Thread Lee Hinde
On Jul 3, 2:49 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Jul 3, 7:43 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > > > Say I have invoices (parent) and payments (child) and I want to show > > each payment made against the invoices while displaying the list of > > invoices. > > > I've rea

Re: Help with templatetags

2008-07-04 Thread mccomas . chris
Yeah I did. I actually tested it on my development server, also on a production server (actually restarted apache several different times)... On Jul 4, 2:22 pm, Brian Luft <[EMAIL PROTECTED]> wrote: > Have you tried restarting the development server? I've noticed that > Django seems to cache te

Re: Inputting Date/Time in a Django Form

2008-07-04 Thread Tim Sawyer
Thanks anyway, I got it to work using a jQuery date popup and manually writing the forms html. Cheers, Tim. On Thursday 03 Jul 2008, TiNo wrote: > Ah yeah. > Maybe: > > collection_datetime = > forms.SplitDateTimeField(widget=forms.SplitDateTimeWidget()) > collection_datetime.widget.widgets = (

tweaking auth, making usernames unique within a company

2008-07-04 Thread brydon
Hey, I'm assuming I can always fork auth and modify the User class directly, however, I'd prefer to avoid that. I'd like to add a new model class called Company. Data and users within a company are mutually exclusive. I'd therefore like to allow usernames to be unique in the context of a Company

Re: Help with templatetags

2008-07-04 Thread Brian Luft
Have you tried restarting the development server? I've noticed that Django seems to cache template tag definitions when it starts up and won't pick up changes. They may have addressed this but I've gotten in the habit of just restarting the development server whenever I'm mucking around with cus

Re: Do you code django with Komodo?

2008-07-04 Thread Eric Holscher
I'd be interested in this as well. I currently use Komodo Edit, and love the Vi emulation! On Jun 26, 1:02 pm, rskm1 <[EMAIL PROTECTED]> wrote: > On Jun 24, 4:22 pm, Tye <[EMAIL PROTECTED]> wrote: > > > Semi-off-topic: > > Does anybody know how to get notepad to save as UTF-8 by default? It > > k

Re: Oracle syncdb

2008-07-04 Thread El Marto
thanks i will try that On Jul 3, 11:36 pm, Ian <[EMAIL PROTECTED]> wrote: > On Jul 3, 3:23 pm, El Marto <[EMAIL PROTECTED]> wrote: > > > > > Hi all! > > > I've developed and tested an application in MySQL and everything > > worked fine fine fine. Now i am migrating to Oracle, the app works > > fi

Dynamic models keyError

2008-07-04 Thread mwebs
Hello, I am trying to generate models at runtime. For this purpose I am using the method create_model() provided at http://code.djangoproject.com/wiki/DynamicModels create_model(name, fields, module='app.models' ) When I am doing like this i get a keyError '__module__' then I tried to pass the

localization

2008-07-04 Thread Ramdas S
Is there a bog app, with multi language support, whose code I can see. or any other simple app. Kindly provide link -- Ramdas S +91 9342 583 065 My Personal Blog: http://ramdas.diqtech.com --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Include django views in other web sites

2008-07-04 Thread Alaa Salman
On Jul 4, 6:41 pm, "Alessandro Ronchi" <[EMAIL PROTECTED]> wrote: > 2008/7/3, Jeff Anderson <[EMAIL PROTECTED]>: > > >  I have used the django template system to generate web pages independent of > > a django project. > > >  First I created a settings.py that only has the TEMPLATE_DIRS setting. >

Non editable fields in admin

2008-07-04 Thread Alex Rades
Hi, I'm writing an application which makes a pretty heavy use of the newforms-admin administrative site. One recurring need is displaying of informative fields (fields which should not be editable from the admin site, but only viewed). For example, imagine to have a DateField field into a Story cl

Re: html templates - 'for' cycle without a variable

2008-07-04 Thread [EMAIL PROTECTED]
Create a 20-elemnt list inside your view and set it as a context variable? On Jul 3, 10:21 am, antony_h <[EMAIL PROTECTED]> wrote: > How could I repeat my 20 times? > I've found how I can repeat it 5 times: > {% for a in 12345|make_list %} > > {% endfor %} > But it's not so great for e.g. a hun

Simple object creation in postgresql with django views code...

2008-07-04 Thread RossGK
I'm trying to do a bit of simple Django access to a postgresql database, and must be missing something. Using the tutorial info, I've had mixed success. I can pull a bit of stuff form the database, but have some curious behaviour that is slowing me down. See the example details below... Proble

FormPreview in admin site (newforms-admin).

2008-07-04 Thread Adam J. Forster
Hi all, I'm pretty sure that this isn't possible, but does anybody know if you can add the form preview functionality to the admin site (using newforms-admin branch)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Help with templatetags

2008-07-04 Thread mccomas . chris
i setup a custom template tag for my index page called recent_news. i tried to setup a second template tag for the page called more_news.py. the first is working as recent_news.py. recent_news.py gets the more recent entry, i have more_news.py set to get 2-6. i have {% load more_news %} since th

Re: Include django views in other web sites

2008-07-04 Thread Alessandro Ronchi
2008/7/3, Jeff Anderson <[EMAIL PROTECTED]>: > I have used the django template system to generate web pages independent of > a django project. > > First I created a settings.py that only has the TEMPLATE_DIRS setting. > Next, I created my template. > Last, I created a cgi script that loads and

Developer needed Client Management / Client Screening system

2008-07-04 Thread Lee Dreams
We have a proprietary Client Screening and management software program created in Django and Python. We are an adult industry service company. Our designer has moved on and we're looking for a young mind to not only continue work but take it in a new direction. It's currently running on sliceho

Re: Unsorted user selection widget after changeset 7806 (nfa)

2008-07-04 Thread spacetaxi
On 4 Jul., 15:52, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > You've waited one day right at the beginning of a big holiday weekend in the > US; [...] Ooops, sorry. I didn't think about this. Thanks for your feedback! -Stephan --~--~-~--~~~---~--~~ You received

Re: Unsorted user selection widget after changeset 7806 (nfa)

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 9:21 AM, spacetaxi <[EMAIL PROTECTED]> wrote: > Hm, it seems to me that nobody has a solution? Do I have to replace > the many-to-many-relation (editors) with an additional ArticleEditor- > class, containting a one-to-many relation to the User class and a one- > to-many rela

Re: Usability: stripping white space from form fields

2008-07-04 Thread Karen Tracey
On Fri, Jul 4, 2008 at 3:51 AM, Greg Fuller <[EMAIL PROTECTED]> wrote: > I want to mention what I consider to be a usability issue with Django > forms. It has to do with there being no option to strip leading and > trailing whitespace from CharFields, URLFields, EmailFields, etc. > Ticket #4969

Re: Unsorted user selection widget after changeset 7806 (nfa)

2008-07-04 Thread spacetaxi
Hm, it seems to me that nobody has a solution? Do I have to replace the many-to-many-relation (editors) with an additional ArticleEditor- class, containting a one-to-many relation to the User class and a one- to-many relation to Article? Is this the only way to get a sorted User selection widget?

Re: Create field from two others

2008-07-04 Thread Luke Seelenbinder
Thanks, for the reply I have since defined a function to handle this. On Thu, Jul 3, 2008 at 11:35 PM, James Bennett <[EMAIL PROTECTED]> wrote: > > On Thu, Jul 3, 2008 at 8:59 PM, lukeqsee <[EMAIL PROTECTED]> wrote: > > > > Can you take a first_name & a last_name field and then in the same > > mo

Re: Include django views in other web sites

2008-07-04 Thread Alessandro Ronchi
On 3 Lug, 15:26, David Christiansen <[EMAIL PROTECTED]> wrote: > Just a thought, but can you put this information in an iframe? Yes I've done, but this solution has two problems: 1) Blogger.com and other sites doesn't permits iframes 2) Referrers tracking is wrong with iframes, because if the

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Alex Rades
Ok I've got it working. I had to import models in models_app/models/__init__.py as Malcom suggested. I've used app_label instead of app_name in the Meta classes to make it work, is this ok? On Fri, Jul 4, 2008 at 12:33 PM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Fri, 2008-07-04 at

Re: Bound forms and form_from_instance

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 12:20 +0200, Florencio Cano wrote: > I'm trying to understand Django forms and I have a doubt. > Imagine that you define a Form class called AddressClass. > You can instantiate it like this: > > address_form = AddressClass() > > address_form will be an unbound form object

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 12:22 +0200, Alex Rades wrote: [...] > So for now there is only this models_app which should contain the > models. When I try to run syncdb, models under models/ are not > imported. Is there any magic to do into > models_app/models/__init__.py ? You need to import them int

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Adi J. Sieker
On Fri, 04 Jul 2008 12:22:33 +0200, Alex Rades <[EMAIL PROTECTED]> wrote: > So for now there is only this models_app which should contain the > models. When I try to run syncdb, models under models/ are not imported. > Is there any magic to do into models_app/models/__init__.py ? There is no

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Alex Rades
On Fri, Jul 4, 2008 at 11:26 AM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Fri, 2008-07-04 at 11:08 +0200, Alex Rades wrote: > > Hi, > > I have a project with 3 application which could (should) share their > > models. Morover, I'd like to put models into a separate directory, > > spl

Bound forms and form_from_instance

2008-07-04 Thread Florencio Cano
I'm trying to understand Django forms and I have a doubt. Imagine that you define a Form class called AddressClass. You can instantiate it like this: address_form = AddressClass() address_form will be an unbound form object and when you if you show it in the template all the fields will be blank

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Malcolm Tredinnick
On Fri, 2008-07-04 at 11:08 +0200, Alex Rades wrote: > Hi, > I have a project with 3 application which could (should) share their > models. Morover, I'd like to put models into a separate directory, > splitted into multiple files. Something like: > > myproject/ >models/ > box.py >

Saving date/times from a form

2008-07-04 Thread Tim Sawyer
Folks, I have an input form where users enter a new date and time. If the user enters 2007-01-01 and 01:00:00 I get the following error at submit: invalid input syntax for type timestamp with time zone: "(datetime.datetime(2007, 1, 1, 1, 0),)" Here's the code: forms.py: collection_datetime

Share models among applications and split them in multiple files

2008-07-04 Thread Alex Rades
Hi, I have a project with 3 application which could (should) share their models. Morover, I'd like to put models into a separate directory, splitted into multiple files. Something like: myproject/ models/ box.py firmware.py component.py myapp1/ myapp2/ myapp3/ Is it

Re: error with syncdb

2008-07-04 Thread allisongardner
IGNORE ME!! For some reason best known to my computer and Django it now works Go figure! On Jul 4, 10:36 am, allisongardner <[EMAIL PROTECTED]> wrote: > I have created my models, validated them etc and looked at the sqlall > output and everything was fine. However when i went to syncdb my > d

error with syncdb

2008-07-04 Thread allisongardner
I have created my models, validated them etc and looked at the sqlall output and everything was fine. However when i went to syncdb my database it created 5 of 10 tables but and error on the 6th table (suddenly found multiple primary keys!) caused the process to stop. I fixed the problem in my mod

Re: Admin functionality: someadmin.articles.models.article_genre'> instance needs to have a primary key value before a many-to-many relationship can be used.

2008-07-04 Thread [EMAIL PROTECTED]
I do understand that situation. But think of it... I want to create user associating him to certain groups By that time user itself is not created. But it needs to create user and then keep the relations between user and groups in another table right... I do want same behaviour. In my case i

Usability: stripping white space from form fields

2008-07-04 Thread Greg Fuller
I want to mention what I consider to be a usability issue with Django forms. It has to do with there being no option to strip leading and trailing whitespace from CharFields, URLFields, EmailFields, etc. Ticket #4969 was to address this issue but was closed with as a 'wontfix', and I have seen o

Re: SQL Relay

2008-07-04 Thread Dave Pederson
http://groups.google.com/group/django-users/browse_frm/thread/21ecac21fcbcd0af/6a50bf1c98c4b6c4#6a50bf1c98c4b6c4 Doesn't look like its reliable really. On Jul 3, 10:54 pm, Dave Pederson <[EMAIL PROTECTED]> wrote: > Has anyone out there used django with a database load balancer like > sqlrelay?