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 %} > > {{ archive.da

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 drop-dow

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 = mod

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 tabl

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 > order, get chosen by the user

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-15 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 defi

Re: Creating users?

2008-09-16 Thread Daniel Roseman
On Sep 16, 7:37 am, Rodney Topor <[EMAIL PROTECTED]> wrote: > The User Authentication docs say "The most basic way to create users > is to use the create_user() helper function...".  But I can't see in > the docs a description of a less basic / more sophisticated way to > create users.  For exampl

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 r

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 m

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] > > e

Re: Import error: Model based on another model

2008-09-16 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" line breaks my app. I've tried severa

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 th

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 = models.ForeignKey(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 displa

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 e

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 is

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-22 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 sectio

Re: Changing field error messages

2008-09-22 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: 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 it as you can see >

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

2008-09-23 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 prev

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 is

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 wa

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 > model.

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 informati

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: adding date to template

2008-10-06 Thread Daniel Roseman
On Oct 6, 5:48 am, KillaBee <[EMAIL PROTECTED]> wrote: > I have been trying to add date to my template, but for the life of me > have not. > > I have a field in the MYSQL db, and In my models class but when I put > the text box it doesn't post to the db.  No field does. And the > calendar does sho

Re: varible reference in template problem

2008-10-06 Thread Daniel Roseman
On Oct 6, 12:46 pm, Stephen Cheng <[EMAIL PROTECTED]> wrote: > Hi django friends > > I got a problem with varible reference in template. the case is like > this: > > I pass a map to a template, I am trying to get map[key], in the case > the key= modelA.id, then I have to use map.modelA.id, then it

Re: static html

2008-10-08 Thread Daniel Roseman
On Oct 8, 9:32 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to show a static html page... > > The html page is in the /media folder. > > I've some problem with view funcition: > > def list_commands(request): >     commands = >     return HttpResponse(commands) >

Re: array grouping in templates

2008-10-11 Thread Daniel Roseman
On Oct 11, 7:58 am, jhf555 <[EMAIL PROTECTED]> wrote: > I have an array and I want to use Django templating to display each > item in a table, grouped by 3 per row. > For example, if i have >   arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] > Then I'd want it to show up as > >   abc >  

Re: Weird errors when i transfer from production to local ...

2008-10-12 Thread Daniel Roseman
On Oct 12, 8:46 pm, dbee <[EMAIL PROTECTED]> wrote: > I'm bringing my django code base from production server to a clean > install on development. The environments are different, but I'm > getting some very strange errors that I don't seem to be able to > figure out ... I was wondering if anyone h

Re: Virtual Methods?

2008-10-13 Thread Daniel Roseman
On Oct 13, 12:16 pm, DrMeers <[EMAIL PROTECTED]> wrote: > I am writing a Blog-style django site which needs to render a > collection of Item objects. Item is the root Super class for a whole > bunch of sub-classes -- Photo, Video, Quote, News, etc. I want to be > able to iterate through Item.objec

Re: static html

2008-10-13 Thread Daniel Roseman
On Oct 13, 12:12 pm, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > > First of all, why don't you just point the browser at the URL of the > > commands.html file in the first place? > > at the URL? > > In urls.py? > > Alfredo No, nothing to do with Django at all. If it's a static HTML file,

Re: Best Practices in Implementing Mini-Content Boxes Across the Site

2008-10-13 Thread Daniel Roseman
On Oct 13, 9:38 am, raeldc <[EMAIL PROTECTED]> wrote: > Hi Guys, > > I'm a Programmer coming from a Joomla! CMS background ( I develop > Joomla extensions). I took notice of Django when I'm looking for other > alternatives to build mission critical Web Apps, because it's clear to > me that Joomla

Re: modelForm

2008-10-14 Thread Daniel Roseman
On Oct 14, 5:37 pm, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > I've setup a form from a model: > > class PlayerForm(ModelForm): >     class Meta: >         model = Player > > I've setup a view function for save the data inserted in the form: > > def setup_player(request): >     if request

Re: how to assign a value to a model object field

2008-10-15 Thread Daniel Roseman
On Oct 15, 12:54 pm, Lenny <[EMAIL PROTECTED]> wrote: > Hi! > How can I assign a value to a model object field where the field name > in a string? setattr(model_name, field_name, value) -- DR. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: How to pass a string to a custom filter?

2008-10-15 Thread Daniel Roseman
On Oct 15, 9:29 am, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote: > bruno desthuilliers ha scritto:> On 15 oct, 09:40, Mirto Silvio Busico > <[EMAIL PROTECTED]> wrote: > > >> Well, a little step ahead: the filter receives an empty string. > > >> In the template the line: > >>     {{ request.path

Re: Query over multivalue relationships

2008-10-15 Thread Daniel Roseman
On Oct 15, 5:32 pm, Katja Loeffler <[EMAIL PROTECTED]> wrote: > Hi, > > I am relatively new to Django and I have a small problem making a query > over the following Models ... > > class GeographicTemporalCoverage(models.Model): >    beginning_temporal_coverage_date = models.DateField() >    ending

Re: manage.py tab completion

2008-10-15 Thread Daniel Roseman
On Oct 14, 11:49 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Depending on your site's setup, there is a variety of extra manage.py > > commands that could be available. Is it possible to set up tab > > completion on these commands? for example: > > > ./manage.py syn

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread Daniel Roseman
On Oct 15, 7:38 am, Chris Amico <[EMAIL PROTECTED]> wrote: > I have a simple bookmarks model based on the one in James Bennett's href="http://code.google.com/p/cab/source/browse/trunk/models.py? > r=130">Cab application. I'm using a generic relation so it can > live in its own app and a user can

Re: Populating form from existing model

2008-10-15 Thread Daniel Roseman
On Oct 15, 2:22 am, Adam <[EMAIL PROTECTED]> wrote: > I have a model called "myRegion" defined like so: > > class myRegion(models.Model): >         area = models.CharField(max_length=50, blank=False) >         state = models.CharField(max_length=2, blank=False) > >         def __unicode__(self): >

Re: Query over multivalue relationships

2008-10-15 Thread Daniel Roseman
On Oct 15, 7:11 pm, "Katja L." <[EMAIL PROTECTED]> wrote: > > DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date__year__lt=max_year).order_by('dataset_id_nr') > > Thanks a lot :)! > This helps more or less ;), because now I get a Field Error I don't

Re: newforms question

2008-10-17 Thread Daniel Roseman
On Oct 17, 5:50 pm, Jeff Gentry <[EMAIL PROTECTED]> wrote: > > Oops. It could also read > >     from django import newforms as forms > > in which case you should change it to > >     from django import forms > > Right, that's what I was thinking. > > > but I hope you've got the idea: basically new

Re: Console output

2008-10-19 Thread Daniel Roseman
On Oct 19, 7:05 pm, Bob Cowdery <[EMAIL PROTECTED]> wrote: > This is probably staring me in the face but I can't figure out how to > turn off the HTTP console output on the built-in server. I have an Ajax > poll running and this output is slowing things down. > > Thanks > Bob Quite simply, you sh

Re: ModelForm fails with TypeError on save

2008-10-20 Thread Daniel Roseman
On Oct 20, 11:12 am, simong <[EMAIL PROTECTED]> wrote: >         if request.method == 'POST': >                 orderform = OrderForm(request.POST) >                 if orderform.is_valid(): >                         preorder = orderform.save(commit=False) >                         orderno  = '%04

Re: Strange problem with 'syncdb' not finding application models

2008-10-20 Thread Daniel Roseman
On Oct 20, 12:26 pm, Will Boyce <[EMAIL PROTECTED]> wrote: > I was throwing together a (supposedly quick!) project today to gather > some information from customers, however I hit a stumbling block a > while back and I now feel like I'm banging my head on a brick wall.. > > I've modified the syncd

Re: Assigning to foreign key relationships with only the pk

2008-10-20 Thread Daniel Roseman
On Oct 20, 6:07 pm, "Andy Lei" <[EMAIL PROTECTED]> wrote: > Sorry if this is a repost, i don't think my last message got through: > I have two models: > class Reporter(models.Model): >     pass > > class Article(models.Model): >     reporter = models.ForeignKey(Reporter) > > Let's say I have the p

Re: Feature like "acts_as" in Django ORM or contrib ?

2008-10-20 Thread Daniel Roseman
On Oct 21, 6:45 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > Are there something in Django ORM or contrib to do "acts_as" like in > RoR or Elixir (SqlAlchemy). Example : > > http://elixir.ematia.de/apidocs06/elixir.ext.htmlhttp://elixir.ematia.de/apidocs06/elixir.ext.list.html > >

Re: render_to_response failed to render media files in base.html

2008-10-20 Thread Daniel Roseman
On Oct 21, 4:26 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Mon, Oct 20, 2008 at 9:30 PM, Chuck22 <[EMAIL PROTECTED]> wrote: > > Adding context_instance=RequestContext(request) to the method fixed > > the problem. Seems this should be done by default for > > render_to_response method. Than

Re: In URL dispatcher, is there a way to pass values of Named Groups directly to template?

2008-10-20 Thread Daniel Roseman
On Oct 21, 4:12 am, "yuanyun.ken" <[EMAIL PROTECTED]> wrote: > Hi,all great Django users and developers, I have a little problem. > In URL dispatcher, is there a way to pass values of Named Groups > directly to template, don't want to write a view function just for > this. > for example, I have th

Re: Created Form - now code works to edit object but add gets NoneType' object is not callable

2009-01-15 Thread Daniel Roseman
On Jan 15, 5:35 pm, Peter Bailey wrote: > I have just recently started using forms. I was avoiding them because > I thought they were not very DRY, but discovered I need them for added > flexibility such as displaying field lengths for example. > > Anyway, I have created a Form for a Survey objec

Re: Empty object list!!!

2009-01-16 Thread Daniel Roseman
On Jan 16, 12:45 pm, Gath wrote: > Guys, > > I might be lazy or am blind! but the following code is returning ZERO! > items, while very well i know there is some items in the list, > > View: > def post_answer(request, quest_id=None): >     answer_list = Answer.objects.filter > (questionis__pk=que

Re: Installing the development version of Django on Windows XP - Environment Variable?

2009-01-16 Thread Daniel Roseman
On Jan 16, 7:03 pm, Ty wrote: > Follow-up question: > I have a project that was created using the 1.0.2 version. Is it a > good idea to basically recreate the project and apps using the newest > version of the django-admin.py file, and then migrate the code over? > I'm assuming so. No, there is

Re: ForeignKeys and select_related

2009-01-17 Thread Daniel Roseman
On Jan 17, 3:35 pm, cptnwinky wrote: > Thanks once again Karen. Could you throw me a bone though and explain > how I extract the instance? I'm rather new to python and django; I > come from a PHP background so I'm used to results from a db being > rather straightforward. > > Thanks, > > Dave res

Re: Django 1.0.2 runfcgi fails to start on Windows

2009-01-17 Thread Daniel Roseman
On Jan 17, 6:44 pm, Jon Prater wrote: > Hi, all. > For various reasons, I prefer to use python 2.6 on my computer.  Since > mod_python and mod_wsgi won't work on Python 2.6, I have to use FCGI > or switch to Python 2.5.  I have flup installed without any problems. > However, when I try to run thi

Re: unable to import django.forms.formsets

2009-01-17 Thread Daniel Roseman
On Jan 17, 5:59 pm, Atishay wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" > wrote: > > What version of Django are you using? > > 0.96 version > > if it does not have formset then how can we do something like formset > without defining multiple forms in forms.py Upgrade to 1.02. Seriousl

Re: Check if user is in a list

2009-01-18 Thread Daniel Roseman
On Jan 18, 12:43 pm, Darthmahon wrote: > Hey Guys, > > I've got a model like this: > > event   = models.ForeignKey(Event) > user            = models.ForeignKey(UserProfile) > user_2  = models.ForeignKey(UserProfile, related_name='user_2') > > I then get a list of all the invites: > > people_invit

Re: Pre-filling form data without submission?

2009-01-20 Thread Daniel Roseman
On Jan 20, 12:56 pm, "shogunm...@googlemail.com" wrote: > Hi Thomas, > > Thanks for your quick reply! > > I had a look at the docs, but it seems I have to enter the initial > values at the Form definition level. However, I am interested in > entering dynamic data depending on who is viewing the f

Re: Multiple static media roots?

2009-01-24 Thread Daniel Roseman
On Jan 24, 2:43 pm, John Baker wrote: > > write a custom file > > storagehttp://docs.djangoproject.com/en/dev/topics/files/ > > Thanks. However, I know I can store them somewhere else but my problem > is serving them up again in the local development environment. The > django.views.static.serve

Re: Adding a slug

2009-01-24 Thread Daniel Roseman
On Jan 24, 12:49 pm, Kless wrote: > I want to add a new field --slug-- to tables where any data is being > used in the URL > > I dumped all data, added that new field > -- > slug = models.SlugField(_('slug')) > -- > > And I created a hook to save it. > -- > def save(self):

Re: Access to Settings

2009-01-24 Thread Daniel Roseman
On Jan 24, 3:28 pm, nosrednak...@gmail.com wrote: > Hello Django Users, > > I am writing an application that needs to do some 'advanced' SQL to update   > some tables. I am curious about the best way to lock tables and make the   > transaction safe. The solution I wrote for a Quick and dirty is: >

Re: undefined in Textarea

2009-01-25 Thread Daniel Roseman
On Jan 25, 7:51 pm, issya wrote: > I am making a modelform that looks like the below. > > class ContactForm(forms.ModelForm): >         name = forms.CharField(widget=forms.TextInput(attrs= > {'class':'required'})) >         phone = forms.CharField(widget=forms.TextInput(attrs= > {'class':'require

Re: Generic View Not Returning Objects

2009-01-25 Thread Daniel Roseman
On Jan 25, 9:54 pm, "ben.bleik...@gmail.com" wrote: > I am having an issue with Django 1.0.2 returning a list of blog posts > in my generic date based archive_index view. > > My URLs file looks like this: > > #Dictionaries > blog_dict = { >         'queryset': Entry.objects.all(), >         'date

Re: TINYMCE causing form error "This field is required."

2009-01-26 Thread Daniel Roseman
On Jan 26, 5:22 am, "Eric I.E." wrote: > When I add TinyMCE to my form fields it turns them from optional > (blank=True, null=True) into required fields. > I am using django-tinymce in conjunction with django-filebrowser. > > My field is defined in models.py like this: > column1 = models.TextFiel

Re: mergin svn diff

2009-01-26 Thread Daniel Roseman
On Jan 26, 2:42 pm, Erik Bernoth wrote: > Hi guys, > > We want to experiment with some of the django development processes in > our projects, too. So I tried to create .diff-files and merge them > into another repository to keep my working trunk clean from patches > and new features, that are not

Re: could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread Daniel Roseman
On Jan 26, 1:55 pm, Rama wrote: > i have a standalone python script which uses a django module. i need to > schedule  that script using crontab. > while doing this i encountered the following problem > > 1) the above standalone python script  which uses django module is running > properly on the

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread Daniel Roseman
On Jan 26, 3:16 pm, PeteDK wrote: > Hi there :) > > first the code: > > forms: > class ProfileForm(forms.Form): >         ... >         image = forms.ImageField(required = False) > > models: > class Profile(models.Model): >         user = models.ForeignKey(User, unique=True) >         >    

Re: Joining Multiple models in same admin section

2009-01-26 Thread Daniel Roseman
On Jan 26, 6:22 pm, "alant...@neei.uevora.pt" wrote: > Hello, > > I have different models spread in some apps that are all related. Is > it possible do put them in the same section in admin? > > example: > coach: coach, coach_data, coach_things, coach_xxx > player: player, player_data, player_aa,

Re: Unicode error

2009-01-26 Thread Daniel Roseman
On Jan 26, 8:08 pm, Oleg Oltar wrote: > Hi. > I want to use django admin, for adding articles into my db. My language is > Russian. > > I defined model in the following way: > > from django.db import models > from tinymce import models as tinymce_models > > class Article(models.Model): >     titl

Re: I want to change widget in admin

2009-01-27 Thread Daniel Roseman
On Jan 27, 10:54 am, Mirat Can Bayrak wrote: > I am drown in documentation. I want to do simple thing. There is a > ShortDescription model in my app, which has string = > models.CharField(max_length=300), but i want to show it as in my > admin panel. > > I tried some, here > > class ShortDesc

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-27 Thread Daniel Roseman
On Jan 27, 9:11 pm, "Rodrigo C." wrote: > I have model that represents a file, and has a FileField, that I am > rendering via an Inline Formset. When a user fills in the form it gets > saved with no problems. > However, I want the users to be able to continue editing the file, but > when I re-dis

Re: error when using delete generic views

2009-01-28 Thread Daniel Roseman
On Jan 29, 7:02 am, vierda wrote: > dear all, > I have problem when using delete_object generic views, the code always > raise error delete_object() takes at least 3 non-keyword arguments (0 > given) but I think I have provided 4 arguments. my code as per below. > Thank you for any kind help. > >

Re: pb synchronize database to django

2009-01-29 Thread Daniel Roseman
On Jan 29, 9:07 am, arbi wrote: > Hi, > > I am a newb in Django and I find it very nice... But the current > problem is that, when I try to synchronize my models (using python > manage.py syncdb), an attribute that I changed did not change in my > database. For instance : > > class Route (model

Re: Admin screen counts correctly but returns no records

2009-01-29 Thread Daniel Roseman
On Jan 29, 12:00 pm, JonUK wrote: > I'm creating a new admin UI for User, separate to the standard admin > User interface - I have the following setup: > > class WebsiteUser( User ): >     class Meta: >         db_table = 'auth_user' > > class WebsiteUserAdmin( admin.ModelAdmin ): >     list_disp

Re: How to clear form from wrong data

2009-01-30 Thread Daniel Roseman
On Jan 30, 1:11 pm, Konstantin S wrote: > Hello! > > I believe this is a VERY basic question, that already covered > somewhere in the excellent django docs, but I couldn't find an answer > and therefor asking for some help. > In my view I have this request handler:http://dpaste.com/114650/. The >

Re: summary of two models+detailed view--how to structure?

2009-01-30 Thread Daniel Roseman
On Jan 30, 4:15 pm, Tim Arnold wrote: > Hi, I have two basic models for a book-production site: > book configuration > build reports > > I want to display information for a particular book so you can drill- > down from a summary of its configuration and build to a detailed view > of its configura

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-30 Thread Daniel Roseman
On Jan 30, 4:57 pm, Stewart wrote: > Hi. > > I have a subclass of Form with some of my own methods in it, what > would be the best way of getting those methods into a ModelForm > subclass. > > For example: > > class MyForm(forms.Form): >   def as_span(self): >     “format form in a html span” >  

Re: ModelForm and submitting a null value via JSONI

2009-01-30 Thread Daniel Roseman
On Jan 30, 10:01 pm, steve wrote: >  The problem is that the form validation fails. And it's because I'm > sending a blank string in the category field. This field, in the > Ingredient table, is null=TRUE, so I was expecting it to work. > class Ingredient(models.Model): >     name = models.Ch

Re: form_for_model

2009-01-30 Thread Daniel Roseman
On Jan 30, 11:44 pm, xankya wrote: > hi, I am using django.VERSION (1, 0, 2, 'final', 0). > > django.forms.form_for_model is not available in this version. can > anybody tell me what is the equivalent module name for > form_for_module ?? Create a ModelForm instead. See here: http://docs.djangopr

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-31 Thread Daniel Roseman
On Jan 31, 1:26 am, Malcolm Tredinnick wrote: > On Fri, 2009-01-30 at 12:19 -0800, Daniel Roseman wrote: > > [...] > > > This is an ideal case for mixins. A mixin is a basic class which is > > 'mixed in' to other classes, which inherit both the attributes of

Re: Merging results from two tables

2009-01-31 Thread Daniel Roseman
On Jan 31, 12:27 pm, Markus wrote: > Hi > > just starting to use Django, am stuck with the following problem: > > Given > > class A(models.Model): >     ...some fields... > > class B(models.Model): >    A = models.ForeignKey(A) >    some fields... > > I would like to generate a Queryset that

Re: Admin get_urls

2009-02-01 Thread Daniel Roseman
On Feb 1, 10:11 pm, Dave Fowler wrote: > I'm adding new views to my admin models.  The documentation is > here:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#get-urls-self > > and the following is my implementation ( I think the same thing ) > > from django.conf.urls.defaults import * >

Re: object_detail 404 (queryset outdated?)

2009-02-02 Thread Daniel Roseman
On Feb 2, 12:36 pm, Simon Westphahl wrote: > After some further investigation it seems this problem is related to > my custom manager. > > ### > class OfferManager(models.Manager): >     def get_query_set(self): >         return super(OfferManager, self).get_query_set().exclude > (start_date__gt=

Re: Customized model methods

2009-02-02 Thread Daniel Roseman
On Feb 2, 8:39 pm, Alex Jonsson wrote: > Dave, > > Thank you for your answer. Thing is, I already use django-tagging. > > I was a bit unclear: I'd like the function to return True or False, so > that I can run some logic on it based on that. When I use django- > tagging today the closest I can ge

Re: Admin get_urls

2009-02-02 Thread Daniel Roseman
On Feb 2, 7:52 am, Dave Fowler wrote: > Daniel, thanks for the response > > I'm on the latest svn version > > d...@django$ svn up > At revision 9803. > > so my version shouldn't be the issue. That doesn't necessarily prove you're on trunk - I checked out the 1.0 tag, and did svn up, and still ge

Re: problem with admin in a .90 site

2009-02-02 Thread Daniel Roseman
On Feb 2, 9:06 am, Kenneth Gonsalves wrote: > hi, > I have an old site running on revision 2486 - had not touched it for years and > since it wasnt broken nor needed new features, I did not upgrade it. A new > model was required, so I added it, but it was not appearing in sqlall > statement. The

Re: Admin get_urls

2009-02-02 Thread Daniel Roseman
On Feb 2, 10:44 am, Sven Broeckling wrote: > Hi, > > i also miss this function in trunk. I'm looking for a method to > populate the admin with own views. Is it possible that this feature > got > lost some time ago? Im at the latest trunk Version, but i can't fint > any line with get_urls in it in

Re: Redirect with reverse

2009-02-03 Thread Daniel Roseman
On Feb 3, 2:34 pm, Edgard Matos wrote: > Hello! > > I need help! > In my project, I need authenticate user in a module and sends user to > previews page. > > I was try so: > >   url_to_redirect = request.get_full_path() >       return HttpResponseRedirect(reverse('users.views.add', > args=(url_to

Re: Template Tag Not Rendering

2009-02-03 Thread Daniel Roseman
JimT wrote: > I've searched pretty much everywhere and I still can't get my simple > template tag working. > > It's supposed to simply return a list of strings which I can output in > a template for loop. Currently it takes no parameters but eventually > I'd like to pass it a string to format the

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