Re: Help with Date Based Generic Views and Permalink

2008-09-08 Thread Daniel Roseman
On Sep 8, 4:37 pm, [EMAIL PROTECTED] wrote: > Hey all, > > I have this code: > > http://dpaste.com/76671/ > > When I go to the URL it doesn't display the page, but it also doesn't > display and errors with the URL. What is wrong with the permalink > instance? > > Also, is there a workaround for

Re: new ModelAdmin set up

2008-09-08 Thread Daniel Roseman
On Sep 8, 8:14 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I am editing my Admin.py to use the new ModelAdmin.  All my change has > no effect.  I wanted it to come up with all my app automaticlly. > > I have this in my urls.py: > from django.contrib import admin > . > . > . > (r'^admin/(.*)',

Re: disable delete checkbox in Inline formset

2008-09-08 Thread Daniel Roseman
On Sep 8, 7:55 pm, Kurczak <[EMAIL PROTECTED]> wrote: > On 8 Wrz, 20:37, David Zhou <[EMAIL PROTECTED]> wrote:> On Sep 8, 2008, at > 2:30 PM, Kurczak wrote: > > > > Is there any way to disable/remove the delete checkbox for inline > > > formsets ( in admin) ? > > > I found nothing about it in

Re: cannot import name entrys

2008-09-08 Thread Daniel Roseman
On Sep 8, 9:16 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I keep getting this error on this view named timesheets, the code > looks like this. > > ViewDoesNotExist: Could not import intraweb.apps.timesheets.views. > Error was: cannot import name entrys The traceback quite clearly states that

Re: CRUD with forms from models usin ModelForm?

2008-09-09 Thread Daniel Roseman
On Sep 9, 4:47 am, "Efrain Valles" <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a basic question, I am currently adding new items using a form > that is generated using ModelForms, I have html for the form I need > using {{ form.as_table }} in the html. Now I am trying to do CRUD for > data

Re: Stupid noob question - admin link

2008-09-09 Thread Daniel Roseman
On Sep 9, 7:16 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > Hi all, starting to think there is so much stuff in django and python > that I will never learn it all. I am building a site that used the > admin piece for most of the CRUD and a few other pages for the rest of > my requirements. I

Re: weird osx problem (templates path)

2008-09-09 Thread Daniel Roseman
On Sep 9, 8:56 pm, Anakin <[EMAIL PROTECTED]> wrote: > im using 10.5.2 osx Leopard. and im working with django 1.0 final > release. > > i have some screenshots about this error, settings - traceback and if > you need terminal log. you can see in this >

Re: updating entry from form in django 1.0!?

2008-09-10 Thread Daniel Roseman
On Sep 10, 8:56 am, David <[EMAIL PROTECTED]> wrote: > whereas once you had > > p = get_object_or_404(Person, pk=pID) > MyForm = forms.form_for_instance(p) > f = MyForm(request.POST.copy()) > > how on earth do you do it now? > I've tried simply f = MyForm(request.POST.copy()) where MyForm is >

Re: updating entry from form in django 1.0!?

2008-09-10 Thread Daniel Roseman
On Sep 10, 9:56 am, David <[EMAIL PROTECTED]> wrote: > Thanks, are they also any example of the case of form_for_model (as I > am assuming the above is only with respect to form_for_instance) > > Thx. > D. But that's just what you had already: > > > I've tried simply f =

Re: Problm using FileField with inline formsets (inlineformset_factory)

2008-09-10 Thread Daniel Roseman
On Sep 10, 9:50 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi > > I'm having a problem with inline formsets containing file field, i've > had a good google but couldn't find an answer, so apolgies if this is > a stupid or repetative question. > > I have a model Applicatant, which has a

Re: Displaying a list of lists?

2008-09-12 Thread Daniel Roseman
On Sep 12, 1:04 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [OT question: Why does top-posting seem to be the default response mode on > this list?] > As a follow-up to this question, how would one cast the output as a table > where the major field is only displayed on change. I.e., how to

Re: DjangoCon video

2008-09-12 Thread Daniel Hepper
I'm also looking forward to the videos and just wanted to share this: "Videos should be available around Monday next week." http://twitter.com/djangocon/statuses/918620831 Daniel Am Donnerstag, den 11.09.2008, 19:25 +0700 schrieb Ronny Haryanto: > On Thu, Sep 11, 2008 at 5:28 PM

Re: Import error: Model based on another model

2008-09-13 Thread Daniel Roseman
On Sep 13, 9:25 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Hi All, > > I need to create a field with a choice set that looks like this: > >     BTW_CHOICES = ( >         ('0.0', '0%'), >         ('6.0', '6%'), >         ('19.0', '19%'), >     ) > > This works as expected when using dropdown

Re: Import error: Model based on another model

2008-09-13 Thread Daniel Roseman
On Sep 13, 10:56 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Daniel, > > > If you want a field that's populated with values from another model, > > you should use a ForeignKey. > > Is it then still possible to use filters and such, and keep it in the model

Re: Template problem with dates(field, kind, order='ASC')

2008-09-13 Thread Daniel Roseman
On Sep 13, 10:49 pm, djandrow <[EMAIL PROTECTED]> wrote: > This is probably really really obvious. I have the following statement > in my views.py: > > archive_list = Entry.objects.dates('entry_date', 'month', > order='DESC') > > then I have; > > {% for archive in archive_list %} > > {{

Re: Admin inlines and foreign keys

2008-09-14 Thread Daniel Roseman
On Sep 14, 9:05 am, Donn <[EMAIL PROTECTED]> wrote: > Hi, > I have been looking, but can't find. > > I have a Client model with a Website inline (related by FK). it's open in a > change screen in the admin. > The inline below has a field that refers to the parent Client. > That field is a

Re: Getting specific data from a many to many field.

2008-09-15 Thread Daniel Roseman
On Sep 15, 8:50 pm, "Lance F. Squire" <[EMAIL PROTECTED]> wrote: > Using Fedora 8, Django  version 0.96.3 > > I'm currently trying to pull two specific images from a list of images > associated with a model. > > Currently the Models are like this: > > class ImageCat(models.Model): >     name =

Re: TemplateSyntaxError: Caught an exception while rendering: coercing to Unicode: need string or buffer, long found

2008-09-15 Thread Daniel Roseman
On Sep 15, 7:33 pm, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I am receiving an obscure TemplateSyntaxError (Caught an exception > while rendering: coercing to Unicode: need string or buffer, long > found ) when rending a ModelForm that has a foreign key back to a > specific

Re: Import error: Model based on another model

2008-09-15 Thread Daniel Roseman
On Sep 15, 9:34 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Daniel, > > I'm building an invoice system. The data relations are as follows: > > Customer -1toN-> Orders -1toN-> Products > > The products can have different tax levels which, during creation of an

Re: Getting specific data from a many to many field.

2008-09-15 Thread Daniel Roseman
On Sep 15, 9:25 pm, "Lance F. Squire" <[EMAIL PROTECTED]> wrote: > On Sep 15, 4:13 pm, Daniel Roseman <[EMAIL PROTECTED]> > wrote: > > > So, putting that all together: > > > {% for pic in info.system_pictures.all %} > >

Re: Getting specific data from a many to many field.

2008-09-16 Thread Daniel Roseman
On Sep 16, 2:30 am, "Lance F. Squire" <[EMAIL PROTECTED]> wrote: > On Sep 15, 5:21 pm, Daniel Roseman <[EMAIL PROTECTED]> > wrote: > > > Probably the easiest solution, if you know you're > > always going to be requesting a certain lookup, is to define a

Re: Creating users?

2008-09-16 Thread Daniel Roseman
r, so you can always create it via the standard syntax: u=User.objects.create(username='daniel', email='[EMAIL PROTECTED], first_name='daniel', last_name='roseman'') but you need to set the password separately, as it needs to be a hashed value: u.set_password('mypassword') -- DR. --~--~-~--~~-

Re: Unique fields in model

2008-09-16 Thread Daniel Roseman
On Sep 16, 11:34 am, TKa <[EMAIL PROTECTED]> wrote: > Hello there, > > This might be a trivial question but I'm a rather new Django user and > I couldn't find an answer in the documentation. > > Setting unique restriction to one field of the model was an easy task, > but how can I give a model a

Re: Model weirdness (from confused newbie)

2008-09-16 Thread Daniel Roseman
On Sep 16, 5:49 pm, Steven <[EMAIL PROTECTED]> wrote: > I just got started with Django (I'm using v1.0).. and have been trying > (unsuccessfully) to add this line to my first model "author = > models.ForeignKey(User)"... (see my models.py below).  Everytime I do > so and sync I get the following

Re: Getting specific data from a many to many field.

2008-09-16 Thread Daniel Roseman
On Sep 16, 4:16 pm, "Lance F. Squire" <[EMAIL PROTECTED]> wrote: > On Sep 16, 2:30 am, Daniel Roseman <[EMAIL PROTECTED]> > wrote: > > try: > >     return > > self.system_pictures.filter(image_category__name='Header_Pic')[0] > > except

Re: Import error: Model based on another model

2008-09-17 Thread Daniel Roseman
On Sep 16, 10:08 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Daniel, > > Great one! Your suggested setup works, in the front-end that is. I have quite > some classes subclassed from ModelAdmin (including ProductAdmin), however the > "form = ProductForm"

Re: User subclass vs. User-Profile

2008-09-17 Thread Daniel Hepper
profile_form = ProfileForm() return render_to_response('signup.html',{'user_form':user_form,'profile_form':profile_form}) Consider this pseudo code :) HTH, Daniel > Rodney > > On Sep 16, 4:03 am, Erik Allik <[EMAIL PROTECTED]> wrote: > > I guess if you subclassed the Use

Re: Dynamic images

2008-09-17 Thread Daniel Roseman
On Sep 17, 12:31 pm, TKa <[EMAIL PROTECTED]> wrote: > Can anybody help me how to create dynamic images within Django? > Drawing the image with Python is not a problem but how to link the > created image to the httpResponse? > > Because I need input from the Django models for the image I want to >

Re: seeking design advice

2008-09-18 Thread Daniel Roseman
On Sep 17, 10:42 pm, akonsu <[EMAIL PROTECTED]> wrote: > hello, > > i am looking for an advice from people who know django internals well. > > to simplify, i have a template that currently uses a custom tag. the > tag emits the needed markup. suppose the template includes several > instances of

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > I have a base.html template. > > In it I've inserted: > >     {% block stylesheets %}{% endblock %} > > and in stylesheets.html in the same directory: > >     {% extends "base.html" %} >         {% block stylesheets %} >          

Re: Can I display reverse relationships in the admin change_list

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:17 am, ksfguy <[EMAIL PROTECTED]> wrote: > Hello!, > > There are two models > > -- > > class Parent(models.Model): >    name = ... > > class Child(models.Model): >     parent =

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:48 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: > >On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> > >wrote: > >> I have a base.html templat

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 11:23 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > Maybe if I explain what I'm doing it will help. > > Django CMS uses a base template, base.html. base.html is: > > > > What I would like is to devolve bits

Re: Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:34 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > Hi, > > I have a form which contains some prefilled data and some to be filled > in by the user. I have no trouble getting the forms to be prefilled. > What I want is thatfor a GET request, if the form data pre exists, > then

Re: one symbol "i" causes the template system to raise an exception

2008-09-19 Thread Daniel Roseman
On Sep 19, 5:02 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 18, 2008 at 5:48 PM, Valery Khamenya <[EMAIL PROTECTED]> wrote: > (How all of this is connected to what you've got in your tag is a bit > of a mystery.  The template you are mentioning, though, is not involved in > the

Re: static.serve images from css template

2008-09-19 Thread Daniel Roseman
On Sep 19, 9:50 am, Evgeny <[EMAIL PROTECTED]> wrote: > Hi, > I have a problem with serving static images with > django.views.static.serve from urls defined in css file. > Everything works ok when an image is served by tag in the > html (), but it doesn't work > when the link to the same image

Re: The view django_bookmarks.bookmarks.views.bookmark_save_page didn't return an HttpResponse object

2008-09-20 Thread Daniel Roseman
On Sep 20, 7:08 am, ehpmail <[EMAIL PROTECTED]> wrote: > Why do i get the above error in views.py: > > def bookmark_save_page(request): >     if request.method == 'POST': >         form = BookmarkSaveForm(request.POST) >         if form.is_valid(): >             # Create or get link. >        

Re: how to get CURRVAL()

2008-09-20 Thread Daniel Roseman
On Sep 20, 6:05 am, Merrick <[EMAIL PROTECTED]> wrote: > I have a function in my model where I need the next sequence id from > postgresql so i can create an encoded value based off it. Any ideas on > how to do this? You can use the db.connection object for direct access to the database. I don't

Re: Admin field custom validation

2008-09-21 Thread Daniel Roseman
On Sep 21, 6:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Having done a bit more research I see this often used as: > > clean_fieldname(self) rather than clean(self) > > which I guess would eleviate my problem, as my clean(self) function > doesn't appear to remember or pass on the rest

Re: ModelChoiceField with Unique Results

2008-09-23 Thread Daniel Roseman
On Sep 22, 10:58 pm, BobZ <[EMAIL PROTECTED]> wrote: > Thanks dmorozov, that worked fine in the sense that it returned only > unique years in a select box, but it still didn't order them properly > (getting non-duplicate years as 1961, 1931, 2000, 1975, 1995, etc.). > > Somehow the order_by

Re: Changing field error messages

2008-09-23 Thread Daniel Roseman
On Sep 22, 9:59 am, Donn <[EMAIL PROTECTED]> wrote: > Hi, > I would like to change the 'already exists' message when one adds a record > that duplicates a unique one in the table. > Nearest I can tell, the fields.error_messages do not offer a way to alter that > message. > > Here's my basic code:

Re: Changing field error messages

2008-09-23 Thread Daniel Roseman
On Sep 23, 10:08 am, Donn <[EMAIL PROTECTED]> wrote: > On Tuesday, 23 September 2008 08:47:10 Daniel Roseman wrote:> meantime maybe > you could define a clean() method and catch and re- > > raise the ValidationError there. > > I tried that idea of yours and it has no

Re: name '_' is not defined

2008-09-23 Thread Daniel Hepper
from django.utils.translation import ugettext_lazy as _ HTH, Daniel Am Dienstag, den 23.09.2008, 04:12 -0700 schrieb laspal: > Hi, > I am using 1.0 version ran into problem. > > My model : > from django.db import models > > from django.contrib.auth.models import User

Re: ModelChoiceField with Unique Results

2008-09-23 Thread Daniel Roseman
On Sep 23, 4:44 pm, BobZ <[EMAIL PROTECTED]> wrote: > Thanks Daniel.  I've found solutions similar to yours in other threads > on the net, and everytime I test them, I literally get no form at all > in my rendered template. > My template appears to have all the correct code in

Re: get_query_set in admin/views/main trying to split a list

2008-09-24 Thread Daniel Roseman
On Sep 23, 11:06 pm, Jigsaw <[EMAIL PROTECTED]> wrote: > Hello, > > After upgrading from svn 8322 to 9084, I received: 'list' object has > no attribute 'split' > /usr/lib/python2.5/site-packages/django/contrib/admin/views/main.py in > get_query_set, line 187 > > I modified line 186 from: >        

Re: Set booleanfield to True on shell?

2008-09-24 Thread Daniel Roseman
On Sep 24, 8:00 pm, Jorge Romo <[EMAIL PROTECTED]> wrote: > Hello guys, maybe this is a kinda dumb question but i just can't > figure it out! > > I have set to False as default for a is_finished field. If something > is finished it should turn to True, but i just can't make it happen. > Any idea?

Re: Concept Q: Extra model fields for clean templates sake

2008-09-25 Thread Daniel Roseman
On Sep 25, 10:33 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm finding myself creating more and more fields in a model to keep my > templates clean. Since it's merely temporary calculated data, and not data to > store permanently it feels like the wrong place. An example: > >

Re: collecting field values from bound forms (beginner question)

2008-09-25 Thread Daniel Roseman
On Sep 25, 9:36 am, "I.K." <[EMAIL PROTECTED]> wrote: > Hi, > > I've spent a short while reading the documentation but not spotted > what I need. Could somebody point me to the right place please? > > Is there a way to put a bound  Django form into a template to render > an HTML form with the

Re: runserver error

2008-09-25 Thread Daniel Roseman
On Sep 25, 5:42 pm, cwurld <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to upgrade my site from 0.97 to 1.0. When I use the > command: > > python manage.py runserver > > I get the error: > Error: cannot import name connect > > Any ideas how to resolve this? > > Thanks, > Chuck That clearly

Re: admin error didn't clear until I reloaded polls detail view

2008-09-25 Thread Daniel Roseman
On Sep 25, 5:36 pm, arnold4321 <[EMAIL PROTECTED]> wrote: > Hi, > > I'm just getting started with Django.  I'm working through the > tutorial on setting up my first app.  I ran into something that > strikes me as odd.  I guess I must have had some mistake in my polls/ > views.py file, because I

Re: A Newbie question: Need advice on how to create generic html templates with models

2008-09-25 Thread Daniel Roseman
On Sep 25, 8:51 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > I know this may be a stupid question but please bear with me. Here is > my problem > > In views.py I have a multiple methods, where each method is mapped to > a unique model. There may be multiple methods mapped to the same >

Re: Designing the model of a website

2008-09-28 Thread Daniel Roseman
On Sep 28, 12:21 pm, Caisys <[EMAIL PROTECTED]> wrote: > Hi, > I am new to django and mvc. I have php and asp experience. I followed > the tutorial and would like to create a site that will act as as a > sort of city guide. to Simplify things I will assume the site will > have 5 types of

Re: Cannot resolve keyword 'user' into field. Choices are: xxx, yyy, zzz

2008-09-29 Thread Daniel Roseman
On Sep 29, 8:02 am, jim <[EMAIL PROTECTED]> wrote: > Hello, >     I am trying to use the get_profile() function: > > In my settings.py i have: > > AUTH_PROFILE_MODULE = 'register.registration' > > In my apps/user_profile/views.py i have: > > def index(request): > >    if request.method == 'POST':

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Daniel Roseman
On Mar 16, 5:15 pm, NoviceSortOf wrote: > I just want to say Hello Mary in my HTML code pulling Mary's username > from the request.data. > > I've dug through the documentation and through this group, but am > still baffled by > what seems the inability of Django to allow

Re: Port in use Error

2009-03-16 Thread Daniel Roseman
On Mar 16, 5:16 pm, TP wrote: > Unfortunately the website doesnt work, just get  a blank web page. > > Im working from a University computer so im guessing it may be due to > that problem as I have no other programs running apart from Firefox > So use a different port

Re: More than one DB configuration in settings.py

2009-03-17 Thread Daniel Hepper
There is a page on the wiki which list several possible solutions to this problem: http://code.djangoproject.com/wiki/SplitSettings Regards, Daniel On Mar 17, 1:59 pm, Julián C. Pérez <jcp...@gmail.com> wrote: > Hi everyone > I need some help here > I'm in a rush, so I don't took

Re: request object needed in form methods

2009-03-19 Thread Daniel Roseman
On Mar 19, 1:22 pm, Thomas Guettler wrote: > Hi, > > I know that you can pass the request object to form like this: > > class MyForm(forms.Form): >     def __init__(self, request, *args, **kwargs): >         self.request=request >         forms.Form.__init__(self, *args,

Re: Need two response statements on same def

2009-03-19 Thread Daniel Roseman
On Mar 19, 3:35 pm, Jesse wrote: > My concern is that each view has 87 lines of duplicate code from the > "GET" data to get the appended list (shown here as: data retrieved to > create a list .list.append(publications)).  Anytime I make a > change in one view I have to

Re: accessing related fields of model

2009-03-19 Thread Daniel Roseman
On Mar 19, 8:20 pm, adrian wrote: > The doc gives this example for querying an Entry model which has a > foreign key field to a Blog model. > > e = Entry.objects.get(id=2) > e.blog = some_blog > > Fine.  Now if I do it in a loop like this: > > e = Entry.objects.all() > for

Re: Django web site upload problem

2009-03-21 Thread Daniel Roseman
On Mar 20, 7:34 pm, YuDe wrote: > Hi, > I have been browsing the documentation, but I could not find obvious > link to instructions of uploading the file that created through > tutorials. > > I have a server and use winSCP to upload htmls. Is there a page that > instruct

Re: iterating through form.fields

2009-03-22 Thread Daniel Roseman
On Mar 22, 8:20 am, nivhab wrote: > Hi, > > I have this problem which is probably right in front of my eyes but I > just cannot get it. Maybe someone can point me in the right direction: > > I am trying to iterate through form.fields in a template. > The form is rather

Re: Additional Javascript include in ModelAdmin

2009-03-22 Thread Daniel Roseman
On Mar 22, 3:04 pm, Roy wrote: > Hi, > > Is there a way to include additional JavaScript in the admin page for > a particular model? I don't want to touch the model code though. > > The particular scenario is I want to change the flatpage edit screen > in the admin to use a

Re: Additional Javascript include in ModelAdmin

2009-03-22 Thread Daniel Roseman
On Mar 22, 4:15 pm, Roy wrote: > That would require the extra files be hosted on my media url though. I > want to be able to link js externally so I can use stuff like YUI, > etc. without having to host it. Not at all - if you pass in an absolute path, it is left alone. See:

Using Template Tags Within Markdown

2009-03-23 Thread Daniel Watkins
Hello all, I'm currently trying to render some text in Markdown format, that contains templatetags. For example: [This]({% cms_link 22 %}) is a link. If I render this: {{ that_text|markdown }} the '{% cms_link 22 %}' remains verbatim in the output. As I see it, there are two

Re: Local Server seems to not work with typing parameter in the url?

2009-03-24 Thread Daniel Roseman
On Mar 24, 2:25 pm, SamuelXiao wrote: > I am writing a simple application which takes parameter from the url > and simply put it to another python app and open it.  If it is > successful, a content of the author's blog post will be returned. > The following is my code:

Re: Garbage Collection(maybe?) and RequestContext

2009-03-24 Thread Daniel Roseman
On Mar 24, 3:42 pm, Keyton Weissinger wrote: > I'm using the extra_context dictionary passed into the view like many > folks (James Bennett among them) seem to recommend either directly or > via his projects. > > Here is what a view might look like (all of this is on dpaste

Re: Template language into JS file

2009-03-25 Thread Daniel Roseman
On Mar 25, 10:45 am, Oumayrita wrote: > Hello Friends, > I have a  drop-down menu for navigation like this > on:http://www.softcomplex.com/products/tigra_menu/ > I need to display dynamically the list of Products Demo from the data > base. > So I need to know how

Re: Error when posting a comment

2009-03-25 Thread Daniel Roseman
On Mar 24, 8:58 pm, Tonu Mikk wrote: > I posted this on djangothreadedcomments list some days ago, but did not > get a response.  Perhaps django users can help me out? > > Hello, I am attempting to get threaded comments to work on a shared > bookmarking application.  It seems that

Avoiding Accidental Overwrite In Admin Interface

2009-03-25 Thread Daniel Watkins
Hello all, We recently ran into an issue when two people were editing a record via the admin interface simultaneously. Both opened the record, made changes and hit Save. Person A pressed Save after Person B, and so only Person A's changes were reflected in the database. What is a good way of

Re: Dynamic on-action update form

2009-03-28 Thread Daniel Roseman
On Mar 28, 1:44 pm, Nizan Freedman wrote: > is it possible to make a Django form that hides\shows different fields > by other fields changing? If you write some Javascript, yes. -- DR. --~--~-~--~~~---~--~~ You received this message because you

Re: Problem with Field errors

2009-03-28 Thread Daniel Roseman
On Mar 28, 4:14 pm, Jack Orenstein wrote: > My application needs to validate data from a from beyond the   > validation of Fields done by django. So in my form handler, I check   > Form.is_valid, and if that returns true, then I do my own validation.   > In case of errors, I

Re: First Django project - Admin question

2009-03-30 Thread Daniel Roseman
On Mar 30, 10:43 am, PhilE wrote: > Hi All: > > My first Django project is an app to manage a repository of > downloadable software. Individual downloads have a category > (multimedia, internet, office, etc, etc) assigned to them. Releases of > the repository are made at

Re: iterating over fields of a model

2009-03-31 Thread Daniel Roseman
On Mar 31, 4:54 pm, Filip Gruszczyński wrote: > I have a user profile class and I would like to iterate over all > defined fields and retrieve their values. For example if I had: > > class UserProfile: >   first_name = CharField(.. >   last_name = CharFiel(.. > > etc. > > I

Re: testing with a mock object

2009-03-31 Thread Daniel Roseman
On Mar 31, 7:39 pm, belred wrote: > i have a questions about mock objects.  i currently have a django view > function that calls a 2nd function.  this second function calls > urllib2.urlopen.   i was thinking about adding in a mock object so i > can get some better code

Re: Overriding ModelForm

2009-04-01 Thread Daniel Roseman
On Apr 1, 8:35 am, MrBodjangles wrote: > Hi All, > I know this is something very basic (perhaps even a typo), but the > code below gives an error: > > "    password = models.CharField(widget=PasswordInput()) > TypeError: __init__() got an unexpected keyword argument

Re: forming email body

2009-04-02 Thread Daniel Roseman
On Apr 2, 2:58 am, Joey Gartin wrote: > Newbie question: > > In a view I am sending out a few emails to users.  The email format is > identical for each user, with the users information being dynamic. > > My question is regarding forming a long email and using it as the

Re: Django Tutorial, Part 3

2009-04-02 Thread Daniel Roseman
On Apr 2, 8:35 am, rorocam wrote: > Hello …, > > I have problems with the „Decoupling the URLconfs”. I did, as Django > Tutorial (Part 3) shows me, but it does not work, the browser shows > following error: > > > ImportError at /polls/ > > Import by filename is

Re: Unique Field Combinations

2009-04-04 Thread Daniel Roseman
On Apr 4, 2:06 pm, Chris wrote: > How would you enforce a unique column constraint on a combination of > fields? > > For example, say I have the model: > > class Company(models.Model): >     name = models.CharField(unique=True) > > class Article(models.Model): >     company

Re: Getting id of item before it recorded (or something else to solve my problem)

2009-04-05 Thread Daniel Roseman
On Apr 5, 11:38 am, MiratCanBayrak wrote: > here, i have a function that used as a upload_to parameter in my > model. But i records my pic as screenshot_None.gif. Becouse id is > appearing when it is recorded. How can i record my images as > screenshot_id.gif ?? thanks

Re: Problem with adding new columns to existing model.

2009-04-05 Thread Daniel Roseman
On Apr 5, 11:26 am, zayatzz wrote: > Hello > > After finishing tutorial im trying to do something for myself. I > created one model and proceeded to create another ones, but then i > realised that i could just add few additional columns to existing > model, but for

Re: Why is mod_python the preferred setup for Django?

2009-04-05 Thread Daniel Roseman
On Apr 5, 12:22 pm, Continuation wrote: > According to > thishttp://docs.djangoproject.com/en/1.0/howto/deployment/modpython/ > "Apache with mod_python currently is the preferred setup for using > Django on a production server." > > What is the advantage of mod_python

Re: How can I filter query sets in a django template?

2009-04-05 Thread Daniel Roseman
On Apr 5, 8:49 pm, codecowboy wrote: > I posted a question earlier today about circular imports (http:// > groups.google.com/group/django-users/t/6119e979131c8c25).  I now have > a follow question to that.  I've got the following view logic. > > def portal(request): >    

Re: Deploying django application

2009-04-05 Thread Daniel Roseman
On Apr 5, 10:04 pm, Oleg Oltar wrote: > Hi! > > I am trying to serve my project using server-spawned processes > > I created file .htaccess in my web_root directory which contains: > AddHandler fastcgi-script .fcgi > RewriteEngine On > RewriteCond %{REQUEST_FILENAME} !-f >

Re: Django Template Question

2009-04-06 Thread Daniel Roseman
On Apr 6, 6:38 am, codingJoe wrote: > Up front, I'm not the most elegant coder, so please forgive. > >   I have a page that is produced using django templates.   I used the > templates to do the header and footer, but now I'm down into the body > of the page.   Using the data

Re: Stuck in Tutorial Part 2: can't find django/contrib/admin/templates

2009-04-07 Thread Daniel Roseman
On Apr 7, 7:42 pm, "ab3...@gmail.com" wrote: > I'm working through the tutorial and got stuck near the end of part 2. > It says: > > "Now copy the template admin/base_site.html from within the default > Django admin template directory (django/contrib/admin/templates) into > an

Re: Does anyone know how to prepopulate a form with model data

2009-04-09 Thread Daniel Roseman
On Apr 9, 2:55 am, codecowboy wrote: > I want to create a form that allows a user to edit his/her profile.  I > don't want to bind my form to a model because the form will involve > two different models.  Does anyone have any ideas.  I've read chapter > 7 in the Django Book

Re: Problem setting up Admin site per chapter 6

2009-04-09 Thread Daniel Roseman
On Apr 9, 1:02 pm, Xpineapple wrote: > Thanks for the reply.  Again, my goal is just to access admin site > successfully. > > Okay, referencing:http://www.djangobook.com/en/1.0/chapter06/ > > My urls.py: > > from django.conf.urls.defaults import * > # Uncomment the next two

Re: Running Django admin site using Lighttpd

2009-04-09 Thread Daniel Roseman
On Apr 9, 3:35 pm, Karim Hamdan wrote: > Let me rephrase my question. I followed > thisHowTo > on this group that describes how to run Django using lighty with fcgi, > I can access my project website

Awkward Password Requirements

2009-04-09 Thread Daniel Watkins
Hello all, I'm currently working on an implementation of the server-side of an already-defined protocol. So, no, I can't do things differently. :) The protocol performs authentication by passing a token which is "md5(md5(password) + timestamp)" and the timestamp. I then need to calculate the

Re: Registration form and Profile form is not saving

2009-04-11 Thread Daniel Roseman
On Apr 11, 3:55 pm, Praveen wrote: > Hi all, i am really fed up and have tried number of way. Please read > my last line which really describe where i am facing problem. > First Attempt. > Problem:Data is saving for register and contact but for profile i get >

Re: Cannot call a custom model method in my view

2009-04-11 Thread Daniel Roseman
On Apr 11, 9:25 pm, codecowboy wrote: > I've read some other posts regarding this issue as well as the > following article:http://www.b-list.org/weblog/2007/nov/03/working-models/. > I cannot seem to get this thing to work.  Thank you in advance for any > help.  Here is my

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Daniel Roseman
On Apr 11, 8:42 pm, adelein wrote: > Hi, > > Myhttp://localhost:8000/adminpage is hanging in the django server > and I get "Error 320 (net::ERR_INVALID_RESPONSE): Unknown error." > after a while. > > I am running on fedora 7. > > I am following the django tutorial and I am

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Daniel Roseman
On Apr 11, 7:57 pm, codecowboy wrote: > Every time that a load a form on my site, I see the following errors. > If I reload the page, they go away and everything works just fine. > Does anyone know why?  Thank you in advance. > > TemplateSyntaxError at /eaccounts/register/ >

Re: Cannot call a custom model method in my view

2009-04-13 Thread Daniel Roseman
On Apr 11, 11:10 pm, codecowboy <guy.ja...@gmail.com> wrote: > Thank you Daniel.  I got it working.  That link that you gave me > helped me to figure it out.  I'm curious though, is there ever a > reason in Django to define a method in a model class or would I always > use a cus

Re: Registration form and Profile form is not saving

2009-04-13 Thread Daniel Roseman
On Apr 13, 5:57 am, Praveen wrote: > How the current user logging-in first while registration.. you mean to > say after successfully registration the user must login automatically. Well, you haven't explained the user flow at all here. But I assume that it's the

Re: Custom Model Fields / Multi-table inheritance / get_db_prep_value / postgresql_psycopg2

2009-04-13 Thread Daniel Roseman
On Apr 13, 7:25 pm, gordyt wrote: > Howdy Folks, > > I have been testing model inheritance using models that have UUIDField > primary keys.  It appears that when you save a new instance of a child > model, the framework is not calling get_db_prep_value() to convert the >

Re: Multiple sites, single application in Django

2009-04-13 Thread Daniel C
Russell, I am working through something similar and I think that the basic structure would be to have project folders for each site plus a folder for your shared applications (whose models use the 'Site' object and 'CurrentSiteManager'. Something like this: /home/django/sharedapps/

Re: textarea in ModelForm

2009-04-14 Thread Daniel Roseman
On Apr 14, 8:51 pm, grimmus wrote: > Thanks for the reply Alex, > > I am not really sure how i am supposed to override the default field > type. > > The link talks about MyDateFormField() but is this a method or what ? > > Could you provide an example of how i could put

Re: Grasping apps / projects and shared data

2009-04-14 Thread Daniel Roseman
On Apr 14, 9:47 pm, Leon wrote: > Hello! > > I'm new to django so far I like it, but I've now reached my first big > hurdle. > > I'm building a page which has a cms in the root, which shows the main > menu, and submenu of the site, > but then I have a blog app and a gallery app

Re: Trying to wrap my head around nested regroups or other ways to handle ordered ForeignKey stuff

2009-04-14 Thread Daniel Roseman
On Apr 14, 6:11 pm, Kevin Cole wrote: > Hi, > > First let me say I've looked at documentation, but feel a bit dyslexic > when it comes to this stuff. > > The situation: I have three tables: a service provider table with > city, state abbreviation and country abbreviation

<    1   2   3   4   5   6   7   8   9   10   >