Chained managers - alternative?

2009-02-05 Thread phillc
In reference to http://simonwillison.net/2008/May/1/orm/ and comments from here http://thisweekindjango.com/screencasts/episode/11/django-ground-episode-3/ I am trying to make my implementation clean as possible... The idea is to able to drill down querysets based on more and more preset

Re: NetBeans IDE for Python

2009-02-04 Thread phillc
mine wasnt working exactly as you all described it... until i moved my django symlink to someplace else on my python path... and it suddenly worked its really odd. On Feb 3, 12:49 am, mrsixcount wrote: > Can't seem to get the auto complete to work when I import >

Re: Need suggestions on subversion structure for project

2008-09-10 Thread phillc
shameless plug http://www.wtflab.com/tech/2008/jul/01/developed-directory-structure/ http://www.wtflab.com/tech/2008/jul/05/making-django-version-control-friendly/ On Sep 5, 4:18 pm, Jeff FW <[EMAIL PROTECTED]> wrote: > On Sep 5, 12:28 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > >

Re: Noob: form class location

2008-08-24 Thread phillc
if im moving my form related logic to another file, i wouldnt really need to import forms else where? ;) On Aug 23, 9:10 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Sat, Aug 23, 2008 at 8:59 PM, Julien Phalip <[EMAIL PROTECTED]> wrote: > > > Hi, > > > In Django there are no

Re: Python PATH question

2008-07-14 Thread phillc
> > The runserver stuff is a bit too magic. It puts 'root' on sys.path but > > only long enough to import 'mysite' package root. um, i have never experienced this behavior. plug: http://www.wtflab.com/tech/2008/jul/01/developed-directory-structure/

Re: Django, Apache, and CSS

2008-07-09 Thread phillc
if you use multiple django instances, you need to add to each PythonInterpreter somestring On Jul 8, 11:52 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 9:47 PM, foo <[EMAIL PROTECTED]> wrote: > > > First, I want to thank you for your reply Milan!  I just recently > >

Re: Field class: Difference between blank and null

2008-07-07 Thread phillc
blank will store a string as a string with nothing in it null will store a string as null you should use blank http://www.djangoproject.com/documentation/model-api/#null says you shouldnt use null unless you have a specific reason to On Jul 7, 1:49 pm, Fernando Rodríguez <[EMAIL PROTECTED]>

Re: Installation error - missing module django.core

2008-07-03 Thread phillc
inside your sitepackages/django folder, there is a folder called django... that is what should be in site-packages On Jul 3, 3:25 pm, Leaf <[EMAIL PROTECTED]> wrote: > I'm trying to install Django on Windows XP SP2, but I received an > error while doing so. > > 1. I downloaded and installed

Re: forms + UI question

2008-07-02 Thread phillc
look up context processors On Jul 2, 4:31 am, pihentagy <[EMAIL PROTECTED]> wrote: > Hi! > > I have an auction site, the items appear in more views (and there are > more items in a view), and I would like to allow users to bid on every > view. > I have done it somehow, but I think that solution

Re: django+mod_python, caching or something else?

2008-07-02 Thread phillc
i was going to say state a question, but found my answer... for anyone else: http://www.djangoproject.com/documentation/db-api/#querysets-are-lazy On Jul 2, 10:09 am, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Alex Koshelev wrote: > > Or may be a custom template tag for common stuff. > > Or

Re: Strange display of date

2008-07-01 Thread phillc
having trouble understand what you mean On Jul 1, 2:09 am, gumbah <[EMAIL PROTECTED]> wrote: > Anyone? > > On Jun 27, 9:38 am, gumbah <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > does anyone know what i am doing wrong when i see adatelooking like > > this in the "change history" part of the

Re: a thread problem or my bad codes?

2008-07-01 Thread phillc
i think you need transactions? problem being that if all those processes happen at about the same time, they will all see enough money, then they will all process it. On Jul 1, 5:12 am, pength <[EMAIL PROTECTED]> wrote: > sorry for the bad indent of the "#models.py" part. I post it again, >

Re: Django setup with apache

2008-06-26 Thread phillc
your urls is setup for http://yourdomain.com/login/... not http://yourdomain.com/sommerspil/login On Jun 26, 11:46 am, Peter Rowell <[EMAIL PROTECTED]> wrote: > You didn't share with us the specific error you are getting. > > I strongly recommend a) DEBUG=True in settings.py, and b) checking >

Re: problem getting mod_python to serve application..

2008-06-26 Thread phillc
go to a python interpreter import sys sys.path make sure that directory is in there On Jun 26, 2:34 pm, Adi <[EMAIL PROTECTED]> wrote: > I get the following error when I hit my websitehttp://ipaddress/enterathletes/ > > DocumentRoot:   '/var/www/html' > > URI:            '/enterathletes/' >

Re: Need help with django poll tutorial (poll form doesn't work)

2008-06-26 Thread phillc
do you have spaces around post? i dont even know if that would cause the problem. if you ar eusing the dev console, the way to debug is use the print statement so put these someplace and tell us what you get print request.method print request.POST['choice'] On Jun 26, 9:29 am, Mog

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread phillc
model choice field http://www.djangoproject.com/documentation/newforms/#fields-which-handle-relationships On Jun 26, 9:53 am, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to do something like this > > class PictureForm(forms.Form): >     image          =

Re: Development environment

2008-06-25 Thread phillc
emacs does me well. On Jun 25, 5:23 pm, Juanjo Conti <[EMAIL PROTECTED]> wrote: > Fernando Rodríguez escribió: > > > Hi, > > > I'm currently learning django on Ubuntu, but my background is Windows, > > so I'm not a VIM kind of guy. What kind of IDE do you guys use or > > recommend? > > I use

Re: problem with select_related?

2008-06-25 Thread phillc
yourversion of django before or after qsrf merge? select_related does not work well with relations that have null = True On Jun 24, 11:40 pm, bob84123 <[EMAIL PROTECTED]> wrote: > I'm having a problem with select_related; I'm not sure if it's a bug > or a problem with my understanding of how

Re: I have to filter ForeignKey

2008-06-25 Thread phillc
i had a slightly hard time understanding your problem. are you asking for Personal_Cliente.contract_macro_set.all() http://www.djangoproject.com/documentation/db-api/#related-objects or are you asking for how to climb the tree the other way? On Jun 25, 10:02 am, mariu <[EMAIL PROTECTED]>

Re: Creating test database with a complete SQL script

2008-06-25 Thread phillc
i think i understand what youre saying? by test database, you mean you want to test django out but your declared models names dont match your db? there is a meta option for db table http://www.djangoproject.com/documentation/model-api/#db-table On Jun 25, 11:54 am, "[EMAIL PROTECTED]" <[EMAIL

Re: Django Popups?

2008-06-24 Thread phillc
however you would do it without django, is how you would do it with django On Jun 24, 9:51 am, RossGK <[EMAIL PROTECTED]> wrote: > I'm a recent Python/Django inductee and trying to get a small project > going. > Is there a good way to do a pop-up window from Django or should I use > java-script.

Re: url views problem

2008-06-24 Thread phillc
__init__ > > > > > >  96. self.regex = re.compile(regex) > > > > > > File > > > > > > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ > > > > > > re.py" in compile > > > > > >  180. return _compi

Re: media server implementation - context processor, custom template tag, or custom filter

2008-06-23 Thread phillc
that is an extremely complex problem for such small problem... if you are worried about caching, just append a number to the file or add a date to it. On Jun 22, 6:48 pm, alex <[EMAIL PROTECTED]> wrote: > I already have {{ MEDIA_URL }} set in html, css, and js templates and > that's working

Re: Help with mod_python and dynamic vhosts

2008-06-23 Thread phillc
http://httpd.apache.org/docs/2.0/vhosts/examples.html On Jun 22, 7:34 pm, "Brian Ritchie" <[EMAIL PROTECTED]> wrote: > Hello all, > > My first post to this mailing list.  I didn't see this in the archive.  It > this was covered before, sorry about that. > > I have a webserver (Ubuntu, Apache2)

Re: Multiple fields without manytomanyfield?

2008-06-23 Thread phillc
how about a one to many? On Jun 22, 8:03 am, Xan <[EMAIL PROTECTED]> wrote: > Hi, > > Suposing you want a model A with several and indetermined number of > integer fields. Is there any possibility of defining A without > creating a Integer class and then add ManyToManyField(Integer) in > class

Re: url views problem

2008-06-23 Thread phillc
http://www.djangoproject.com/documentation/url_dispatch/ look at the regular expressions used in the examples, and the section "named groups" On Jun 23, 9:22 am, sebastian stephenson <[EMAIL PROTECTED]> wrote: > ok so I have in my data base a colium of rss feeds and I am parseing   > them via

Re: Another question about form validation?

2008-06-23 Thread phillc
class FormFoo(ModelForm): def __init__(self, obj1, *args, **kwargs): super(FormFoo, self).__init__(*args, **kwargs) self.object1 = obj1 def clean(self): # use self.object1 here On Jun 23, 12:23 pm, Adi <[EMAIL PROTECTED]> wrote: > do you mean something like this. > > class

hashed primary keys

2008-06-19 Thread phillc
Is there anyway to make the primary key of a model a hash of some sort? some of these primary keys will be public facing, and i'd rather them not be counting up sequentially. in my current implementation, i have left the primary key alone and have made a unique field that creates a hash and

Re: Nested Dictionaries in Django Templates

2008-06-19 Thread phillc
you are implementing logic into the templates, which django templating attempts to prevent. On Jun 17, 12:27 pm, Keybo <[EMAIL PROTECTED]> wrote: > Hello, >        I have a question regarding displaying information in django > templates. I would like to display a nested dictionary(Hash) in the >

Re: Title: Once again, subclassing User, UserProfile, Multiple User types...

2008-06-19 Thread phillc
"You have to add a User, then add a Student, and then make sure that you get the right User attached to the student" or, "Well you don't see the Student's first name and last name, in the Student listing because those are really attributes of the User."" could have your save method automatically

Re: little problem with the django template language

2008-06-19 Thread phillc
yes they are strings, yes in python if you do if item1: pass it will evaluate the string as a true/false depending on existance. however, comparing two strings for equality... checks if they are equal. {% if item1 %} {% if item2 %} blah {% endif %} {% endif %} On Jun 19, 1:50 pm, mark

Re: Url tag issues

2008-06-19 Thread phillc
use of named urls will probably make that a ton easier On Jun 19, 11:45 am, "Emily Rodgers" <[EMAIL PROTECTED]> wrote: > Hi, > > I have been hitting a brick wall so many times now on this that it is > starting to hurt!! Please help if you can... > > I have an index page, and I want my function

Re: Implementing a new idea

2008-06-19 Thread phillc
models.Model.save(self) super(ProjectModification, self).save() On Jun 19, 1:41 pm, Adam Fraser <[EMAIL PROTECTED]> wrote: > Signalling worked out for me but it turned out to be more complex than > it needed to be.  Here are some references in case anyone is looking: > >

Re: ManyToMany Field - is an object in their or not.

2008-06-19 Thread phillc
either way, the database is hit to check that. so if your goal is to minimize, getting true and false instead of the record has no advantage. just check if there is something returned. On Jun 19, 10:14 am, timc3 <[EMAIL PROTECTED]> wrote: > I have a situation where I want a true or false to

Re: Does django-driven Blog popular?

2008-06-13 Thread phillc
<3 byteflow i dont use the blog itsself, but i have stolen a ton of ideas from it. On Jun 13, 12:11 am, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > It is stupidly easy to write a blog using Django, and many people do so. > You can find many examples out there. One complete example is the >

Re: Invalid block tag: 'with'

2008-05-28 Thread phillc
"I'm starting work on a site that's to be hosted on GoDaddy" uh good luck On May 27, 3:56 pm, bcrem <[EMAIL PROTECTED]> wrote: > I think I'll check my target host server; I'm starting work on a site > that's to be hosted on GoDaddy - have to see what they're running. > And if their

Re: Question about one-to-many model query

2008-05-22 Thread phillc
for c in city.person_set.all() http://www.djangoproject.com/documentation/db-api/#backward On May 22, 10:54 am, Dan <[EMAIL PROTECTED]> wrote: > Hello! > > I'm new to Django, so please forgive my newbness :) > > The following is my model: > > class City(models.Model): > name =

improvements on this directory structure

2008-05-22 Thread phillc
ive been changing the structure of my projects/applications over and over. thats because every time i change it, i realize i can make it a bit different. the whole time i felt it was neccessary to allow for multiple projects on the same host. well now that ive finally gotten somewhere, i was

Re: Problem displaying value(s) from ManyToMany relationship

2008-05-19 Thread phillc
variable name collision. caused by locals() On May 18, 8:05 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Very odd. On a whim, I changed: > > > {% for instructor in instructors %} > {{ instructor.first_name }} #there is no value output > here > {% endif %} > > > to > > > {% for i in

Re: Announcing Deco: static content for Django

2008-05-13 Thread phillc
your bundling of those mac files confused me for a minute =P --~--~-~--~~~---~--~~ 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

Re: Getting back to the same page after completing a task in another page

2008-05-13 Thread phillc
"I am new to web programming" "I am trying to use my own loginpage " is there a reason that contrib.auth doesnt meet your needs? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Caching get_profile

2008-05-11 Thread phillc
get_profile is useful for being able to change the model name or being able to reuse an app. if that doesnt matter, you can just do it the normal way... foreign key to the auth model (from django.contrib.auth.models import User) On May 11, 4:17 pm, Szymon <[EMAIL PROTECTED]> wrote: > Hello, > >

Re: Setting request-parameters per default

2008-05-11 Thread phillc
i second the template tag approach On May 11, 3:32 am, mwebs <[EMAIL PROTECTED]> wrote: > Thanks Alex, thats a good idea. > > But I want to have a more generic solution for this problem. There > must be an other way than to write custom template tags. I think the >

Re: Group 'profile'

2008-05-10 Thread phillc
im not understanding whats limiting you from using get_profile to "extend" the user model... then in that having a foreign key (or m2m) to your group On May 10, 7:10 pm, Marcin Gorczyński <[EMAIL PROTECTED]> wrote: > Hello > > In my site I want users to belong to groups, but in a quite diffrent

Re: install question

2008-05-10 Thread phillc
if you set a file association of .py to the python.exe, you wont have to type python before each command On May 10, 4:12 pm, davenaff <[EMAIL PROTECTED]> wrote: > It sounds like you have an application configured to open .py files. > > Try: python manage.py etc. > > On May 10, 12:04 pm,

Re: new forms comments

2008-05-10 Thread phillc
django comments is being re-written as a google summer of code project http://code.google.com/soc/2008/django/appinfo.html?csaid=67A7AB4801F06D7B On May 10, 2:14 pm, "Ramdas S" <[EMAIL PROTECTED]> wrote: > Hi, > > Any ideas where (which branch/patch/?) new comments using new forms is being >

Re: doctest not running in an app

2008-05-10 Thread phillc
can we see your models.py? On May 10, 9:00 pm, davenaff <[EMAIL PROTECTED]> wrote: > It is probably also worth noting that _doctest returns correct > (projectname.appname.models) object.__module__ values for Managers. > > On May 10, 5:49 pm, davenaff <[EMAIL PROTECTED]> wrote: > > > As I dig

Re: Few things ive been wondering

2008-05-07 Thread phillc
yea, i never go as far to check html either. ill take some of your thoughts and blend it into my process as far as the strings go. thanks a ton, it all makes sense since strings are immutable. =) On May 6, 11:51 am, "Norman Harman" <[EMAIL PROTECTED]> wrote: > phillc w

Re: Few things ive been wondering

2008-05-06 Thread phillc
will defenitely be using that structure in the future. On May 5, 7:42 pm, Scott SA <[EMAIL PROTECTED]> wrote: > On 5/5/08, phillc ([EMAIL PROTECTED]) wrote: > > >fourth: > > > >i never understood this, why do people do > > >somevar = "blah blah %s" % a

Few things ive been wondering

2008-05-05 Thread phillc
there has been a few things that i feel have been holding back from making my code structure/process better. i was hoping someone could help me on some of these questions. first: How does one develop tests for django web apps? im having trouble writing tests. i understand there are view

Re: Why does one work but not the other

2008-04-18 Thread phillc
, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-17 at 12:44 -0700, phillc wrote: > > I was using new forms for one of my forms, and i wanted to save a > > relation. > > i came upon an interesting problem along the way. is there a limit in > > python

Why does one work but not the other

2008-04-17 Thread phillc
I was using new forms for one of my forms, and i wanted to save a relation. i came upon an interesting problem along the way. is there a limit in python on the number of chained function calls or something? This did not work: class q_to_q_form(forms.Form): def __init__(self, columns,

Re: Creating a Random Hash for Invitations

2008-04-07 Thread phillc
ive implemented a hash in the save method, and ive implemented in the model default=(hash function), and ive done it in my view. they all worked fine, just remember if you override save, if you have any data that goes along with the invite and edit it, the hash will be created again unless you