Re: referencing the slug of parent ('self')

2008-10-21 Thread Daniel Roseman
On Oct 21, 1:13 pm, coderb <[EMAIL PROTECTED]> wrote: > def category(request, myslug): >     category_list = get_list_or_404(Category, parent=myslug) get_list_or_404(Category, parent__slug=myslug) -- DR. --~--~-~--~~~---~--~~ You received this message because you

Re: Accessing Sessions in Custom Tags

2008-10-21 Thread Daniel Roseman
On Oct 21, 7:58 am, "Eugene A." <[EMAIL PROTECTED]> wrote: > Thanks for post, I searched this solve too long. > > But: > > I added in settings.py > TEMPLATE_CONTEXT_PROCESSORS = ( >          'django.core.context_processors.request', > ) > and it doesn't work, raises 'Failed lookup for key [request

Re: Timing is everything

2008-10-21 Thread Daniel Roseman
On Oct 22, 5:26 am, Info Cascade <[EMAIL PROTECTED]> wrote: > Hey, > > I'm new to Django.  Be nice! > Is there some simple way to time the whole Django process, request to > response? > PHP has something like that. > I'd like to include that information in the response. > > Any ideas? > > Liam Yo

Re: Spliting a single result from a db

2008-10-22 Thread Daniel Roseman
On Oct 22, 9:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > HI all, > > > I've just starting using django and am really impressed. In my simple > > app I want to retrieve a single "article" from a  db and then display > > it broken into reasonable length pages (either based on word coun

Re: order of apps in the admin panel

2008-10-25 Thread Daniel Roseman
On Oct 25, 11:23 am, patrickk <[EMAIL PROTECTED]> wrote: > unfortunately, I don´t think there is. stuff like this doesn´t seem to > be important enough for the django developers. guess you just have to > accept that (and shake your head). Or, since this is an open-source project, open a ticket an

Re: Models not validating

2008-10-25 Thread Daniel Roseman
On Oct 25, 4:09 pm, AdamC <[EMAIL PROTECTED]> wrote: > Thanks Manuel - even if I take that out, I'm still getting the error: > > Error: One or more models did not validate: > tables.pupil: Reverse query name for m2m field 'result' clashes with > m2m field 'Result.pupil'. Add a related_name argumen

Re: Urlconf page not found question

2008-10-26 Thread Daniel Roseman
On Oct 26, 1:23 pm, ehpmail <[EMAIL PROTECTED]> wrote: > My URLconf has the following urls: > >    1.  ^admin/(.*) >    2. ^$ >    3. ^popular/$ >    4. ^user/(\w+)/$ >    5. ^tag/([^s]+)/$ >    6. ^tag/$ >    7. ^search/$ >    8. bookmark/(\d+)/$ >    9. ^login/$ >   10. ^logout/$ >   11. ^regist

Re: is there ANY way to use two different models with the same name for model upgrades?

2008-10-26 Thread Daniel Roseman
On Oct 26, 6:32 am, mlojo <[EMAIL PROTECTED]> wrote: > Hi. > > I started my app with version 0.96 knowing that I would want to add > new features and that I would eventually want to redesign my models > with inheritance when it became available.  Because of this, I've > created a layer of abstra

Re: Getting a NameError: global name 'Lesson' is not defined

2008-10-28 Thread Daniel Roseman
On Oct 28, 7:32 am, Daniel Strasser <[EMAIL PROTECTED]> wrote: > Hello Djangonauts, > > I get a NameError and I don't know why, I'm really getting mad. What I > want to do is to list the number of Lessons a Student has passed. > > My schoolutil/student model looks like this: > > from django.db imp

Re: Template syntax question

2008-10-28 Thread Daniel Roseman
On Oct 27, 10:04 pm, Robocop <[EMAIL PROTECTED]> wrote: > So i'm looking to have an admin controlled news list, and one thing in > particular i'd like them to be able to control is how many headlines > are shown on the front page, and my current code is not doing that. > > The line i care about is

Re: ifequal and numbers

2008-10-28 Thread Daniel Roseman
On Oct 27, 10:36 pm, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > There is a method for write this, without write a loop: > > {% ifequal apple.number <20 %} > .. > {% endifequal %} > > Alfredo On Oct 27, 11:52 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote: > You would prob

Re: Filtering QuerySet (exclude)

2008-10-28 Thread Daniel Roseman
On Oct 28, 9:33 am, janedenone <[EMAIL PROTECTED]> wrote: > Hi, > > I need to exclude certain elements from a QuerySet. My models look > like this (simplified): > > class Author(models.Model): >         first_name = models.CharField(max_length=90, blank=True) >         last_name = models.CharField

Re: edit_inline does not save?

2008-10-28 Thread Daniel Roseman
On Oct 28, 10:47 am, Daniel Austria <[EMAIL PROTECTED]> wrote: > Hello, > > i got a huge problem. I have got an Idea class and an ideacomment > class. You can guess what these classes are used for. What i do is the > following: > > - the ideacomment class has an foreignkey > - this foreignkey is m

Re: Admin page customization for a single model

2008-10-28 Thread Daniel Roseman
On Oct 28, 9:34 pm, Fabio Natali <[EMAIL PROTECTED]> wrote: > Hi everybody! > > I need to add a link to the admin page of one of my models. [0] > provides a step-by-step explanation on how to get this. > > The point is that, contrarily to the docs statement, that procedure > will modify the "chang

Re: sql query to insert into table

2008-10-29 Thread Daniel Roseman
On Oct 29, 10:26 am, limas <[EMAIL PROTECTED]> wrote: > hello > > i am new in django. > i want to insert values into two tables from a single form. > i think ModelForm didnot work for this. > Can i use raw sql query to insert into tables. i am using mysql and > latest subversion of django. > > ple

Re: Adding properties to models at run-time.

2008-10-30 Thread Daniel Roseman
On Oct 30, 8:11 pm, Alex G <[EMAIL PROTECTED]> wrote: > Hi, > > I've been trying for some time to create a polymorphic link with a > backwards-link from the associated model.  The problem is the model is > django.contrib.auth.models.User...  Is there any way to add this > functionality without cha

Re: Adding properties to models at run-time.

2008-10-31 Thread Daniel Roseman
On Oct 30, 10:13 pm, Alex G <[EMAIL PROTECTED]> wrote: > Thanks for the reply, DR. > > How would I use the generic relationship without the backward link? > > I have the normal auth.user class, and I have the my.user class that > extends it and has a polymorphic link pointing at auth.user.  The >

Re: User.email

2008-10-31 Thread Daniel Roseman
On Oct 31, 9:51 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > Hi, > > I've this model: > > from django.contrib.auth.models import User > > class Player(models.Model): >     first_name = models.CharField(max_length=30) >     last_name = models.CharField(max_length=40) >     email = models

Re: Accessing Model field from ModelForm?

2008-11-01 Thread Daniel Roseman
On Nov 1, 5:33 am, killsto <[EMAIL PROTECTED]> wrote: > I have a basic form that shows what a person entered when it is > submitted.  However, it shows up as a form.CharField (textbox) instead > of model.CharField. Is there a way to access the model's saved data > from the Forms? Also does form_fo

Re: Python package names

2008-11-02 Thread Daniel Roseman
On Nov 3, 4:58 am, stryderjzw <[EMAIL PROTECTED]> wrote: > HI, > > This is semi-off topic, but it is a python question. > > I'm trying to use some of the generic django applications, like django- > tagging. Taking django-tagging, for example, it requires me to symlink > the source folder to "site-

Re: Python package names

2008-11-03 Thread Daniel Roseman
On Nov 3, 7:47 am, stryderjzw <[EMAIL PROTECTED]> wrote: > Hmm, I tried django_tagging, but it still gives me ImportErrors.  I > think it's because, for django-tagging project, they internally look > for tagging as the package name. Yes I realised that after I posted - sorry. There's nothing to

Re: Update a a single field

2008-11-03 Thread Daniel Roseman
On Nov 3, 1:41 pm, "darryl.hebbes" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to do something like this, I wish to make the 'fieldname' > dynamic, I am just trying to update a field without a hard coded > name... the name is passed in via  a form. > > --- > def updateProfile(request):

Re: Basic SQL

2008-11-04 Thread Daniel Roseman
On Nov 4, 7:45 am, Tonne <[EMAIL PROTECTED]> wrote: > I think I may be barking up the wrong tree, and if so please excuse > the above. I now suspect that I should be associating the images with > their relevant entries with template tags. You don't even need to do that. Assuming you have a querys

Re: num_in_admin equivalent in newforms

2008-11-04 Thread Daniel Roseman
On Nov 4, 5:57 pm, Xiong Chiamiov <[EMAIL PROTECTED]> wrote: > I'm in the process of converting a bunch of sites from pre-nfa to > 1.0.  One of the things I've run across is the change in inlines in > the admin interface.  Previously, there was > (http://www.djangoproject.com/documentation/0.96/m

Re: Basic SQL

2008-11-04 Thread Daniel Roseman
On Nov 4, 9:50 am, Tonne <[EMAIL PROTECTED]> wrote: > Daniel, thank you (x100)! That was exactly what I was looking for. > > > {% for entry in entries %} > > {{ entry.title }} > >     {% for image in entry.image_set.all %} > >     > >     {% endfor %} > > {% endfor %} > > Now, could I ask what th

Re: Select only two posts from a database list and show them on a HTML page

2008-11-05 Thread Daniel Roseman
On Nov 5, 11:34 am, Bobo <[EMAIL PROTECTED]> wrote: > Hi everyone, > > In my Django project I’ve on the front page a table where I wish to > load the two newest messages. Then I’ve a link to a message archive > where all messages are listed. > > My problem is that I don’t know how to “filter” my l

Re: Multiple saves without redirecting

2008-11-05 Thread Daniel Roseman
On Nov 5, 3:54 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > I want to create a form for a large object that has numerous non- > mandatory fields. I am still learning django, and am missing something > easy I hope. All the examples and docs I see say to redirect after the > form is posted and save

Re: Model ForeignKeys to other Models

2008-11-06 Thread Daniel Roseman
On Nov 6, 8:20 am, joshuajenkins <[EMAIL PROTECTED]> wrote: > Thanks for the reply. I'm not new to Python so much as I'm overwhelmed > fairly often by all the jargon, but I'm wading my way through it. > Thanks for the link. > > I added the import as you suggested to my model and for some reason >

Re: Model ForeignKeys to other Models

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:27 am, Håkan Waara <[EMAIL PROTECTED]> wrote: > 6 nov 2008 kl. 10.05 skrev Daniel Roseman: > > > The problem is not with the imports (you were fine with the original > > method - in fact I'd recommend it, to avoid any future problems with > &

Re: Getting a relationship using double underscores

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:25 am, gv <[EMAIL PROTECTED]> wrote: > Hello > > What I want to achieve is the equivalent of this: > select * from server, backup where backup.serverid=server.id and > servername={backupserver} > > To do that the django way is proving challenging, maybe because the > database was an e

Re: Help regarding Decimal Field in models.py in Django

2008-11-06 Thread Daniel Roseman
On Nov 6, 10:32 am, "sadeesh Arumugam" <[EMAIL PROTECTED]> wrote: > Hi Friends, >     I'm a newbie to Django, i'm doing a registration form to be displayed in > Admin section. In my form i'm giving two fields namely latitude and > longitude and setting them as a DecimalField. My question how to se

Re: Getting a relationship using double underscores

2008-11-06 Thread Daniel Roseman
On Nov 6, 12:10 pm, gv <[EMAIL PROTECTED]> wrote: > On 6 Nov, 11:56, Daniel Roseman <[EMAIL PROTECTED]> wrote: > > > On Nov 6, 10:25 am, gv <[EMAIL PROTECTED]> wrote: > > > Well, you don't appear to have any foreign keys linking Backup and > > Ser

Re: setting an IntegerField = None???

2008-11-07 Thread Daniel Roseman
On Nov 7, 1:57 pm, PeteDK <[EMAIL PROTECTED]> wrote: > Hiii everybody... > > I am trying to create this class called "car". > In this car class i have an IntegerField "year". The thing is, this > field should not be required and therefor the user should not be > "forced" to enter anything into thi

Re: problem with inlineformset_factory

2008-11-07 Thread Daniel Roseman
On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm having a weird problem when using inlineformset_factory, he can > only register up to 2 records, after that causes a validation error > > "(Hidden field id) User phone with this None already exists." > > Here is my forms [1], mo

Re: sorting a list of model instances

2008-11-07 Thread Daniel Roseman
On Nov 7, 1:54 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Hi, > > I just discovered, that you can't sort a list of model instances. > > This failed with AssertionError: > >         view_groups=sorted([brg.group for brg in ... ]) >         change_groups=sorted([...]) >         if view_groups=

Re: Select a list item by index

2008-11-07 Thread Daniel Roseman
On Nov 7, 2:12 pm, jago <[EMAIL PROTECTED]> wrote: > I tried the slice solution before. Unluckily it returns a list itself > holding 1 item instead of the item itself. Most importantly though I > cannot use a variable like forloop.counter0 to select the item I want > but instead can only use stati

Re: Select a list item by index

2008-11-07 Thread Daniel Roseman
On Nov 7, 12:52 am, jago <[EMAIL PROTECTED]> wrote: > I have a for loop over a list A. > > inside the loop I want to print out the item of list B at the index > 'forloop.counter0' of list A. > > It is really strange. One can select randon items in a list, or the > first item in a list, but I did n

Re: getting request.user into a ModelForm?

2008-11-07 Thread Daniel Roseman
On Nov 7, 9:02 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > For example you can use `thread locals` to store there request object Really, don't. As James has posted here many times, this was only ever at best a horrible hack, and is now completely unnecessary. In response to the OP, I'm not

Re: Select a list item by index

2008-11-07 Thread Daniel Roseman
On Nov 7, 4:11 pm, jago <[EMAIL PROTECTED]> wrote: > Sure. > >                 {% for gallerykind in gallerykinds %} >                         >                                         {{ gallerykind.title }} > >                                         {% if gallerykind.author %} >              

Re: Using just one custom manager

2008-11-07 Thread Daniel Roseman
On Nov 7, 7:13 pm, John M <[EMAIL PROTECTED]> wrote: > I wanted to get some feedback on how I'm using custom model managers. > > I've put all my queries into one manager, each in a different method. > Is this the right way to go? > > So for example: > > CHOICES_TASK = ( >                         (

Re: None model error handling in view

2008-11-09 Thread Daniel Roseman
On Nov 9, 3:00 am, VP <[EMAIL PROTECTED]> wrote: > Hi all, > > How to handle errors from different modules, for example CSV or > DATETIME in view? > I am trying to parse CSV content in my view after an uplod a file by > user. > > def my_view(request): >     ... >     try: >         for row in csv.

Re: None model error handling in view

2008-11-09 Thread Daniel Roseman
On Nov 9, 12:28 pm, VP <[EMAIL PROTECTED]> wrote: > Unfortunatelly I don't know how to get that traceback. > If the exception happens from a model e.g. > > try: >     b = Blog.objects.get(id = 1) > except Blog.DoesNotExist: >     b = Blog(name = 'MyBlog') >     b.save() >     b = b.id > > It works

Re: No clue what to do !

2008-11-10 Thread Daniel Roseman
On Nov 10, 9:21 am, [EMAIL PROTECTED] wrote: > Hi, > > I get this error > AttributeError: type object 'CM' has no attribute 'fields' > and than > AlreadyRegistered: The model List is already registered > > I see no error in models.py or admin.py, please help. > > http://dpaste.com/hold/89667/http:

Re: Eager loading backward relationships

2008-11-10 Thread Daniel Roseman
On Nov 10, 7:18 am, vmihaylov <[EMAIL PROTECTED]> wrote: > Hello everyone, > I need to eager load an object along with any backward relationships > it has. > But I can't figure out how to do it. > Lets consider the example > fromhttp://docs.djangoproject.com/en/dev/topics/db/queries/ > What I wan

Re: Sync Database failed, using "python manage.py syncdb"

2008-11-10 Thread Daniel Roseman
On Nov 11, 1:18 am, Sean <[EMAIL PROTECTED]> wrote: > When I run the command "python manage.py syncdb" to sync database, but > failed > > I got the following error messages: > > File "C:\Python25\Lib\site-packages\django\contrib\auth\management > \_init_.py". line 47 , in > signals.post_syncdb.co

Re: Using Django

2008-11-10 Thread Daniel Roseman
On Nov 11, 6:52 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > It appears that the 500 error was a result of Dreamhost's process > watcher killing scripts. I'm still not sure where the problem is > originating from but coincidently I am now getting syntax errors from > django i.e., no 500 er

Re: Help saving form data

2008-11-11 Thread Daniel Roseman
On Nov 11, 4:46 pm, phred78 <[EMAIL PROTECTED]> wrote: > I see what you mean. But if I change the view: > > def ecard_preview(request): >     ecard_id = request.GET.get('ecard').encode('utf8') >     (...) > > So that it gets the value from the url: /ecards/preview/? > ecard=1&sender_name(...), I g

Re: passing css classes in forms

2008-11-11 Thread Daniel Roseman
On Nov 11, 3:05 pm, Bobby Roberts <[EMAIL PROTECTED]> wrote: > how can I assign form fields to certain css classes in django? See http://docs.djangoproject.com/en/dev/ref/forms/widgets/#customizing-widget-instances -- DR --~--~-~--~~~---~--~~ You received this me

Re: Help saving form data

2008-11-11 Thread Daniel Roseman
On Nov 11, 4:09 pm, phred78 <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to build a small Ecard app using Django but I've been > running into all sorts of problems and can't get around them. I was > hoping some of you more advanced programmers could give me a few > hints. > > These are my model

Re: Sort drop-down list in Admin module

2008-11-12 Thread Daniel Roseman
On Nov 12, 2:30 pm, Bobo <[EMAIL PROTECTED]> wrote: > Hi everyone, > > In my admin module I've some drop-down lists that extract data from my > database but the thing is that it sort the list from the Database ID > and not alphabetically, starting with A and continuing. > > I've search the Django

Re: Performing an operation

2008-11-12 Thread Daniel Roseman
On Nov 12, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, > Just building my first site with django and Ive hit my first snag that > I cant find in the documentation. > > Just as an example scenario, suppose I have my model- > > class User(models.Model): >     signup_date =  mod

Re: Upload Form does not validate

2008-11-12 Thread Daniel Roseman
On Nov 12, 5:52 pm, "Israel Fdez. Cabrera" <[EMAIL PROTECTED]> wrote: > Hi: > > I'm trying to upload some CSV file I need to import into a database; > to do so I have the following Django form: > > > > class CaptureEquipmentForm(forms.Form): >    area = forms.FileField() >    equipo = forms.FileF

Re: Django not detecting URL - only index.php

2008-11-15 Thread Daniel Roseman
On Nov 15, 9:37 am, NathanY <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to deploy my django project on a production server, but > Django always thinks the URL is index.php no matter what I put in. For > example, when I put in the URL: > > http://your.flowingdata.com/some_random_string > > I ge

Re: populating database model with form model

2008-11-16 Thread Daniel Roseman
On Nov 16, 6:43 pm, jtobe <[EMAIL PROTECTED]> wrote: > Hi, i wasn't sure whether i should ask this here or on the google app > engine list. > > I really have two problems. The first is, if i have a form that i > populate choices in a choicefield using entries in the database, it > only updates onc

Re: admin site problem

2008-11-17 Thread Daniel Roseman
On Nov 17, 12:41 pm, Vicky <[EMAIL PROTECTED]> wrote: > I found the problem.. I used : > >                             def __unicode__(self): > > function in my model. so it a can return only sting values. So if i > need to return a column of type integer or contains a foreign key how > should i d

Re: Frustration with custom Inline forms

2008-11-17 Thread Daniel Roseman
On Nov 17, 2:01 pm, Ben Gerdemann <[EMAIL PROTECTED]> wrote: > Ok, so I just noticed that the a55_id field which is the primary key, > was declared as an IntegerField instead of an AutoField which is why > it was showing up on the inline form, but I still can't get any of the > other fields exclud

Re: link to ForeignKey in Admin's change list page

2008-11-17 Thread Daniel Roseman
On Nov 17, 4:42 pm, Paolo Corti <[EMAIL PROTECTED]> wrote: > Hi > maybe this is trivial, but i can't find a way to get it (and from what > i can see it seems not possible): > > my model: > > class Project(models.Model): >         name = models.CharField('name', max_length=255) >         >    

Re: how to implement multiple choices in model

2008-11-17 Thread Daniel Roseman
On Nov 18, 2:56 am, Canhua <[EMAIL PROTECTED]> wrote: > hi, I am trying to create such a kind of field in a model. The field > can only take one or more values from a set of value, each seperated > by such as commas. It seems that there is no built-in field type in > Django. How may I implement th

Re: Can I perform calculations directly in django tags/filters?

2008-11-18 Thread Daniel Roseman
On Nov 18, 7:55 pm, jago <[EMAIL PROTECTED]> wrote: > I am thinking about something like {{  (width - 5) *12  }}  ? No. You can add or subtract using the 'add' filter: {{ width:add:"-5" }} but anything else will require a custom template tag or filter. Luckily, these are extremely easy to write:

Re: Template custom filter doesn't work

2008-11-19 Thread Daniel Roseman
On Nov 19, 9:52 am, "K*K" <[EMAIL PROTECTED]> wrote: > Hi, All. > > I create a custom filter for cut too long string for my app. > > Like this: > > from django import template > from django.template.defaultfilters import stringfilter > > register = template.Library() > > @register.filter(name='cut

Re: Django template tag question

2008-11-19 Thread Daniel Roseman
On Nov 19, 4:58 pm, goblue0311 <[EMAIL PROTECTED]> wrote: > I'm implementing the popular basic.blog application, which requires > the inclusion of the basic.inlines project. However, I cannot seem to > get my application to locate the basic.inlines project. I have asked > this question in the basi

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Daniel Roseman
On Nov 20, 12:33 pm, "Dominic Ashton" <[EMAIL PROTECTED]> wrote: > Guys, > > A brief google search has led me to conclude that it's not possible to > filter on a foreign key field in the Admin. > > Can anyone explain the design rationale around that? Filtering by anything > but a foreign key value

Re: Custom Select widget choices - how to reuse choices?

2008-11-21 Thread Daniel Roseman
On Nov 21, 9:09 am, Donn <[EMAIL PROTECTED]> wrote: > On Friday, 21 November 2008 08:06:32 urukay wrote: > > > easy way how to solve it is to put definition of your choices out of model > > definition: > > Yeah, that's what I call a 'global', but is there no way to get the choices > from the field

Re: Flatpage App vs. Static Template

2008-11-21 Thread Daniel Roseman
On Nov 21, 11:29 am, Caisys <[EMAIL PROTECTED]> wrote: > Hi, > I would like to publish some statics files on my website and I have a > some questions: > 1- The flatpage app examples likehttp://www.lawrence.com/about/staph/ > contain elaborate html, is this edited as a text field in the admin > int

Re: generating a list of click-able links to a detail page

2008-11-24 Thread Daniel Roseman
On Nov 24, 11:59 am, dash86no <[EMAIL PROTECTED]> wrote: > I've implemented a search function which brings up a list of database > items on a page. My template looks like this: > > {% extends "base.html" %} > > {% block content %} > >     {% if results %} >       >       {% for quote in results %

Re: Injecting stuff to an existing list?

2008-11-25 Thread Daniel Roseman
On Nov 25, 8:55 am, sajal <[EMAIL PROTECTED]> wrote: > Hi all i am both a Django and python noob. > > The thing is I have a database of people and need to show a widget on > all pages listing out people who are celebrating their birthday today. > > Using them in each views didnt seem right, specia

Re: mark_safe() not working for me

2008-11-25 Thread Daniel Roseman
On Nov 25, 4:50 pm, Lars Stavholm <[EMAIL PROTECTED]> wrote: > I'm trying to influence one of the admin interface change list > fields by using the below get_progress() method in list_display, > and using mark_safe(). > > However, I can't get this to work: > > class Job(models.Model): >      progr

Re: Admin form

2008-11-25 Thread Daniel Roseman
On Nov 25, 12:16 pm, Praveen <[EMAIL PROTECTED]> wrote: > Hi All, i am very new bie of Django, i have started work on before 3 > days. > I am following DJango book. I am playing with 6 chapter "Using the > admin interface" > In my urls.py file i set the url for admin > > from django.conf.urls.defa

Re: App Name in Admin

2008-11-25 Thread Daniel Roseman
On Nov 26, 6:57 am, "Steve Phillips" <[EMAIL PROTECTED]> wrote: > Hi All > > I have been searching through the list and IRC archives all day and > haven't found anything recent about changing the name that's displayed > for a app on the admin page?  Before I go and just 'write my way > around it',

Re: Access object in session from clean method in Form extending ModelForm

2008-11-26 Thread Daniel Roseman
On Nov 26, 8:07 am, vanosten <[EMAIL PROTECTED]> wrote: > Hi > > I need to do custom validation to make sure that a new record does not > pick the same title as a previous record. Therefore in my overriden > clean method in my custom Form (which extends ModelForm) I need to be > able to do either

Re: Best way to modify admin css

2008-11-27 Thread Daniel Roseman
On Nov 27, 5:07 pm, Matias Surdi <[EMAIL PROTECTED]> wrote: > Hi, > > Which is the best/recommended way to modify admin css ? > > I know I can copy the admin templates to my templates dir and modify > them as I wish, but that could be a problem in the future if these > templates are updated in a n

Re: Raw SQL and model instances

2008-11-28 Thread Daniel Roseman
On Nov 28, 9:42 am, Georg Göttlich <[EMAIL PROTECTED]> wrote: > Hello everybody, > > this question has probably been ask quite often already, but I > couldn't find anything proper on it. So here it is: > > Is there a way to feed the result cursor of a custom sql query back > into the ORM, thus rec

Re: forms and modelform

2008-11-28 Thread Daniel Roseman
On Nov 28, 3:47 pm, Buddy <[EMAIL PROTECTED]> wrote: > I have model: > > class A(forms.Form): >     p1 = forms.CharField() >     p2 = forms.CharField() > > class B(A): >     class Meta: >         model = User >         fields = ('username', 'email', 'first_name', 'last_name',) > > http://dpaste.co

Re: Paragraph modifying

2008-11-29 Thread Daniel Roseman
On Nov 29, 11:35 am, Alex Jonsson <[EMAIL PROTECTED]> wrote: > Hey everyone, > > I could use some help with my application. When I present my blog > posts in my template, I would like to make the three first words of > every paragraph bold. How would be the easiest way to do this? > > I've already

Re: models.AutoField question

2008-11-29 Thread Daniel Roseman
On Nov 29, 3:56 pm, "Mahesh Vaidya" <[EMAIL PROTECTED]> wrote: > Hi, > I want use id as uid or something like; itd start from 1; staring user > id from "1 - one" is not that good; can I initialize starting value > for AutoField ? > > id = models.AutoField(primary_key=True) > > Thank You > -- > --M

Re: Receiving xml via HTTP POST

2008-11-30 Thread Daniel Roseman
On Nov 30, 1:25 am, chefsmart <[EMAIL PROTECTED]> wrote: > Can someone throw a few ideas at me regarding this please... I'm sure > seasoned Django-ists could have really good ideas about this... > Thanks. > > On Nov 22, 10:06 pm, chefsmart <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > I am creati

Re: how to deploy css and images with apache

2008-11-30 Thread Daniel Roseman
On Nov 30, 5:26 pm, l0he1g <[EMAIL PROTECTED]> wrote: > Hi,everyone,this is a beginner's first post,after a long,tired search > here and there without any solution. > I use apache+mod_python on windows,The problem is the css and images > does't be imported anyway,as I did what "How to use Django w

Re: Displaying items of a linked object in a template

2008-12-01 Thread Daniel Roseman
On Dec 1, 12:15 pm, Marco <[EMAIL PROTECTED]> wrote: > Hello, > > I have this in my models.py : > > class Device(models.Model): >         name = models.CharField(max_length=30) > > class DeviceProperty(models.Model): >         key = models.CharField(max_length=30) >         value = models.CharFiel

Re: Database model fields question

2008-12-01 Thread Daniel Roseman
On Dec 1, 6:48 pm, sned <[EMAIL PROTECTED]> wrote: > Is there a way to tell django to use a specific function when > selecting data from a model? > > The sql is relatively simple, but I don't know how to convert that to > model syntax. > > Here's the issue:  a table I'm working with stores ip addr

Re: Receiving xml via HTTP POST

2008-12-01 Thread Daniel Roseman
On Dec 1, 12:48 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-11-30 at 01:15 -0800, Daniel Roseman wrote: > > [...] > > > No doubt someone will correct me if I'm wrong, but I don't think there > > *is* any other way of receiving a file

Re: Why run two web-servers on the same host?

2008-12-02 Thread Daniel Roseman
On Dec 2, 4:46 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > All the python frameworks seem to do this: one web-server for > development, another for production. There may be a good reason for > this, but I don't see it. > > If you are doing internet development, then you certainly have a > network.

Re: forms.ModelMultipleChoiceField

2008-12-02 Thread Daniel Roseman
On Dec 2, 9:04 pm, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > Hi, > > I've set the player form with: > > class PlayerForm(forms.Form): >     challengeable = forms.BooleanField(required=False) >     show_name = forms.BooleanField(required=False) >     country = forms.ModelMultipleChoiceFie

Re: ForeignKey value return from web page

2008-12-03 Thread Daniel Roseman
On Dec 3, 3:25 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > I am trying to use ForeignKey data returned from a page and view, and > am having trouble. I am missing something fundamental I think. > > Say I have 2 models > > class TopModel(models.Model): >         name = models.CharField(max_length

Re: admin TemplateSyntaxError using Django 1.1

2008-12-03 Thread Daniel Roseman
On Dec 3, 4:12 pm, JonathanB <[EMAIL PROTECTED]> wrote: > I've been following the tutorial on the Django site, except that I'm > inserting the app I'm developing in place of the tutorial app data. I > received this error after logging into the admin site. > > TemplateSyntaxError at /admin/ > Cau

Re: Can javascript call a python script?

2008-12-03 Thread Daniel Roseman
On Dec 4, 4:09 am, Eric <[EMAIL PROTECTED]> wrote: > Hello, this might be a silly question, but I'm wondering if javascript > can call a python script, and if so, how? > > To elaborate, I'm trying to customize the admin change_list page so > that editing can be done directly from the change_list,

Re: Admin widget for large number of related records

2008-12-05 Thread Daniel Roseman
On Dec 5, 6:23 pm, "Jim D." <[EMAIL PROTECTED]> wrote: > I apologize if this question has been asked/answered here before, but > I searched around and couldn't find anything. > > We're working on a django app in which we're porting some existing > user data overwe have about 100,000 user recor

Re:

2008-12-05 Thread Daniel Roseman
On Dec 5, 6:04 pm, PFL <[EMAIL PROTECTED]> wrote: > The source generated by the templates is indeed correct; it looks > like: > > Section1 > > However,  when I click on the link, Django(?) tries to resolve it as: > > http://localhost:8000/doc/#1 -- not ---http://localhost:8000/doc#1 > > So -- how

Re: help with file uploads

2008-12-08 Thread Daniel Roseman
On Dec 8, 10:33 am, Alan <[EMAIL PROTECTED]> wrote: > Hi There, > So, I am trying > "http://docs.djangoproject.com/en/dev/topics/http/file-uploads/";, but can't > see the results. > > I mean, I am confused because I don't know where to place the template > (which I believe has to be "contact.html

Re: templates database access

2008-12-08 Thread Daniel Roseman
On Dec 8, 10:25 am, Vicky <[EMAIL PROTECTED]> wrote: > Is there any way to insert, retrieve, delete and update tables in a > database from templates itself? Well, retrieving is what you do when you display data, but for the rest the answer is *definitely not omg why would you want to do such a ho

Re: ifequals in templates

2008-12-08 Thread Daniel Roseman
On Dec 8, 9:31 am, Vicky <[EMAIL PROTECTED]> wrote: > I tried to use the code > below: >                                                {% ifequal oftype > 'first_name' %} >                                                         {% for item in > datas.first_name %} >                              

Re: OperationalError -- Table has no column named ..

2008-12-09 Thread Daniel Roseman
On Dec 9, 5:02 am, djan <[EMAIL PROTECTED]> wrote: > Hello, > > I'm running OpenSuSE-11.0 with the lastest version of django and > sqlite3. > When I enter the admin interface to enter data into my database, I got > the error: > > OperationalError at /admin/archive/artist/add/ > > table archive_art

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote: > Trying to follow along with the Form Tutorial on the Django site and > I'm running into a problem.  I keep getting the error page 'module' > object has not attribute 'ContactForm', when I just simply copy and > pasted the code from the tutori

Re: Using random.random() while running on server

2008-12-09 Thread Daniel Roseman
On Dec 9, 7:34 pm, Chris <[EMAIL PROTECTED]> wrote: > Here is a code snippet:http://dpaste.com/97475/so basically when I > login to the backend and try to add a couple rows. I get the same > random id each time. As you might realise, what's happening is that Django is evaluating your call to make

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote: > Thank you. That cleared that up. Now getting the error. "global name > 'ContactForm' is not defined" in my 'views.py' file.  Any ideas? > Well, as with all Python code, if you define an object in one file and refer to it in another, you have

Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread Daniel Roseman
On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote: > Still no luck. I have this line added to the top of views.py. > > from xxx.register.forms import ContactForm > > It can't seem to find forms 'No module named forms'. > Sorry, I misread your original post. For some reason you have put your fo

Re: TypeError at admin: unpack non-sequence

2008-12-11 Thread Daniel Roseman
On Dec 11, 3:35 pm, Bluemilkshake <[EMAIL PROTECTED]> wrote: > Hi! Apologies for what is in no doubt a complete noob question. > > Just installed CentOS 5 with Python 2.4, Apache2 and the latest SVN > release of Django. Also copied the mysql-python stuff, mod_python etc. > > I've setup my first Dj

Re: django template script variable usage and declaration

2008-12-12 Thread Daniel Roseman
On Dec 12, 7:04 am, "Haroon idrees" wrote: > Hello >      I am new to python world . any one can help to guide how we > declare variables in python template script and use in if else block > and vary it > > for example > //need to declare variable here > //for example x=0 > {% for message in mess

Re: TypeError at admin: unpack non-sequence

2008-12-12 Thread Daniel Roseman
On Dec 12, 9:41 am, Bluemilkshake wrote: > You're right DR, apologies. I did think it may be a syntax issue but > it appears not to be. > Would it matter at what position the admin reference appears in > INSTALLED_APPS? > > Below is the settings.py file being used. Hope this is of more help. > >

Re: TypeError at admin: unpack non-sequence

2008-12-13 Thread Daniel Roseman
On Dec 13, 6:43 pm, benw wrote: > I have the exact same problem with Django 1.0.2 Final on Debian Etch > (Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost > and urls.py are nearly exactly the same as above (the relelant parts > anyway.) > > On Dec 12, 3:00 am, Bluemilkshake >

Re: problem in loading images.

2008-12-13 Thread Daniel Roseman
On Dec 13, 7:37 pm, Sura wrote: > Hi djangonauts, >         I am new to django and i developed the site using django. > My site works well in my system local server .. > I hosted my site in dreamhost server and the url iswww.csmit.org > But now in the site the images fail to load as well as the m

  1   2   3   4   5   6   7   8   9   10   >