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
--~--~-~--~~~---~--~~
Y
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 "/home/qu
m, formset, 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
wrote:
> On May 13, 11:28 am, Alfonso wrote:
>
>
>
> > Discove
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
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 examp
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 cost_lis
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 price
through then setting the checkbox state on that
Al
On 29 Apr, 11:07, Daniel Roseman
wrote:
> On Apr 29, 10:15 am, Alfonso wrote:
>
> > Hi,
>
> > Leading on from a post I made a few days ago I'm having real trouble
> > dealing with sessions to preserve form
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 a
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
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 wrote:
> I think this is probably a number of questions in one so here it goes:
>
> I need
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. wh
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?
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
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 datef
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.
T
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 <83n...@
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 whene
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
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 the
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
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 gro
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
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 m
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 th
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 V
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 pre-save
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 b
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
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 ' % c
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 (s
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 u
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 app
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 = froms
yclick/webapps/django/lib/python2.5/django/db/backends/
util.py" in format_number
130. return u'%s' % str(value.quantize(decimal.Decimal(".1")
** decimal_places, context=context))
Exception Type: TypeError at /admin/invoices/customerinvoice/1/
Exception Value:
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 th
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 w
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 = mod
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
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 messa
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
--~--~-~--~~~---~--~---
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
%}
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 wrote:
> CUS
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 worka
I'd like to pass a variable to a django admin view to preset some
fields on an 'Add a product' form.
Example:
An order has come in for 10 Pearl Jam CDs - I have a url that points
to /admin/order/add/ to give the admin staff access to 'create a new
order'. Fine, works great - ideally I want to
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
--~--~-~--~~
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 b
tem in the
QueryDict.
Hope I'm making sense, Thanks!
Allan
On Jan 30, 7:35 pm, Alex Koshelev wrote:
> Try this:
>
> return HttpResponseRedirect('/activities/%s/' % "-".join(location_filter))
>
> On Fri, Jan 30, 2009 at 10:26 PM, Alfonso wrote:
>
>
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")
r
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 sending
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 somet
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 wrote:
> Hello,
>
> I've used django-sphinx/sphinx engine in the past and found it a
> fantasic solution but now running into a problem
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 = request.GET.get('q',
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 messa
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 a
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 " wrote:
> Hey,
>
> I'm getting a weird issue in Django with my css and Safari - displays
> great in all browsers except f
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 f
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 perfor
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:
Oh.. and what is 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.
e difficult?
Thanks
On Nov 25, 5:55 pm, "Alex Koshelev" <[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.
&
em is this form is devoid 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
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"
wing 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
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 thi
)
>
> 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
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, CSit
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 lat
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 th
ded the GDAL 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/
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 MultiPoly
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 "/Library/Frameworks/Python.fram
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:
://www.mysite.co.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 /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 Gr
Joergensen <[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!
>
> Plea
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: http://www.urbanebeauty.co.uk/beauty
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
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 log
s!
Thanks
Allan
On Jun 26, 8:38 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?
>
&
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
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 apprec
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 He
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 fo
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 SomeTestBaseForm(forms.Base
'queryset': 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
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', dict(a
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 u
88 matches
Mail list logo