Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread shofty
why not use a python ide that is html aware? pycharm by jetbrains is good. On May 24, 6:49 pm, AJ wrote: > Simon, > > Can you please give details of plugins that you use for Python/Django in > MacVim? > > Thanks, > AJ > > On Tue, May 24, 2011 at 12:51 PM, Simon Connah > wrote: > > > > > > > >

Re: UK-based Django Host?

2011-05-24 Thread shofty
just use webfaction, you dont know that they're US when you connect from the UK, speed isnt an issue. I moved to a VPS for cost reasons, but webfaction were fine for me. Matt On May 24, 6:03 pm, Nan wrote: > I know this question has been asked before, but the most recent thread > I can find in t

Re: Serving static file on Windows

2011-05-24 Thread shofty
ignore that last comment, im clearly behind a version! not sure why you're needing to static.serve the static files, if you're on django 1.3 it does that bit for you. On May 24, 9:22 am, Alagu Madhu wrote: > Hi, > > sample/ >           media/ >                     js/jquery.1.6.1.min.js >      

Re: Serving static file on Windows

2011-05-24 Thread shofty
I thought we were still on jquery 1.5.1? Matt On May 24, 9:22 am, Alagu Madhu wrote: > Hi, > > sample/ >           media/ >                     js/jquery.1.6.1.min.js >                  css/ >            static/ >                     js/jquery.1.6.1.min.js >                  css/ > > settings.py

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
its just dawned on me what i've done. forgot to add the lines into the top of the django-admin.py to activate the virtualenv when it is used tjhanks for the help guys. On Apr 30, 6:11 pm, Andres Lucena wrote: > El 30/04/11 18:06, shofty escribi : > > > recreated the virtua

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
Lucena wrote: > El 30/04/11 18:06, shofty escribi : > > > recreated the virtualenv from scratch totally, still got the same > > result. what am i doing wrong here? really cant work it out. > > Exactly what is the output? > > What is the content of $HOME/.pip/pip.log

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
recreated the virtualenv from scratch totally, still got the same result. what am i doing wrong here? really cant work it out. On Apr 30, 4:11 pm, shofty wrote: > that folder is empty too. > > On Apr 30, 3:40 pm, christian verkerk > wrote: > > > > > > > > &g

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
screw things up... > > On Apr 30, 4:34 pm, shofty wrote: > > > > > > > > > is there something wrong with the packages at whatever server they are > > hosted? > > > pip install upgrade django==1.3 -E envname just isnt working. > > > installed dja

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
ings screw things up... > > On Apr 30, 4:34 pm, shofty wrote: > > > > > > > > > is there something wrong with the packages at whatever server they are > > hosted? > > > pip install upgrade django==1.3 -E envname just isnt working. > > > installe

Re: problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
just managed to install 1.3 on my mac, so i guess the problem is on the debian vps. is there some sort of package manager i need to point somewhere else? i'll go do a google. On Apr 30, 3:34 pm, shofty wrote: > is there something wrong with the packages at whatever server they are

problem installing django 1.3 in virtualenv

2011-04-30 Thread shofty
is there something wrong with the packages at whatever server they are hosted? pip install upgrade django==1.3 -E envname just isnt working. installed django into the virtualenv just this morning and its put 1.2.3 in there. can get it to upgrade to 1.3 at all. if i recall theres a possibility th

Re: Need advice on ecommerce app direction

2011-04-26 Thread shofty
agree with Russ, but i have used the book mentioned and found it excellent. http://www.amazon.com/Beginning-Django-Commerce-James-McGaw/dp/1430225351 not an affiiate link. On Apr 26, 1:23 am, Russell Keith-Magee wrote: > On Tuesday, April 26, 2011, Ernesto Guevara wrote: > > I find for download

Re: extending a shopping cart

2011-04-24 Thread shofty
yeah, think i've found it. .model_class() worked, but game a strange result, so needs more investigation. thanks for the pointer mate. On Apr 23, 4:33 pm, Shawn Milochik wrote: > Did you check out the docs for adding a generic foreign key to your > model itself? -- You received this mess

Re: extending a shopping cart

2011-04-23 Thread shofty
ok, answering my own question here, kind of. attempt 1. # get the objects for this content type, then choose the object by id ct = ContentType.objects.get_for_model(app_label=app, name=content_type) p = ct.get_object_for_this_type(pk=object_id) the above code works to get the object and a

Re: extending a shopping cart

2011-04-23 Thread shofty
info on content types. On Apr 23, 11:32 am, shofty wrote: > thanks, it looks like i have. > > i can't get it working though. > > so the idea is to get the app name, model and id of the object before > submission to the cart. > >     form.fields['object_id&#x

Re: extending a shopping cart

2011-04-23 Thread shofty
thanks, it looks like i have. i can't get it working though. so the idea is to get the app name, model and id of the object before submission to the cart. form.fields['object_id'].widget.attrs['value'] = product.id form.fields['content_type'].widget.attrs['value'] = ContentType.objects.g

extending a shopping cart

2011-04-22 Thread shofty
say for instance you had a CartItem that was laid out pretty much as follows class CartItem(models.Model): cart_id = models.CharField(max_length=50) date_added = models.DateTimeField(auto_now_add=True) quantity = models.IntegerField(default=1) size = models.CharField(max_length=20

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
or message. i thought that my link from survey to venue to userprofile to user might have been the issue. On Mar 27, 2:03 pm, Daniel Roseman wrote: > On Sunday, March 27, 2011 9:41:53 AM UTC+1, shofty wrote: > > > this is the view code... > > >     u = get_object_or_404

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
why is it even getting involved? Next step is to take the Survey model out of the equation, resync the db, prove that the code works to save a venue I guess. On Mar 27, 9:41 am, shofty wrote: > this is the view code... > >     u = get_object_or_404(UserProfile, user=request.user) >    

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
this is the view code... u = get_object_or_404(UserProfile, user=request.user) if request.method == "POST": # submitted the add venue form venue_form = VenueForm(request.POST) venue_form.user = u venue_form.slug = slugify(request.POST['name']) if ven

Integrity Error on chained FKs

2011-03-25 Thread shofty
I've got the following models. class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) phone_number = models.CharField(max_length=250) def __unicode__(self): return self.user.username class Venue(models.Model): user = models.ForeignKey(UserProfile)

Re: Django on Windows 7

2011-03-22 Thread shofty
The installation isn't that tricky. what you will struggle with is when your project starts to become complex in terms of package requirements. i spent a day trying to get PIL installed on windows and in the end ran out of patience. spent the next day building a hackintosh and haven't looked back.

Re: has anyone forced django-contact-form to send the email from the contactor

2011-03-19 Thread shofty
lf.request.POST['email'] On Mar 18, 1:17 pm, Tom Evans wrote: > On Fri, Mar 18, 2011 at 11:07 AM, shofty wrote: > > has anyone got any code to share on how to make the email appear to be > > from the person who is submitting the form. > > > you'd think it

has anyone forced django-contact-form to send the email from the contactor

2011-03-18 Thread shofty
has anyone got any code to share on how to make the email appear to be from the person who is submitting the form. you'd think it'd be simple, but i cant work out how to do it. i run a local smtp server on the django server, so if its about not appearing to relay for spam reasons, i can get past

Re: app/model not showing in admin interface?

2011-03-14 Thread shofty
14, 7:18 am, Kenneth Gonsalves wrote: > On Mon, 2011-03-14 at 00:14 -0700, shofty wrote: > > stop/start the dev server. It doesn't spot new files being created, > > only changes to existing files. > > are you sure? > -- > regards > KGhttp://lawgon.livej

Re: app/model not showing in admin interface?

2011-03-14 Thread shofty
stop/start the dev server. It doesn't spot new files being created, only changes to existing files. On Mar 13, 8:37 pm, "Mark J. Nenadov" wrote: > Sorry, that code from admin.py should read: > > >> from app.models import Task > >> from django.contrib import admin > >> admin.site.register(Task) >

Re: What is the best server for Django

2011-03-11 Thread shofty
i tried djangohosting.ch after webfaction. webfaction have better support response times which as a noob i needed. wf have some incredibly knowledgable staff on their support team. so it depends what you want. dh have a great installer, so long as you know what you're doing they're a good choic

Re: hidden widget in form still appears.

2011-01-24 Thread shofty
rking nice and cleanly. will do a little more testing. On Jan 24, 5:20 pm, Daniel Roseman wrote: > On Monday, January 24, 2011 5:06:53 PM UTC, shofty wrote: > > > I realise i might be touching on something old here since i think i've > > found a bug submission on it, but

hidden widget in form still appears.

2011-01-24 Thread shofty
I realise i might be touching on something old here since i think i've found a bug submission on it, but that only talks about in the admin... so this is my declaration of a form field... fields = { 'xxx_venue' : forms.CharField(widget=forms.HiddenInput(attrs={'class':'hideme','value':this_venue

Re: Django's documention is horrible

2011-01-11 Thread shofty
but by the same token, ive not seen a mailing list that hasn't made me want to gouge my own eyes out. its not a great place for reading code is it? you can't do a [code] [/code] to isolate an example on it. the point im trying to make is that your choice isn't necessarily my choice. who is right? (

clever 404 pages

2011-01-06 Thread shofty
has anyone ever written or read an article on creation of clever 404 pages in django sites? i'd like to know if its possible to capture the url requested and maybe push back a quick search on the terms in the url, rather than just telling the user that the page has disappeared in the transition to

how to use csvimport.py successfully - integrity error _id moy not be null

2010-11-05 Thread shofty
ive built a mini shop as part of a project. im trying to drag content in from csv, using one of the django snippets link:(http:// djangosnippets.org/snippets/788/) so my models are Brand Category Product and product references both a brand and a category. python csvimport.py --csv dubkorps.csv --

Re: Automatically loading data into Django

2010-09-09 Thread shofty
you might want to read through this snippet. http://djangosnippets.org/snippets/788/ its a csv import script which imports to a django db from a csv file. very easy to use. im using it relatively successfully. it populates a model, but it errors if you try and set a boolean and i havent worked out

Re: PIL on 10.6 = PAIN

2010-09-03 Thread shofty
I hope I'm not massively missing the point here, but once you set virtualenv up, just use pip to install PIL in there. it works perfect for me every time. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: is it possible to pass a dynamic list of choices to a select widget?

2010-08-03 Thread shofty
cheers for reading Steve. I've been through the documentation again and it definitely states that the widget wants an iterable. so i dont think im going to be able to do what i wanted to do, need another approach. Matt On 3 Aug, 16:15, Steve Holden wrote: > On 8/3/2010 11:12 AM, shof

Re: is it possible to pass a dynamic list of choices to a select widget?

2010-08-03 Thread shofty
ethod on the form and see if it won't work that way Matt On 3 Aug, 15:26, Steve Holden wrote: > On 8/3/2010 10:05 AM, shofty wrote: > > > consider the following code as part of an online shop (im sort of > > working through jim mcgaws ecommerce book). > >

is it possible to pass a dynamic list of choices to a select widget?

2010-08-03 Thread shofty
consider the following code as part of an online shop (im sort of working through jim mcgaws ecommerce book). in the view if product.has_options: form = ProductSizeOptionsAddToCartForm(request=request, label_suffix=':') else: form = ProductAddToCartForm(request=request, label_suffix=':')

Re: moving to django 1.2.1

2010-07-29 Thread shofty
wasnt there some good stuff on djangoadvent? http://djangoadvent.com/1.2/django-12-and-csrf/ Matt On Jul 28, 2:44 pm, knight wrote: > Does anybody knows a good post or blog about the changes including > csrf? > > On Jul 28, 4:33 pm, Maksymus007 wrote: > > > On Wed, Jul 28, 2010 at 3:29 PM, Mas

cant get contact_form to send an email, fails silently every time

2010-07-11 Thread shofty
all, im really struggling with django contact_form http://bitbucket.org/ubernostrum/django-contact-form/overview/ it doesn't send the email. i've stepped through it locally and it hits all the right lines of code. obviously it won't send it locally. but on the server, it should send however it ne

Re: Django templates and libraries

2010-06-21 Thread shofty
i think i'd be right in saying that template tags are different to the eggs issue. i found a post on b-list which explained templatetags and where to put them. http://www.b-list.org/weblog/2007/dec/04/magic-tags/ so pretty much always drop the tags inside a folder named templatetags in your app fo

code creates two copies of an uploaded image

2010-05-23 Thread shofty
def unique_file_gallerythumb(instance, file_name): # split the file_name into dir and filename # then split the filename into name and ext dirname, filename = os.path.split(file_name) prefix, suffix = os.path.splitext(filename) smallfilename, extension = os.path.splitext(prefix)

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-20 Thread shofty
thanks for the swift response. On May 19, 10:05 pm, Bill Freeman wrote: > You could put a method on your basket object which calculates the shipping. > Then if the basket object is included in the context, you can trivially call > it. > That seems simple enough for me to do. > Or perhaps bette

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
apologies, i tab spaced before id finished. the if forloop.last is waiting til its written out all fo the html for the items then i was going to add a final item which was shipping to the basket. but cant really do that without doing math in the template. would like to know if anyone knows of a b

trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
not sure if i've totally missed the point of the correct way to do this. because i couldn't get the django-cart project to do what i wanted (and more because there is a note on the page explaining its got bugs and that i should have been able to fix them but not detailing said bugs) i decided to w

Re: how to display only one instance of an object returned by a query.

2010-04-26 Thread shofty
On Apr 26, 2:51 pm, ondrey wrote: > for details > seehttp://docs.djangoproject.com/en/1.1/ref/models/querysets/#order-by-f... > i honestly read that aricle a couple of times and totally missed it. straight in there and working, thanks for pointing it out in plain english. @G thanks for that

Re: how to display only one instance of an object returned by a query.

2010-04-26 Thread shofty
hmmm, wasn;t expecting that response. im guessing from it, that you're suggesting it should be possible. I don't have the exact error message to hand, but i will recreate it and post it, as i really just thought i was being silly by trying to link to data from a model linked by PK. give me a few ho

how to display only one instance of an object returned by a query.

2010-04-26 Thread shofty
im really struggling to work out how to phrase this question, which is why i've had zero luck googling it. i'll try and explain it. ive got two models. car and photo in a one to many relationship. my queryset is bringing back all of the photos and the for loop writes them all out. currently the

Re: Hosting for Django sites

2010-04-03 Thread shofty
+1 for webfaction. this is a +1 from a proper noob. they were very helpful to me when i was struggling my way through my first django site, so if you're on a real steep learning curve, they will help you out. im not so sure for the 24/7 phone support, i raised an issue with them on twitter once a

update

2010-02-21 Thread shofty
just wanted to add in that i worked out that this was due to changing the PIL installed on my local box. don't know if there is a bug, suspect it was more that i coded the solution around 1.6 then upgraded to 1.7 for something else, which unfortunately broke this app. -- You received this message

TypeError at /avatar/change/ function takes at most 9 arguments (11 given)

2010-02-19 Thread shofty
ok, this is the error TypeError at /avatar/change/ function takes at most 9 arguments (11 given) ive got a project which is a register of cars. ive got it nearly finished and realised that i need to add a pub_date field. so ive recreated my DB, resynced it after adding the field to the model. r

Re: Using a template variable in the "include" template tag

2010-01-31 Thread shofty
> You're right though; in the dev version, you can just use the if tag > with the == operator in between. > apparantly so, but i can't get it working. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: Using a template variable in the "include" template tag

2010-01-30 Thread shofty
well finish posting your > actual problem since you're here and I'll try to help. > > As for your version problem you more than likely have the latest > development version. I notice the same thing despite having the latest > code. > > On Jan 30, 4:23 pm, shofty wrote

Re: Using a template variable in the "include" template tag

2010-01-30 Thread shofty
On Jan 30, 5:37 am, Sam Lai wrote: > You can always use if blocks, e.g. > > {% ifequal content.model_type "post" %} > {% include "content/post/include.html" %} > {% elseifequal ... %} > ... > {% endif %} > I believe im right in saying that you can only use if statements in tags when using the

Re: is there a way to cascade foreign keys?

2010-01-26 Thread shofty
thanks for the replies. I've spotted a few ajax/django uts, in particular this one that is quite appropriate http://www.nerdydork.com/dynamic-filtered-drop-down-choice-fields-with-django.html I've tried to follow it, but i must be missing something cos it doesn't work on my testbed. i should add

Re: is there a way to cascade foreign keys?

2010-01-26 Thread shofty
i should add that the reason the post was named thus was because originally my model looked like ... class VehMake(models.Model): name = models.CharField(max_length=30) class VehModel(models.Model): name = models.CharField(max_length=30) vehmake = models.ForeignKey(VehMake

Re: is there a way to cascade foreign keys?

2010-01-26 Thread shofty
thanks for the replies. I've spotted a few ajax/django uts, in particular this one that is quite appropriate http://www.nerdydork.com/dynamic-filtered-drop-down-choice-fields-with-django.html I've tried to follow it, but i must be missing something cos it doesn't work on my testbed. -- You rece

is there a way to cascade foreign keys?

2010-01-26 Thread shofty
I'm trying to build an app which im calling selector. It allows a user to select from a form of dropdowns their vehicle. the problem im facing is a design one. i just dont know how best to design this and i've spent ages trying to find an example that does the same thing. but i can't find one. so

can you daisy chain foreign keys to produce a selector form

2010-01-07 Thread shofty
I'm trying to create a vehicle selector form using the following model code. class CarManu(models.Model): car_manu = models.CharField(max_length=40) class CarModel(models.Model): manu = models.ForeignKey(CarManu) car_model = models.CharField(max_length=40) class CarYear(m

questions from a noob - win7 using django

2009-12-31 Thread shofty
ive been using django for a couple of weeks, i can see massive potential for actually finishing a couple of projects that i've had on the go for a good while. thing is its my first attempt at using a framework and ive found the tutorial followable, but lacking. it tells you what to do, but doesnt e