Making inline form completion 'required'

2009-05-18 Thread Alfonso
Hi, I want to make the completion of an inline form called 'orders' required within the parent 'Invoices' admin change form. To stop users generating invoices with no orders attached to them. Is there an easy way to implement that? Thanks --~--~-~--~~~---~--~~

"View on Site" in admin

2009-05-13 Thread Alfonso
Getting a NoReverseMatch at /admin/r/14/1/ on a model in Admin Here's the traceback: Traceback: File "/home/queryclick/webapps/django/lib/python2.5/django/core/ handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File

Re: Custom Save and calculating totals - weird behaviour

2009-05-13 Thread Alfonso
, change): instances = formset.save(commit=False) units = 0 for instance in instances: instance.save() formset.save() Thanks On May 13, 12:13 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On May 13, 11:28 am, Alfonso <allanhender.

Custom Save and calculating totals - weird behaviour

2009-05-13 Thread Alfonso
Discovered a weird bug in my custom save method for a model. Setup is a simple invoice model linked to multiple invoice order models (fk to invoice) and the invoice model holds data like total number of units of ordered... i.e. Invoice order 1: 2 x X DVD @$9.99 Invoice order 2: 5 x Y DVD @$9.99

User Authentication Woes

2009-05-10 Thread Alfonso
Hi, App I'm currently working on can be accessed by either authorised admin users or authenticated customers (one customer might have a number of users on their account). A non-admin user can login and view restricted sections of the site to check stuff like invoices, orders etc. So as an

Getting to the 'latest' item in a template list

2009-05-05 Thread Alfonso
Hi, I'm using the following to pull all cost prices that match a particular product by the company that supplied the product: View: cost_prices = ProductCostPrice.objects.filter (product_id__product_id=product_id) Template: ... {% regroup cost_prices|dictsort:"supplier" by supplier as

Saving inline objects

2009-05-01 Thread Alfonso
I've got a very simple Order model and an invoice model. Currently within the admin section, the invoice admin page contains associated orders as an edit_inline. The user adds orders to the invoice by clicking 'save and continue editing' at which point the system pulls through the correct

Re: HTML Forms and Sessions - Help!

2009-04-29 Thread Alfonso
the checkbox state on that Al On 29 Apr, 11:07, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Apr 29, 10:15 am, Alfonso <allanhender...@gmail.com> wrote: > > > Hi, > > > Leading on from a post I made a few days ago I'm having real trouble > >

HTML Forms and Sessions - Help!

2009-04-29 Thread Alfonso
Hi, Leading on from a post I made a few days ago I'm having real trouble dealing with sessions to preserve form state and the standard HTML for I placed in the template. I can't seem to get to the session data for the form once submitted (via GET) and I'm wondering is that due to the fact it's

Sounding out form state preservation with session variables?

2009-04-28 Thread Alfonso
Hi, I've got a form with a number of checkboxes that allow a user to filter their search query based on the usual suspects of things like location, facilities etc. So now I need a way to preserve these checked options after the form is submitted to allow the user to adjust what they are looking

Re: Adding a link to edit_inline

2009-04-24 Thread Alfonso
Solved this myself with the excellent tutorial at http://www.juripakaste.fi/blog/django-admin-inline-link.html. Thought it might be of use to someone else here! A On 22 Apr, 19:48, Alfonso <allanhender...@gmail.com> wrote: > I think this is probably a number of questions in one so her

Writing csv files to server

2009-04-23 Thread Alfonso
I need to generate a statement at the end of the month that grabs all the invoices for that month and lets the client knows who hasn't paid on time. Problem is the usual setup I have of creating a view/template that simply shows unpaid invoices (within a statement) doesn't stay persistent, i.e.

Adding a link to edit_inline

2009-04-22 Thread Alfonso
I think this is probably a number of questions in one so here it goes: I need to add a hyperlink to an inline record that will take the user to a 'price history' view that lists the previous prices for that inline product. My question is can I edit edit_inline for that model only and no other?

mnax_num and extra on inlines

2009-04-21 Thread Alfonso
I've set up an inline cost price formset and configured the inline form with extra = 1 and max num=1 in associated admin.py. Problem is the inline is displaying the last two entered cost price records... not the last one (by date) and an empty inline form for adding a new entry which is what I'm

Setting dates

2009-04-18 Thread Alfonso
Hi, I'd like to set the default date of a datefield to be 'the 20th of the current month', if past that date the date should be set to the 20th of the following month. So if a record is created on 1st April the datefield would be 20th April 2009, if record is created on 21st April then the

Admin - Hide fields on add, show on change?

2009-04-16 Thread Alfonso
Is it possible to hide some irrelevant fields when a user adds a record via django admin, i.e. they are only relevant on the change view? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: help! i'm new in django

2009-04-16 Thread Alfonso
Hi 83nini, It doesn't matter too much where you place the actual project folder for the django code, just ensure all your paths are setup correctly. For example I just have mine sitting in ~/Users/me/django/ django_projects/ but could be anywhere. Good luck! A On 16 Apr, 14:41, 83nini

PDFs with Pisa

2009-04-16 Thread Alfonso
Hi, I'm trying out Pisa to generate PDFs and am getting a weird error when rendering the pdf: Caught an exception while rendering: 'Context' object has no attribute 'push' Here's the code I'm using (largely unchanged from pisa example) http://dpaste.com/34323/ It seems to hit this error

Changing raw_id_field from 'id'

2009-04-15 Thread Alfonso
Is there an easy way to change the raw_id_field in a foreign key relationship? I'd like to change an inline formset to display not the item pk id alongside the raw_id_field 'magnifying glass' but a barcode field instead. Thanks --~--~-~--~~~---~--~~ You received

Editing Submit line Template in Admin

2009-04-13 Thread Alfonso
Hi, I know it's not possible to easily override the submit_line.html template on model/app by model/app basis but I'm wondering if anyone has discovered a workaround for adding custom submit_line functionality? Basically within one app I'd like to hide everything but 'Delete' and 'Save'. At

JQuery magic in admin?

2009-04-02 Thread Alfonso
Hi, I've got two very unremarkable models, Invoice Order that has a foreign key to an Invoice model. There are some tax calculations that happen on the save of the order model that populate and update the corresponding fields in the Invoice model. All works fine and in fact all calculations in

regroup by date

2009-03-31 Thread Alfonso
regrouping some results by date and I can't seem to make it work on date only, i.e. not including the time - I get the following error "'unicode' object has no attribute 'hour'" when I try: {% regroup results by date_time|date:"D m Y" as results %} Am I missing a special Django filter to get

Date Filtering in Django-Sphinx

2009-03-30 Thread Alfonso
Using sphinx for search in my django app and whilst it's great I can't seem to get any date filtering happening. Sphinx conf is fairly unremarkable: source event_event_en : base { # main document fetch query # mandatory, integer document ID field MUST be the first selected column

Pondering on django-admin preview?

2009-03-25 Thread Alfonso
Hi, Prepare for a likely, very unclear explanation... I've got the bare bones of a preview feature built into my django app, all thanks to the fine tutorial at http://latherrinserepeat.org/2008/7/28/stupid-simple-django-admin-previews/ and works just fine for newly created posts. But here's a

GeoDjango - Multiple Features in Shapefile

2009-03-24 Thread Alfonso
Hi, I have a shapefile of England loaded into a geodjango model that is a combination of administrative boundaries (counties essentially) of the entire country. I'm trying to put together a query search that will return activities by country (then ultimately county) but layermapping has loaded

Absolute URL

2009-03-20 Thread Alfonso
Hi, Insanely simple answer here I think but I'm trying to sort some url errors in a mapping app. Virtual earth requires an absolute url to the KML file django is generating for me and I can't seem to work out how to define that in the urls.py. of course I can just prepend the site root to the

Post Save Signal the best plan?

2009-03-11 Thread Alfonso
Hi there, I've got a few tax calculations running on a custom save method within admin which work great but I need to build in the option to override these calculations manually. So I have 2 questions - is this what I'd use a post save method for (would I move the save calculations to a

Swapping existing stacked inlines and 'add new inline' presentation

2009-03-10 Thread Alfonso
I've got a list of products with a stacked inline showing their (foreign key related) selling prices which are different depending on the customer. My client has asked if I can change the look and feel so that the inline facility to add a new price is at the top with the previous selling prices

Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Alfonso
I've set up a simple filter to grab a queryset of objects matching a list of (many to many) categories like this: Book.objects.filter(categories__in=[1,2,3]).order_by('name').distinct () It's good, it works... it returns any books in those three categories.But I'd like to return ONLY Books with

Sending a list of items by email

2009-03-03 Thread Alfonso
Thinking this should be easy but not sure of the correct path to success! Got a simple filter queryset that pulls order products from a db: order_list = CustomerBasket.objects.all() customer = UserProfile.objects.get(user=user).customer email = EmailMessage( 'New Customer Order: %s ' %

'Latest' foreign key template filter?

2009-03-02 Thread Alfonso
I'm trying to pull the latest foreign key selling price value for a particular product in the database. At the moment I am grabbing them all just by doing: {% for price in product.product_sell_price.all %} {{ price.unit_price }} {% endfor %} but what I want to do is just pull the latest one

Custom Admin Save redirect?

2009-02-24 Thread Alfonso
Is it possible to define a url for the admin form submit? I'd like to redirect a user to a custom list view I've created (outside admin) following the save of a record update or record addition. Is that possible through the 'admin/submit_line.html' template? For example I'd like a user to end

Django App build - the right process?

2009-02-24 Thread Alfonso
I've been putting together a Product Database and Customer Order application that requires a lot of interim calculations, things like tax, customer discounts etc. Due to my limited knowledge of django/ python I have been basically performing these calculations in a custom save function of the

GeoDjango - Distance between MultiPointFields?

2009-02-19 Thread Alfonso
I'm getting an error - "PostGIS spherical operations are only valid on PointFields." when I try to do a distance search on a MultiPointField in the db. I kind of understand why but wonder if it's possible to do such a query at all on MultiPointFields? All I'm looking for is: england_pnt =

Re: Weird error on Foreign key save?

2009-02-19 Thread Alfonso
ow(): 'Decimal' and 'NoneType' Thanks for any help there. Al On Feb 18, 7:44 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Wed, Feb 18, 2009 at 2:30 PM, Alfonso <allanhender...@gmail.com> wrote: > > > I've got an invoice model that foreign key's to a custo

Weird error on Foreign key save?

2009-02-18 Thread Alfonso
I've got an invoice model that foreign key's to a customer model, when the invoice is saved I'm update a few fields in that related customer model to make other code in my setup work. I keep getting "unsupported operand type(s) for ** or pow(): 'Decimal' and 'NoneType'" whenever I try to save

Getting Django to generate a report automatically on a assigned date?

2009-02-18 Thread Alfonso
Hi, I have a client who wants to generate an invoice statment automatically on the first of every month. I'm trying to work out how I might do that in Django. I have a simple statement model and a simple invoice model and all I want to do is on 1st of calendar Month update the statement model

Struggling to update a reverse foreign key lookup

2009-02-18 Thread Alfonso
Probably my very poor python coding rather than Django but I have the model below set up to update another table (reverse foreign key relationship I guess you would call it) class PriceOverride(models.Model): """ Product Price Override """ date_override = models.DateField() product_id =

(GeoDjango.. again) Silly question - grab single lat and long value from a MultiPointField?

2009-02-13 Thread Alfonso
PointField in a template... I can do {{ object.point.x }} and {{ object.point.y }} - works fine. But with a MultiPointField doing the same gives me nada. Where am I going wroing? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed

GeoDjango - Center of a Polygon

2009-02-13 Thread Alfonso
How do I grab the center x and y co-ordinates of a polygon and display that in a template? I'd do this with a PointField... {{ object.coords.x }} etc Can I do that to get the center x and y points of a polygon? Thanks --~--~-~--~~~---~--~~ You received this

Django HTML Sitemap Generator?

2009-02-12 Thread Alfonso
Anyone know of an easy way/pluggable app that can generate a simple html sitemap output? I've used the sitemap module of Django to generate the .xml just fine - but surely I can manipulate that to get a html output to drop in a template? Thanks

User Auth... is_group in a template?

2009-02-09 Thread Alfonso
I'm wondering, I can easily add a if statement to detect whether a user is staff in a template - {% if user.is_staff %} blah {% endif %} but is there a similar syntax for displaying HTML blocks depending on the user group? A kind of {% if user.is_group(customer) %} blah for customer {% endif %}

Re: How do I add a Custom ID Field that increments?

2009-02-09 Thread Alfonso
Thanks Guys, Will, your snippet was exactly what I was looking for - thanks for that. Alas Rama, the client has specified that these custom Invoice IDs get saved in the db alongside the primary key, otherwise I'd go with your suggestion (simpler!) On Feb 5, 8:27 am, Rama Vadakattu

get_FOO_display

2009-02-06 Thread Alfonso
I've got a field called 'invoice_type' which is a ChoiceField. In my template I'm trying to pull out the 'humanized' invoice type by using {{ object.invoice_type.get_invoice_type_display }} but django's not happy. I'm guessing it's because of the invoice[underscore]type syntax I used? Any

Autogenerate a Model on Save

2009-02-02 Thread Alfonso
I'm full of queries today!...This one seems a simple notion that I can't get my head around...How would I get django to auto-generate a new Invoice record and populate with some values when a user saves a new Order record? A custom def save(self) method? Thanks

How do I add a Custom ID Field that increments?

2009-02-02 Thread Alfonso
Hey, I want to add a field to an invoice model that contains a custom auto- incrementing value in the format - 'INV01" which increments... INV02 (obviously!). Anyone have a simple way I can build that into the model when a user clicks 'Add New Invoice'? I've written custom save methods

Re: How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alfonso
ense, Thanks! Allan On Jan 30, 7:35 pm, Alex Koshelev <daeva...@gmail.com> wrote: > Try this: > > return HttpResponseRedirect('/activities/%s/' %  "-".join(location_filter)) > > On Fri, Jan 30, 2009 at 10:26 PM, Alfonso <allanhender...@gmail.com> wrote:

How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alfonso
I've got a form delivering multiple variables from a checkbox group via POST to a view that defines where to redirect to. I've got django to pass the values of this Querydict to a redirect response but can't change the formatting: In my view: location_filter = request.POST.getlist("location")

GET Requests and URLS

2009-01-30 Thread Alfonso
Hi, I've got a simple form that acts as a filter to enable users to reach listings in various countries and I've set up a view that either redirects the user to the correct url or in the case of a query present; diverts to a search url that processes via GET. So the problem I'm having is

Automagical Invoice Generation

2009-01-26 Thread Alfonso
I've got a very simple customer order model that saves the usual details into the system on a successful order placement. I'm trying to think of a way I can generate an associative invoice at the same time an order is submitted? Something within a custom 'def save' method? How would I set

Re: Django Sphinx

2009-01-20 Thread Alfonso
All fixed - anyone who stumbles across this error - update to the latest trunk of django-sphinx and works fine! On Jan 20, 1:23 pm, Alfonso <allanhender...@gmail.com> wrote: > Hello, > > I've used django-sphinx/sphinx engine in the past and found it a > fantasic soluti

Django Sphinx

2009-01-20 Thread Alfonso
Hello, I've used django-sphinx/sphinx engine in the past and found it a fantasic solution but now running into a problem in a new build I haven't seen before: So sphinx is all set up and working and in the appropriate view I have: def search(request): search_query =

GeoDjango: Extract Latitude and Longitude from PointField

2009-01-14 Thread Alfonso
Hey, Must be missing something extraordinarily simple - how do I individually parse the latitude and longitude values from a PointField entry into my app's templates? I just want... Latitude: Longitude: Thanks, Al --~--~-~--~~~---~--~~ You received this

Dynamic age count

2008-12-23 Thread Alfonso
Hi, Trying to implement a very simple template tag that will output a company's age. So idea being if company was established in 1860 then it should output '148 years old' if my math is right ;-) this is what I've got: from django.template import * register = Library() @register.filter def

Re: Django site - CSS doesn't render in Safari/Webkit

2008-12-23 Thread Alfonso
OK tracked it down - appears Safari doesn't sit well with a master .css file and @import url(blah.css); I guess that's because of the way I'm serving up static files. Direct "<link" to css files fixes it Thanks anyway! On Dec 23, 2:03 pm, Alfonso <allanhender...@gmail.c

Django site - CSS doesn't render in Safari/Webkit

2008-12-23 Thread Alfonso
Hey, I'm getting a weird issue in Django with my css and Safari - displays great in all browsers except for Safari. Happens in two different django installations on two separate servers so clearly I'm doing something wrong. CSS files are accessible directly via URL in both cases... odd Apart

GeoDjango Server-side Clustering

2008-12-08 Thread Alfonso
Anyone know of an straightforward way to cluster co-ordinate points server-side i.e. in geoDjango prior to being displayed on an openlayers map via a standard KML? At the moment I'm loading some 2000 coordinates from a KML generated by geoDjango but this is quite understandably slowing the

Form Widget Attributes

2008-11-28 Thread Alfonso
I'd like to specify a unique id for each checkbox iteration in a CheckboxSelectMultiple setup. This is what I have so far: grading = forms.BooleanField(label="Site Grading", widget=forms.CheckboxSelectMultiple(choices=grading_choices)) So in my form using the tag {{ form.grading }} gives me:

Re: Reusable forms!

2008-11-26 Thread Alfonso
s the error you get? > > On Wed, Nov 26, 2008 at 13:39, Alfonso <[EMAIL PROTECTED]> wrote: > > > Thanks Alex, > > > I'm attempting to go the inclusion tag route but having difficulty > > understanding how to get the form in place correctly. > > > I've

Re: Reusable forms!

2008-11-26 Thread Alfonso
shelev" <[EMAIL PROTECTED]> wrote: > You have to pass form instance to all pages context where it is used. You > can do it explicitly or write custom context processor or (the better > solution) write custom inclusion tag. > > On Tue, Nov 25, 2008 at 20:13, Alfonso <[EM

Reusable forms!

2008-11-25 Thread Alfonso
of any fields when I do that?? The search.html form: {{ form.as_p }} Thanks Alfonso --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

geodjango importing existing data - pointfields

2008-11-17 Thread Alfonso
I have a legacy database that consists of a number of addresses with pre-geocoded WKT points. I'm trying to import these directly into a GeoDjango setup - postgres db, either by csv or psql csv copy - doesn't matter which. First problem is I get this error 'new row for relation "site_locations"

GeoDjango - Input geometry has unknown (-1) SRID

2008-11-14 Thread Alfonso
view: def index(request): featured_list = Site.objects.all() featured__list = featured__list.transform(900913) return render_to_response('homepage.html', {'featured_list': featured_list}) Any help appreciated as always! Something obvious I'm missing methinks. Thanks

Re: GeoDjango - Input geometry has unknown (-1) SRID

2008-11-14 Thread Alfonso
btw ignore double underscores in featured list - typo A --~--~-~--~~~---~--~~ 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

Re: GeoDjango - Difficulty placing vector marker from DB

2008-10-22 Thread Alfonso
) > > Best, > Ariel. > > On Tue, Oct 21, 2008 at 1:57 PM, Alfonso <[EMAIL PROTECTED]> wrote: > > > Hey, > > > Having great trouble getting geodjango/openlayers to display vector > > markers propery - everything I try positions the sample point off the &g

GeoDjango 'module' object has no attribute 'OSMGeoAdmin'

2008-10-22 Thread Alfonso
Strange error I haven't seen before - configuring a new django development server and have installed Django v 1.0 In a app admin.py file I've specified a straightforward geo admin class to handle the geodjango enabled models: from django.contrib.gis import admin from models import Category,

GeoDjango - Difficulty placing vector marker from DB

2008-10-21 Thread Alfonso
Hey, Having great trouble getting geodjango/openlayers to display vector markers propery - everything I try positions the sample point off the coast of Africa (no matter if I change the vector position in geoadmin). Here's what I'm working with - any help appreciated!: var lon = -2.900; var

Importing times and dates into Postgres DB via Django

2008-10-08 Thread Alfonso
Hi, I have a textfile full of event data that I'm trying to parse into the associated postgresql db via django. Wrote a simple load.py script I can run via shell. Being going well though I've stumbled when importing DateField and TimeField values. the relevant bits of the code that processes

Re: GeoDjango: ImportError: cannot import name DataSource

2008-09-18 Thread Alfonso
libraries, which in my > experience (which is more on win32 and linux) is a good indicator that the > libraries itself are installed correctly. > > Maybe if you post the result from that call again it becomes clearer what is > going wrong. > > Ludwig > > 2008/9/17 Alfonso &l

GeoDjango: MultiPolygon and Polygon

2008-09-18 Thread Alfonso
I've got a nice chunk of shapefile data to import into a GeoDjango DB via LayerMapping and have discovered only one of the entries is a MultiPolygon shape - the rest Polygon. My question is this... if I change the model definition for the corresponding polygon field from PolygonField to

GeoDjango: ImportError: cannot import name DataSource

2008-09-17 Thread Alfonso
Finally got round to setting up geodjango properly - postgresql db etc. and been inspecting some shapefiles for import. I get this error: >>> from django.contrib.gis.utils import ogrinfo, ogrinspect Traceback (most recent call last): File "", line 1, in File

Re: TypeError - unpack non-sequence

2008-08-20 Thread Alfonso
ointing me in right direction. Regards Allan On Aug 20, 7:59 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-08-20 at 11:46 -0700, Alfonso wrote: > > Interestingly changing /django/core/handlers.py line 77 from: > > > request.path_info) > > > to:

Re: TypeError - unpack non-sequence

2008-08-20 Thread Alfonso
o.ukblog/ i.e. it's dropping the slash from www.mysite.co.uk/ So does that mean it's my root URL conf that's the issue? Thanks Allan On Aug 20, 7:59 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-08-20 at 11:46 -0700, Alfonso wrote: > > Interestingly changing /d

Re: TypeError - unpack non-sequence

2008-08-20 Thread Alfonso
Interestingly changing /django/core/handlers.py line 77 from: request.path_info) to: request.path) Makes everything work again - hmm. No idea why though. Thanks Allan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: TypeError - unpack non-sequence

2008-08-20 Thread Alfonso
<[EMAIL PROTECTED]> wrote: > Alfonso wrote: > > Upgraded to latest svn trunk and now getting brand new error on every > > page/url path save for homepage. Not entirely sure how to track down > > the fault in configuration etc. Anyone help? Thankyou! > > Please specify

TypeError - unpack non-sequence

2008-08-20 Thread Alfonso
Hey, Upgraded to latest svn trunk and now getting brand new error on every page/url path save for homepage. Not entirely sure how to track down the fault in configuration etc. Anyone help? Thankyou! Traceback: Environment: Request Method: GET Request URL:

Re: User Authentication - index/base

2008-07-01 Thread Alfonso
n your settings? > "django.core.context_processors.auth" > > Alfonso wrote: > > Hey, > > > I've implemented a user login widget on my site.  A simple 'Sign in' > > at top of every page that turns into 'Welcome John, View your profile' > > following successful user authentication.

User Authentication - index/base

2008-07-01 Thread Alfonso
Hey, I've implemented a user login widget on my site. A simple 'Sign in' at top of every page that turns into 'Welcome John, View your profile' following successful user authentication. Works great - only issue I'm having is that on home page the text reverts to 'Sign In' even when user is

Re: Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Alfonso
 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > On Jun 26, 2008, at 10:09 AM, Alfonso wrote: > > > > > TypeError: __init__() got an unexpected keyword argument > > 'radio_admin'. > > > Where did that come from? > > Sounds like you may have some lingering .

Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Alfonso
Just updated to latest svn checkout of Django and seeing this error for the first time at root (across the entire site actually)?? TypeError: __init__() got an unexpected keyword argument 'radio_admin'. Where did that come from? Help appreciated! Alfonso

Basic Blog and Newforms-Admin

2008-06-11 Thread Alfonso
Hi Guys, Just installed newforms-admin into my django app and having a strange issue with basic-blog app: Error while importing URLconf 'myapp.basic.blog.urls': The model Post is already registered Occurs on any page whenever basic.blog.urls urlconf is involved. Any suggestions would be

Re: problem representation

2007-06-06 Thread Alfonso Ali
another option could be use the contenttype framework, it's not well documented but using the source and examples could help, take a look here http://feh.holsman.net/articles/2006/06/03/django-contenttype to get an idea about the framework and links to examples. Regards, Ali On 6/4/07, Joseph

Re: any django users in Cuba?

2007-06-06 Thread Alfonso Ali
yes, at least in infomed we are two, i even offered two conferences about django, one as part of Lihab-LUG meeting's and the other as part of a course about python and free software, so i expect the number of users increase with the time ;), i also have in plan a course specifically about django

Re: Newforms / Validation / Uniqueness

2007-05-30 Thread Alfonso Ali
My solution is to use the base class parameter of form_for_[model|instance] function, for example: class SomeTest(models.Model): name = models.CharField(maxlength=50) user = models.ForeignKey(User) class Meta: unique_together = (('user', 'name'),) class

Re: Output category name in a generic view

2006-09-24 Thread Alfonso
': Category.objects.get(pk=1), 'allow_empty': 'true', } or ammonite_dict = { 'queryset': Product.objects.filter(categories=1), 'allow_empty': 'true', } I think I've messed up a few things along the way because django is behaving strangely Cheers, Allan Jay Parlar wrote: > On 9/24/06, Alfo

Output category name in a generic view

2006-09-24 Thread Alfonso
If I have a dict in my urls.py set up to obtain all products in a category like this: ammonite_dict = { 'queryset': Category.objects.get(pk=1), 'allow_empty': 'true', } and then use a generic view to map that url: (r'^glassware/ammonite/$', 'django.views.generic.list_detail.object_list',

serving static images

2006-09-10 Thread Alfonso
Complete newbie problem here but i can't seem to get django to show any images or stylesheets etc. In urls.py: (r'^images/(?P.*)$', 'django.views.static.serve', {'document_root': '/Users/whitebook/django/django_projects/mysite/ media/images'}), In the template I have . So when opening