Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-14 Thread Lee Hinde
On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]> wrote: > > In the django template where I am using a for loop, I have to use a > special tag (div class="yui-u first" instead of div class="yui") for > every forth item. Im trying to create a table with three columns. I > can access t

Error when trying to use inlines in admin

2009-04-19 Thread Lee Hinde
Hi; Given this bit in admin.py class SectionInline(admin.TabularInline): model = Section class ClassAdmin(admin.ModelAdmin): list_display=('Class_Name','Instructor') search_fields =('Class_Name',) save_on_top = True inlines = [SectionInline,] class SectionAdmin(admin.ModelA

Re: Error when trying to use inlines in admin

2009-04-21 Thread Lee Hinde
On Sun, Apr 19, 2009 at 1:26 PM, Lee Hinde wrote: > Hi; > > Given this bit in admin.py > > class SectionInline(admin.TabularInline): >    model = Section > > class ClassAdmin(admin.ModelAdmin): >    list_display=('Class_Name','Instructor') >

Re: Error when trying to use inlines in admin

2009-04-21 Thread Lee Hinde
On Tue, Apr 21, 2009 at 10:38 PM, Lee Hinde wrote: > On Sun, Apr 19, 2009 at 1:26 PM, Lee Hinde wrote: >> Hi; >> >> Given this bit in admin.py >> >> class SectionInline(admin.TabularInline): >>    model = Section >> >> class ClassAdmin

Re: Adding extra text to admin?

2009-05-03 Thread Lee Hinde
On Sun, May 3, 2009 at 6:26 PM, ringemup wrote: > > Other than hardcoding the text into template files, is there any way > to add extra text (e.g. instructions) to the admin area?  It doesn't > have to show up in the default admin templates, just be passed as > context to my custom templates.  An

Re: Adding extra text to admin?

2009-05-03 Thread Lee Hinde
On Sun, May 3, 2009 at 6:43 PM, Lee Hinde wrote: > On Sun, May 3, 2009 at 6:26 PM, ringemup wrote: >> >> Other than hardcoding the text into template files, is there any way >> to add extra text (e.g. instructions) to the admin area?  It doesn't >> have to show u

Problem with overriding save() method

2009-05-06 Thread Lee Hinde
I have this as part of the model for a class called "Class" def save(self, force_insert=False, force_update=False): start = defaultfilters.slugify(self.Name) count = Class.objects.filter(Slug__equal=start).count() if count != 0: filterme = "%s_%d" % (self.

Re: Problem with overriding save() method

2009-05-06 Thread Lee Hinde
On Wed, May 6, 2009 at 10:22 PM, George Song wrote: > > On 5/6/2009 9:57 PM, Lee Hinde wrote: >> I have this as part of the model for a class called "Class" >> >> >>     def save(self, force_insert=False, force_update=False): >>         start = defa

Re: Problem with overriding save() method

2009-05-06 Thread Lee Hinde
On Wed, May 6, 2009 at 10:54 PM, George Song wrote: > > On 5/6/2009 10:34 PM, Lee Hinde wrote: >> On Wed, May 6, 2009 at 10:22 PM, George Song wrote: >>> On 5/6/2009 9:57 PM, Lee Hinde wrote: >>>> I have this as part of the model for a class called "C

Re: Problem with overriding save() method

2009-05-06 Thread Lee Hinde
On Wed, May 6, 2009 at 11:15 PM, Lee Hinde wrote: > On Wed, May 6, 2009 at 10:54 PM, George Song wrote: >> >> On 5/6/2009 10:34 PM, Lee Hinde wrote: >>> On Wed, May 6, 2009 at 10:22 PM, George Song wrote: >>>> On 5/6/2009 9:57 PM, Lee Hinde wrote: >>

Re: Problem with overriding save() method

2009-05-07 Thread Lee Hinde
On Wed, May 6, 2009 at 11:37 PM, George Song wrote: > > On 5/6/2009 11:18 PM, Lee Hinde wrote: >> On Wed, May 6, 2009 at 11:15 PM, Lee Hinde wrote: >>> On Wed, May 6, 2009 at 10:54 PM, George Song wrote: >>>> On 5/6/2009 10:34 PM, Lee Hinde wrote: >>>

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

2009-05-08 Thread Lee Hinde
Hi; I get the error below at a point I'm trying to add 1 to an int field. I'm understanding the error that django doesn't know what the type is for sn. Model: class Sequence_Number(models.Model): Sequence_Name = models.CharField(max_length=100) Next_Sequence_Number = models.IntegerFiel

Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

2009-05-08 Thread Lee Hinde
On Fri, May 8, 2009 at 4:48 PM, George Song wrote: > > On 5/8/2009 4:32 PM, Lee Hinde wrote: >> Hi; >> >> I get the error below at a point I'm trying to add 1 to an int field. >> I'm understanding the error that django doesn't know what the t

Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

2009-05-08 Thread Lee Hinde
On Fri, May 8, 2009 at 5:12 PM, Lee Hinde wrote: > On Fri, May 8, 2009 at 4:48 PM, George Song wrote: >> >> On 5/8/2009 4:32 PM, Lee Hinde wrote: >>> Hi; >>> >>> I get the error below at a point I'm trying to add 1 to an int field. >>> I

Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

2009-05-08 Thread Lee Hinde
On Fri, May 8, 2009 at 6:51 PM, George Song wrote: > > On 5/8/2009 5:58 PM, Lee Hinde wrote: >> On Fri, May 8, 2009 at 5:12 PM, Lee Hinde wrote: >>> On Fri, May 8, 2009 at 4:48 PM, George Song wrote: >>>> On 5/8/2009 4:32 PM, Lee Hinde wrote: >>>>

Re: New Project - want advice

2009-05-14 Thread Lee Hinde
On Wed, May 13, 2009 at 6:30 PM, Technicalbard wrote: > > Hi, > > I'm planning a new project, and I want the following feature set > (eventually).  It will of course be rolled out in parts as apps are > completed.  The purpose of this is to manage knowledge in various > domains. > >  - wiki-type

Multiple 404.html pages

2009-05-14 Thread Lee Hinde
Hi; The site I'm working on will have two groups of users, the public and staff. The 404.html page that the public sees needs to look different than what the staff will see. Primarily because the staff is stuck with the look and feel that I come up with, but the public side will be skinned to mat

Re: Multiple 404.html pages

2009-05-15 Thread Lee Hinde
On Thu, May 14, 2009 at 8:00 PM, James Bennett wrote: > > On Thu, May 14, 2009 at 10:56 PM, Lee Hinde wrote: >> Because I would be using different base.html files, I'm wondering if >> there is a work around to having a single 404.html file. For instance, >> can I d

Globally allow fields to be blank.

2010-05-01 Thread Lee Hinde
Very few of the fields in my models are required (in real life). But the default attribute for a django field is that it is required. http://docs.djangoproject.com/en/1.1/ref/models/fields/#django.db.models.Field.blank Is there a way to toggle that, globally, so that I can just make the few truly

Multi-table inheritance - knowing the child object from the parent

2010-05-17 Thread Lee Hinde
Given the following: class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) zip_code = models.CharField(max_length=15) class Restaurant(Place): serves_hot_dogs = models.BooleanField() serves_pizza = models.BooleanField() c

Re: Multi-table inheritance - knowing the child object from the parent

2010-05-18 Thread Lee Hinde
On Tue, May 18, 2010 at 4:27 AM, Jani Tiainen wrote: > > Given the following: > > > > class Place(models.Model): > > name = models.CharField(max_length=50) > > address = models.CharField(max_length=80) > > zip_code = models.CharField(max_length=15) > > > > > > class Restaurant(Place):

Uploaded File Security

2010-05-19 Thread Lee Hinde
I'm working on an intranet app for a client that will have file uploads. I'm early in the process, but have the uploading working just fine via admin. Once we get to deployment, I'm unclear on how to coordinate the security that django will know about (group X has access to X's files, but not grou

Re: Uploaded File Security

2010-05-19 Thread Lee Hinde
On Wed, May 19, 2010 at 7:19 PM, Mike Dewhirst wrote: > On 20/05/2010 11:00am, Lee Hinde wrote: > >> I'm working on an intranet app for a client that will have file uploads. >> I'm early in the process, but have the uploading working just fine via >> admin. &g

Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
Hi; I have this model design: http://dpaste.com/hold/199818/ class Weather(models.Model): weather_date = models.DateField(auto_now_add=True,db_index=True) zip_code = models.CharField(max_length=20,db_index=True ) icon_data = models.CharField(max_length=80) class Store(models.Model):

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 2:03 AM, Lee Hinde wrote: > Hi; > > I have this model design: > > http://dpaste.com/hold/199818/ > > class Weather(models.Model): > weather_date = models.DateField(auto_now_add=True,db_index=True) > zip_code = models.CharField(

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 2:38 AM, Tom Evans wrote: > On Thu, May 27, 2010 at 10:35 AM, Daniel Roseman > wrote: > > Does this not work? > > > > note=Note.objects.get(whatever) > > weather=Weather.objects.filter( > >weather_date=note.created, > >zip_code=note.created_by__store__zip_code > >

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 12:22 PM, chr wrote: > On May 27, 11:46 am, Lee Hinde wrote: > > So, if I were to display a list of notes, how would I join those two > > together? > > if i get you right, you could accomplish this by using a model method > > ge

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 12:22 PM, chr wrote: > On May 27, 11:46 am, Lee Hinde wrote: > > So, if I were to display a list of notes, how would I join those two > > together? > > if i get you right, you could accomplish this by using a model method > > ge

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 5:44 PM, Lee Hinde wrote: > weather = > Weather.objects.filter(weather_date=self.target_date,zip_code=self.created_by.store.zip_code) > > so, the solution was def get_weather(self): weather = Weather.objects.filter(weather_date=self.target_d

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
ndexError. > > Atenciosamente, > Vinicius Mendes > Solucione Sistemas > vinic...@solucione.info > > > On Thu, May 27, 2010 at 10:11 PM, Lee Hinde wrote: > >> On Thu, May 27, 2010 at 5:44 PM, Lee Hinde wrote: >> >>> weather = >>

Looking for a good CRUD example

2010-05-27 Thread Lee Hinde
Hi; I've appreciated the sample apps out there as great learning tools. I'm having problems saving existing records (new ones get created instead?) and with validation. But rather than pepper the group with my ?s, I'd like to do some more code reviews. So, I'm wondering if you can recommend one

Re: Looking for a good CRUD example

2010-05-29 Thread Lee Hinde
gt; models, and admin access with admin documentation setup too. It is > helping me greatly with folder layout and basic functionality. > > HTH, > Richard Shebora > > On Fri, May 28, 2010 at 1:09 AM, Lee Hinde wrote: > > Hi; > > I've appreciated the sampl

Getting Duplicate records with Q query

2010-06-02 Thread Lee Hinde
Hi; Goal is to get a list of notes that include all those created or addressed to the current user, within the last few days. Model is a Note, with a created_by field and a many-to-many to a recipients table which is itself linked to a User Profile table which is linked to Users. Note <--Recipie

Re: Error with dumpdata: User matching query does not exist.

2010-06-03 Thread Lee Hinde
On Thu, Jun 3, 2010 at 12:36 PM, bastir wrote: > Hey, > i'm suddenly getting an error with dumpdata: > django.contrib.auth.models.DoesNotExist: User matching query does not > exist. > What's wrong here. I did not change anything (especiallyin the User > model) > Thx, > Sebastian I just ran into t

Re: CSRF token not adding hidden form field

2010-06-09 Thread Lee Hinde
On Wed, Jun 9, 2010 at 6:08 PM, joelklabo wrote: > The error I am getting is: "CSRF token missing or incorrect" I went > and looked in the source for the place where it gives that error and > it was this point: > > request_csrf_token = request.POST.get('csrfmiddlewaretoken', None) > if request_csr

Re: CSRF token not adding hidden form field

2010-06-10 Thread Lee Hinde
You need to add: from django.core.context_processors import csrf at the top of Views.py and c = {} c.update(csrf(request)) to each response/view since you're using render_to_response On Thu, Jun 10, 2010 at 8:10 AM, joelklabo wrote: > This is my source on GitHub if anyone is intereste

Re: CSRF token not adding hidden form field

2010-06-10 Thread Lee Hinde
ame'] >                password = request.POST['password'] >        else: >                request = 'it is not there.' >        return render_to_response('feed.html', c) > > On Jun 10, 2:22 pm, Lee Hinde wrote: >> You need to add: >> &

len() vs count

2010-06-14 Thread Lee Hinde
This started off as a pagination question, but then I realized it was a different issue: Given: http://dpaste.com/hold/207217/ why would len(n) be different than n.count() In my case, the len result is correct, but Paginator tries count first (and uses that value). -- You received this mess

Re: Populate Foreign Key after Form is Submitted

2010-06-14 Thread Lee Hinde
On Mon, Jun 14, 2010 at 1:59 PM, geraldcor wrote: > Hello all, > > I have a model A that has >4000 records in it. I have just created a > new model B that has a foreign key to A. I want to be able to create > an instance of B and save it which is no problem going the normal > routes. However, I l

Re: len() vs count

2010-06-14 Thread Lee Hinde
l count statement, while len() loads all rows from > the database and returns the array length of the results. > count() is much faster and better to use if you can conditionally > avoid loading all results. > > On Jun 15, 6:17 am, Lee Hinde wrote: > > This started off a

Re: len() vs count

2010-06-15 Thread Lee Hinde
On Tue, Jun 15, 2010 at 7:56 AM, bruno desthuilliers wrote: > On 14 juin, 22:17, Lee Hinde wrote: >> This started off as a pagination question, but then I realized it was >> a different issue: >> >> Given:http://dpaste.com/hold/207217/ > > >    u = notes.

Re: Why is ModelAdmin to Model a 1-1 relationship?

2010-06-26 Thread Lee Hinde
On Fri, Jun 25, 2010 at 2:54 PM, patjenk wrote: > In our application, we have a Model that has a boolean field named > "deleted". When the delete() method is called, we set the deleted > field to 1 and then save the model. We would like to create an admin > site where we can manage the deleted and

If you need a code review

2010-07-01 Thread Lee Hinde
I'm new to Django. I've done one modest, search only, public site prior to my current project. I'm also new to python. While I'm new to all this, I've been doing web dev. for 14 years. The site I'm working on now is a low-user intranet for a local restaurant chain. I was able to conceptualize the

Booleans not being set in admin

2010-07-08 Thread Lee Hinde
I have a model, Store: class Store(models.Model): """ Store is use to link users and to provide a target for the weather report. """ name = models.CharField(max_length=50, help_text="Simple Identifier for Store -") zip_code = models.CharField(max_length=20,help_text = "Used to

Re: Overwhelmed by File upload instructions

2010-07-09 Thread Lee Hinde
I recently struggled with file transfers. After I was done I discovered django-filetransfers. http://www.allbuttonspressed.com/projects/django-filetransfers On Thu, Jul 8, 2010 at 2:55 PM, Rodion Raskolnikiv wrote: > Soo easy... > Thanks for the tips! > I knew that there had to be a simple solu

Multi table query

2010-03-02 Thread Lee Hinde
Hi; I've posted a diagram of what I'm trying to explain here: http://www.hinde.net/images/queryquestion.png I'm working on a tool for a screen printer. Products (t-shirts, hats, etc.) can be linked to multiple categories. A product can come in multiple colors and each color can come in a variety

Re: Setting up Django on snow leopard

2010-04-09 Thread Lee Hinde
On Apr 8, 1:50 pm, CG wrote: > I have successfully setup django, although I am not sure how I did > it.  Now I am trying to setup MySQLdb  but keep getting the error >   File "setup.py", line 5, in >     from setuptools import setup, Extension > ImportError: No module named setuptools > > On Ap

Storing Lookup Data

2007-09-03 Thread Lee Hinde
This may be more a database question than a Django question, but... How do you store lookup data? By this I mean the data that might populate a pick list. Like, a list of states or counties or person prefixes. Or medal choices in a competition. It seems to be between a single table per choice. i

Re: Storing Lookup Data

2007-09-06 Thread Lee Hinde
On Sep 6, 1:48 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > It seems like the Choice table is easier on the user. You tell them > > to go to the Choices table to enter all the look-up data, as opposed > > to giving them X tables to wade through. > > As you said, it is probably a DB design question

Presence of ForeignKey in list_display kills admin list view

2008-01-03 Thread Lee Hinde
I have two models, presented below: class Winery(models.Model): """(Winery description)""" name = models.CharField(blank=False, maxlength=100, db_index=True) winery_id = models.CharField(blank=True, maxlength=100) corporate_name = models.CharField(blank=True, maxlength=100) ad

Re: Presence of ForeignKey in list_display kills admin list view

2008-01-04 Thread Lee Hinde
On Jan 3, 11:58 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > I have two models, presented below: > > class Winery(models.Model): >     """(Winery description)""" >     name = models.CharField(blank=False, maxlength=100, > db_index=True) >  

Re: Presence of ForeignKey in list_display kills admin list view

2008-01-05 Thread Lee Hinde
On Jan 5, 8:12 am, "Antonio Ognio a.k.a gnrfan" <[EMAIL PROTECTED]> wrote: > On Jan 4, 8:11 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > I got some help on #django today that  helped with this. Thanks! > > Could you share a bit of that bit us? > >

Problem with url conf from chapter 7 of djangobook

2008-01-19 Thread Lee Hinde
Hi; I have the admin site working, now I'm trying to add my first standalone form. Working from the 'simple' example from Chapter 7 of the book. I've adapted it to my practice project. After modifying the urls.py file I get this error when trying to access anything, including admin: Error whil

Re: Problem with url conf from chapter 7 of djangobook

2008-01-19 Thread Lee Hinde
On Jan 19, 6:06 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > Hi; > > I have the admin site working, now I'm trying to add my first > standalone form. > > Working from the 'simple' example from Chapter 7 of the book. I've > adapted it to my practice

Re: Problem with url conf from chapter 7 of djangobook

2008-01-19 Thread Lee Hinde
On Jan 19, 6:25 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > On Jan 19, 6:06 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > > > Hi; > > > I have the admin site working, now I'm trying to add my first > > standalone form. > > > Working

Re: Problem with url conf from chapter 7 of djangobook

2008-01-19 Thread Lee Hinde
Terrific; thank you. The book was right, I got got carried away with some copy and pasting. On Jan 19, 8:30 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Jan 19, 2008 9:37 PM, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > > > [snipped] >

select_related() including a distant many_to_many

2008-02-23 Thread Lee Hinde
Hi; For an app that describes Wine Competitions, I have a model that includes: class Awardswon(models.Model): competition = models.ForeignKey(Competition, verbose_name="Competition") wine = models.ForeignKey(Wine, verbose_name="Wine") awardname = models.ForeignKey(Awardname, verbose_

Repeat a string X times, where X is a database value.

2008-04-06 Thread Lee Hinde
Hi; i have a database field "pricing_level". It's an int between 1 and 5. In a web page, I'm iterating through a list of products and I want to display something like: {% for p in Prod %} {{p.product_level*"$"}} {% endfor %} (along with a bunch of other stuff, of

Re: Repeat a string X times, where X is a database value.

2008-04-06 Thread Lee Hinde
Terrific. Thanks. On Apr 6, 7:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I would make a filter there takes a string and repeats it the number > of times in the arg. > > On Apr 6, 9:27 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > Hi; &

Congrats to Django team on the Google App Engine

2008-04-07 Thread Lee Hinde
Talk about validating your efforts... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send ema

Leopard and Mod_Python.

2008-04-19 Thread Lee Hinde
This is more venting than anything. As a long-time Mac fan boy I'm hugely disappointed at how much trouble it's been to get Apache/MySQL/Mod_Pythyon/django all working together on an Intel Mac running Leopard. This post: http://www.modpython.org/pipermail/mod_python/2008-March/024954.html (which

Re: Leopard and Mod_Python.

2008-04-20 Thread Lee Hinde
On Apr 20, 1:32 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Apr 20, 3:54 pm, Lee Hinde <[EMAIL PROTECTED]> wrote: > > > This is more venting than anything. > > > As a long-time Mac fan boy I'm hugely disappointed at how much trouble > > it&#

Processing saves()

2008-04-28 Thread Lee Hinde
I'd like to make sure I'm on the right track. Given a standard Invoice/Work order type app, where one model is the Work Order and one is Line Items. When I save line items, I want to calculate extended price (Quantity * cost). Put that in the Line Items model, def save() After the line item is

Unicode issue in Admin

2008-06-26 Thread Lee Hinde
Hi; Exhibits are here: http://hinde.net/clients/djangoq/ Summary, I have accented data that displays fine in my sql browser, but shows up funky in django admin. Using revision 7763. Using __unicode__ not __str__ Any pointers would be appreciated. Thanks. - Lee --~--~-~--~~

Re: Unicode issue in Admin

2008-06-26 Thread Lee Hinde
On Jun 26, 4:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-06-26 at 01:41 -0700, Lee Hinde wrote: > > Hi; > > > Exhibits are here: > > >http://hinde.net/clients/djangoq/ > > > Summary, I have accented data that displays fine in

Displaying Child Records in a list of the Parent Records

2008-07-03 Thread Lee Hinde
Say I have invoices (parent) and payments (child) and I want to show each payment made against the invoices while displaying the list of invoices. I've read other discussions here about the problems of automatically loading child records using select_related(). (http://groups.google.com/group/dj

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

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

Re: django as a platform for a commercial SaaS project?

2007-03-24 Thread Lee Hinde
On Mar 24, 8:03 pm, John DeRosa <[EMAIL PROTECTED]> wrote: > walterbyrd wrote: > > SaaS = Software as a service, just in case that was not clear. > > What's the difference between SaaS and an ASP? I don't quite get the > distinction between them. The ASP provides the SaaS. --~--~-~--

Re: Building authentication backend

2012-02-01 Thread Lee Hinde
On Feb 1, 2012, at 12:24 AM, apalsson wrote: > Hello. > > A very simple question. > > I am building an authentication back end to support TWO passwords. > This requires me to add an extra table to store the secondary password > plus a ForeignKey to User. > > The confusing part is, how I make Dj

Re: admin css

2012-03-05 Thread Lee Hinde
On Sun, Mar 4, 2012 at 8:32 PM, Mike Dewhirst wrote: > I would like to adjust the admin app's base.css. Nothing outrageous. I just > want to change all the #999 color values to something a little bit darker so > screen text is slightly easier to see. > > I could write a python script to do that bu

Looking for a round trip example of adding/editing/saving a record using class-based views

2012-03-18 Thread Lee Hinde
I'm looking for something like the vote function in step 4 of the tutorial, but using class-based views.py. Any pointers would be appreciated. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit ht

Re: Looking for a round trip example of adding/editing/saving a record using class-based views

2012-03-19 Thread Lee Hinde
On Sun, Mar 18, 2012 at 4:11 PM, Lee Hinde wrote: > I'm looking for something like the vote function in step 4 of the tutorial, > but using class-based views.py. Any pointers would be appreciated. > > Thanks. Specifically, what's the equivalent of this block: def vote(re

Authentication and Modeling question.

2012-03-26 Thread Lee Hinde
I'm working on a rewrite of an app that has three categories of users and I'm wondering about the best way to link them to the authentication system: In-House Staff. Contractors Customers who interact via the app. The in-house staff model doesn't store any address info. Contractor and Customer ha

adding html5 field attributes to a model form

2012-04-09 Thread Lee Hinde
I'm trying to edit the field type in a form that is using the html5 doctype. I've tried two ways: class AddressForm(ModelForm): contact_email = forms.TextInput(attrs={'type': 'email'}) and class AddressForm(ModelForm): def __init__(self, *args, **kwargs): super(AddressForm,

Re: adding html5 field attributes to a model form

2012-04-09 Thread Lee Hinde
On Apr 9, 2012, at 6:53 PM, creecode wrote: > Hello Lee, > > On Monday, April 9, 2012 6:14:08 PM UTC-7, Lee Hinde wrote: > > I'm trying to edit the field type in a form that is using the html5 doctype. > I've tried two ways: > > Neither works. > >

Re: adding html5 field attributes to a model form

2012-04-09 Thread Lee Hinde
l? > > On Monday, April 9, 2012 7:17:56 PM UTC-7, Lee Hinde wrote: > > Thanks for the response, Creecode, > > I've used that for adding class attributes just fine, but in this case I'm > trying to change the field 'type' and that's what doesn&#x

Re: Is there such a open source django project?

2012-04-17 Thread Lee Hinde
On Tue, Apr 17, 2012 at 3:12 AM, James Deng wrote: > Hi all, > > I have a case to manage my staff for customer support, basically I need a > time based schedule table. the point is that we need to know WHO at WHEN > should take care of WHICH customer, we should be able to input a bunch of > suppo

Word Cap Form Labels

2012-04-18 Thread Lee Hinde
The default behavior for a form label is to capitalize the first letter - 'Report name'. I'd like to capitalize the first letter of each word - 'Report Name'. Short of manually over-riding each label, is there a built-in way to do that? Thanks. -- You received this message because you are subscr

Re: Word Cap Form Labels

2012-04-19 Thread Lee Hinde
Terrific: .control-label {text-transform: capitalize;} Thanks. On Wed, Apr 18, 2012 at 10:27 PM, Jonathan D. Baker < jonathandavidba...@gmail.com> wrote: > Not sure about django, but this is easy to do in CSS. > > Sent from my iPhone > > On Apr 18, 2012, at 11:21 PM, Lee

form doing a query for each element of foreign key in select

2012-04-24 Thread Lee Hinde
I have a table with four or five foreign keys. Using the default form widgets, a foreign key is represented by a single value select. I noticed, with debug_tool_bar, that a query is being made for each element of each foreign key select option. Seems like it ought not I am using     classes = ge

Re: form doing a query for each element of foreign key in select

2012-04-25 Thread Lee Hinde
On Apr 25, 2012, at 2:16 AM, Tom Evans wrote: > On Wed, Apr 25, 2012 at 5:58 AM, Lee Hinde wrote: >> I have a table with four or five foreign keys. Using the default form >> widgets, a foreign key is represented by a single value select. >> >> I noticed, with debu

Re: JQuery .get new url is not updating the page

2012-05-18 Thread Lee Hinde
On May 18, 2012, at 11:52 AM, furqanmlk wrote: > Hi there, > > I implemented the JQuery to get the data from Database server and display in > the form of table on the page when user click one of the DOM element. > I tried , > > JQuery Code: > $.get("RunId_TestCases",{Variable:Value},function(d

Re: JQuery .get new url is not updating the page

2012-05-19 Thread Lee Hinde
> My question is once these values come from view.py, I want to change the > browser url so that url can be send to others. > You're right, I did. http://stackoverflow.com/questions/136458/change-the-url-in-the-browser-without-loading-the-new-page-using-javascript > > O

Re: django and jquery

2012-06-11 Thread Lee Hinde
On Jun 11, 2012, at 11:51 AM, cocoza4 wrote: > i tried to retrieve data from django to jquery by using get > > this is my $get in jquery > > $.get("/video/", > { > video_page: page_number > }, > function(data){ >

AuditTrail

2012-06-17 Thread Lee Hinde
I'm starting a new project that requires auditing and I see https://code.djangoproject.com/wiki/AuditTrail and I'm wondering if anyone would like to warn me off or point me a different direction. Based on the write up, AuditTrail looks like it'd do the job, but, it's never that easy, right? --

database values in a select form.

2012-07-07 Thread Lee Hinde
I have a table, Choice, that is used to build common lists. For instance, there might be a list "Employment_Status" with values "Full-Time" and "Part-Time" I want to use those values in various forms, so in the appropriate models.py I have: def _get_list_choices(list): choices = Choice.on_sit

Re: database values in a select form.

2012-07-09 Thread Lee Hinde
On Sun, Jul 8, 2012 at 7:39 PM, Michael Elkins wrote: > On Sat, Jul 07, 2012 at 08:25:54PM -0700, Lee Hinde wrote: >> >> What I'm noticing is that (in dev mode) the choice list for >> 'employment_status' doesn't update unless I trigger a change, either >

Re: Form 'POST' to a database

2012-07-10 Thread Lee Hinde
On Jul 10, 2012, at 8:48 PM, JJ Zolper wrote: > I honestly just have a general question. > > If I have one database set in my settings file in settings.py and I try to > execute a simple HTML Form using 'POST' how do I get that data into my > PostgreSQL database? > > In my view do I have to i

DRYing up my forms.py

2012-08-03 Thread Lee Hinde
I have a lot of this throughout my forms.py files: self.fields['verification_date'].widget.attrs["class"] = 'date-field input-small' self.fields['verification_date'].widget.format = '%m-%d-%Y' self.fields['mail_response'].widget.attrs["class"] = 'date-field input-small' self.fields['mail_respons

Re: DRYing up my forms.py

2012-08-03 Thread Lee Hinde
On Aug 3, 2012, at 9:01 AM, Melvyn Sopacua wrote: > On 3-8-2012 17:37, Lee Hinde wrote: > >> self.fields['photo_response'].widget.attrs["class"] = 'date-field >> input-small' >> self.fields['photo_response'].widget.format =

Re: Django tutorial question

2012-10-06 Thread Lee Hinde
TJ Marbois wrote: Hi going thru the Django tutorial - and got to this part: https://docs.djangoproject.com/en/1.4/intro/tutorial03/#decoupling-the-urlconfs my editor has a python lint program running...and it complains about 'include' at the import being written but unused... is there any r

Re: connecting to existance mysql

2012-10-09 Thread Lee Hinde
On Tue, Oct 9, 2012 at 8:58 AM, Lewis wrote: > Hello, > I have website that build in php and have the database exists, what is the > process in using django to connect the existance mysql database? is there > tutorial about this process? https://docs.djangoproject.com/en/1.4/howto/legacy-database

Re: Modernizing the Tutorial

2012-10-26 Thread Lee Hinde
On Thu, Oct 25, 2012 at 4:37 PM, Russell Keith-Magee wrote: > > > On Thu, Oct 25, 2012 at 9:00 PM, Tomas Neme wrote: >> >> Now that function-based views are being deprecated, or at least that >> class-based views are being favored, there should be a tutorial with >> them in the docs, shouldn't it

CBV for Nested Formesets

2012-11-09 Thread Lee Hinde
I'm looking at these two blog posts to help me figure out nested formsets: http://yergler.net/blog/2009/09/27/nested-formsets-with-django/ http://andreipetre.tumblr.com/post/26203496689/nested-formsets-with-django The example uses a function view and I was interested using class-based views, but

Re: Changes to default project layout?

2012-01-12 Thread Lee Hinde
Just following up on this, I don't think my question is answered, specifically, which settings.py file is intended to be used? On Wednesday, November 9, 2011 2:08:47 AM UTC-8, Russell Keith-Magee wrote: > > Hi Victor, > > All the answers you're looking for are in the draft release notes for > th

Re: How many developers have moved to class-based views?

2012-11-11 Thread Lee Hinde
The dev docs are much more informative. On Sun, Nov 11, 2012 at 10:45 AM, Arnold Krille wrote: > > Docs on CBV in django1.4 are a bit sparse to say the least. > > > Have fun, > > Arnold > -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: syncing sqlite3 for Django tutorial

2012-11-21 Thread Lee Hinde
>From the docs: NAME -- The name of your database. If you're using SQLite, the database will be a file on your computer; in that case, NAME should be the full absolute path, including filename, of that file. If the file doesn't exist, it will automatically be created when you synchronize the d

Seeding Foreign Key with known object with Class Based Views

2012-11-21 Thread Lee Hinde
I have two tables, Client and Address. Address has a foreign key 'client' which points to the client table. I'll make my user enter a client and then enter 1-x Addresses. I'll know which client the address is being linked to before the record is created, with a url like : /client/3/address/new/. I

Re: Seeding Foreign Key with known object with Class Based Views

2012-11-24 Thread Lee Hinde
/dev/topics/class-based-views/generic-display/ > switch Publisher to client and books to address > :-) > > 2012/11/22 Lee Hinde : > > I have two tables, Client and Address. Address has a foreign key 'client' > > which points to the client table. I'll ma

Re: Seeding Foreign Key with known object with Class Based Views

2012-11-24 Thread Lee Hinde
not hack your PC and understand > your problem. > > thanks, Serge > 2012/11/24 Lee Hinde : >> nt to seed the client id programmatically without presenting a form >>> field to enter what's a known value > > -- Thanks for sticking with this. class Add

  1   2   >