Re: in tiny_mce in django

2018-12-20 Thread MikeKJ
I also wrote and the tiny-mce editor also stripped controls out, could that be the reason for the black oblong? in the tiny-mce js I do have this._def("extended_valid_elements", "video[controls|preload|width|height|data-setup],source[src|type]"); so I am confused why controls was stripped

in tiny_mce in django

2018-12-20 Thread MikeKJ
So I have this tag in a tiny-mce editor If I directly address /media/vids/gardens.mp4 with the domain it works and plays but embedded as is I just get a black oblong on the screen, any ideas please? BTW I didn't add the editor did, I wrote ..type="video/mp4 /> the editor stripped the /

Cannot get this ModelForm view to save to the db, what am I doing wrong please

2018-12-10 Thread MikeKJ
Cannot seem to get .save() to write to the db This is the model class Customer(models.Model): email = models.EmailField() postcode = models.CharField(max_length=10) def __unicode__(self): return self.email def save(self): self.postcode=upper(self.postcode)

Re: Chaining Q objects

2018-09-24 Thread MikeKJ
t;> >> wm = Boat.objects.filter(name=x).filter( f ).first() >> >> >> >> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On >> Behalf Of *MikeKJ >> *Sent:* Wednesday, September 19, 2018 9:29 AM >> *To:* Django user

Re: Chaining Q objects

2018-09-24 Thread MikeKJ
” with “.first()”. > > wm = Boat.objects.filter(name=x).filter( f ).first() > > > > *From:* django...@googlegroups.com [mailto: > django...@googlegroups.com ] *On Behalf Of *MikeKJ > *Sent:* Wednesday, September 19, 2018 9:29 AM > *To:* Django users > *Subject:* Chaining

Chaining Q objects

2018-09-19 Thread MikeKJ
Using this as an example from Dan Herrar enter code here from django.db.models import Q user_pk = 1 category_pk = 1 #some times None f = Q( user__pk = user_pk, date=now() ) if category_pk is not None: f &= Q( category__pk = category_pk )

what is the difference?

2018-09-07 Thread MikeKJ
[, ] and [[, ]] 1st came from z = Model.objects.get(name=x) This returns the object name 2nd came from z = Model.objects.filter(name=x) The 2nd method when you look for the id for x in z: print(x.id) fails with 'QuerySet' object has no attribute 'id' also tried zz = Model.objects.

Re: template tag help please?

2018-08-22 Thread MikeKJ
Thank you Andreas Kuhne, progress So this {% load get_cost %}{% do_cost b.name avn avd %} was working quite happily but for some reason is now complaining Exception Type: TemplateSyntaxError Exception Value: Caught KeyError while rendering: 'avn' Exception Location claims to bege

Re: template tag help please?

2018-08-22 Thread MikeKJ
Thank you Andreas Kuhne, progress So this {% load get_cost %}{% do_cost b.name avn avd %} is not getting any error on the template but as simple as the below is there is no return from django import template from django.conf import settings from django.utils.html import escape register = templa

Re: template tag help please?

2018-08-22 Thread MikeKJ
I am so rusty I’m having trouble writing a simple_tag In the template {% for b in list %} {% load get_cost %}{% do_cost {{ b.name }} avn avd %} Also tried (per docs) {% do_cost name={{ b.name }} avn=avn avd=avd %} I definitely have values in the template passed from the view for avn

Re: template tag help please?

2018-08-17 Thread MikeKJ
Yes For example, in the filter {{ var|foo:"bar" }}, the filter foo would be passed the variable var and the argument "bar". I want to pass 2 (maybe 3) variables and correct me if I am wrong but Custom filters are just Python functions that take one or two arguments: So could do {

template tag help please?

2018-08-17 Thread MikeKJ
I want to pass 2 variables to a templatetag from within a template, a name and a date (eg, John 29/09/2018) to output the result of the templatetag def. The reason I want to do this is: >From a list of all names: The name comes from a model that has a foreign key to another model that has act

Simple table construct?

2018-01-31 Thread MikeKJ
This should be real simple but it has me scratching where to start Distance/Time between 2 place like Distance A B C A 05 10 B 50 5 C 10 5

Re: what on earth is this and how do I access 2 particular values to 2 keys

2017-05-17 Thread MikeKJ
Thanks guys, yes it is SOAP and thank you for the pointer to suds-jurko library, making progress now -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-user

what on earth is this and how do I access 2 particular values to 2 keys

2017-05-15 Thread MikeKJ
(cardInfo){ ShellData = (ShellData){ availableShellActions[] = "CHANGE_SHELL_ITERATION_NUMBER", None, "IPE_FULFILMENT", "LIST_SHELL", None, isrn = "" products[] = (Product){

p12 certs to pem etc

2017-04-27 Thread MikeKJ
Using this snippet from The Random Engineer from OpenSSL.crypto import load_pkcs12, FILETYPE_PEM, FILETYPE_ASN1 with open('cert.p12', 'rb') as f: c = f.read() p = load_pkcs12(c, 'passphrase') certificate = p.get_certificate() private_key = p.get_privatekey() # Where type is FILETYPE_PEM

A sort algorithm?

2017-02-17 Thread MikeKJ
Anyone figure out a sort algorithm to do this please? list = DateTimeDuration.objects.all().filter(date=now).order_by('resource','start') max_hours = 8 this produces Resource – start – duration – user-name Item - 9 - 4 - T Test Item- 10 - 4 - Alpha Bravo Item - 14 - 2 - Herod First what

Re: list? queryet? joining together

2017-01-13 Thread MikeKJ
Thanks for response I’ll try to answer as below in red *Subject:* Re: list? queryet? joining together Hi, just a couple of follow-up questions as having trouble following precisely. Can you re-state the exact queries you’re looking for? Your comment about ‘folding’ model objects makes

Re: list? queryet? joining together

2017-01-10 Thread MikeKJ
May be another way of doing this? 5 tools @ 9 hours = 45 hours maximum possible utilisation 1 tool = 9 hours maximum possible utilisation each tool is a list pa = [] (tool1) pb = [] (tool2) etc max = 9 need to know the count of objects loop all the booking objects use the max count as the inde

list? queryet? joining together

2017-01-09 Thread MikeKJ
Got a quantity of a type of tool to have hours booked, sometimes a tool is booked for all available hours and sometimes for only a few hours and sometimes more than 1 tool is booked to the job. The problem I am having is adding a booking into usable hours, I think I need to determine if the ne

iterate a save in a form view based on a field value

2017-01-06 Thread MikeKJ
So I have a form of post values and one of the values is the number of resources to be used, what I want to do is save multiple instances of the form data based on the resource quantity to be used. ResourceObject is the model name views.py snippet [code] rqb = int(resource_quantity

Re: HTMLDOC as a python view

2015-10-13 Thread MikeKJ
The shell command worker may be at fault as the files in media/pdf are 0byte but having said that of course if the varaibles being sent to it are erroneous that would have the same effect wood trees I'll have a look at easy_pdf, I have the context dict available so should be a relatively qu

HTMLDOC as a python view

2015-10-12 Thread MikeKJ
Please excuse if this is the wrong forum and if a mod wants to move it please feel free, just please let me know where it went. I'm attempting to convert html to pdf on the fly with HTMLDOC. The fly in the ointment appears to be that the generated pdf is not viewable in that it opens Adobe Read

Core error in showing records?

2015-06-16 Thread MikeKJ
Can anyone shed any light on what this is please? Exception Type: TemplateSyntaxError Exception Value: Caught KeyError while rendering: 10 Exception Location: /home/paston3/webapps/bbus/lib/python2.7/django/contrib/admin/templatetags/admin_list.py in _boolean_icon, line 126 The effect is t

choice field with a twist?

2015-05-14 Thread MikeKJ
I may have to radically rethink this from model up but there may be a solution? I have a model called ZoneCost which contains the data A : 0.8 B: 0.9 C: 1.0 D: 1.2 E: 1.4 and another model Card that among other things contains a zone identifier What I want to do is in a view 1. Get the zone a

porting to 1.7

2015-01-07 Thread MikeKJ
I have hit a snag and reading the relevant ticket has left me none the wiser RuntimeError: Conflicting 'category' models in application 'smartpages': and . this is the structure jade - directories( apache2, bin, jadeempire, lib jadeempire - directories(jadeempire) files(manage.py) jadeemp

Re: there was this regex.........

2014-09-16 Thread MikeKJ
scrub this may bad found I was re-writing the error message to "" later on d'oh -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@google

there was this regex.........

2014-09-16 Thread MikeKJ
pattern = re.compile(ur'^(?=\d{2}([\/])\d{2}\1\d{4}$)(?:0[1-9]|1\d|[2][0-8]|29(?!.02.(?!(?!(?:[02468][1-35-79]|[13579][0-13-57-9])00)\d{2}(?:[02468][048]|[13579][26])))|30(?!.02)|31(?=.(?:0[13578]|10|12))).(?:0[1-9]|1[012]).\d{4}$') goodmatch = re.match(pattern, date_from) #

Model construction problem?

2014-08-12 Thread MikeKJ
I think I may have got my model construct wrong because there has to be an easier way to get the data out than to query the referenced data directly.. What I want to do is for each stop on a route output the stop in the template and the times for that stop in something like a tooltip or child w

simple comparison?

2014-06-11 Thread MikeKJ
if userform.is_valid(): name = userform.cleaned_data['name'] email = userform.cleaned_data['email'] username = userform.cleaned_data['username'] password = userform.cleaned_data['password'] orgs = Organisation.objects.all() #

Re: int() argument must be a string or a number, not 'datetime.date'

2014-05-23 Thread MikeKJ
*D'oh* needed to reference back to the date model as in qs = Booking.objects.filter(arrival_date__travel_date__exact=form.cleaned_data['arrival_date']) arrival_date is a int id reference!!! sorry and thanks to anyone who was looking at this -- You received this message because you are subsc

Re: int() argument must be a string or a number, not 'datetime.date'

2014-05-23 Thread MikeKJ
Ummm do I need to use Q? just dawned on me -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send

int() argument must be a string or a number, not 'datetime.date'

2014-05-23 Thread MikeKJ
According to me in the qs line I am looking at, for example, results from Booking where 2014-07-17 equals 2014-07-17 as in date field comparison I dont even see where an int() argument comes into it dl_reports.py class SelectDate(forms.Form): def __init__(self, *args, **kwargs): su

Re: html email function to a large recipient list problem

2014-05-12 Thread MikeKJ
Anyone have an insight into this please? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send e

html email function to a large recipient list problem

2014-05-07 Thread MikeKJ
I have these functions to send update emails to a subscriber list (recipients) but for some reason I cannot seem to fathom it does: Connect Send Email A Connect Connect Send Email B Send Email B Connect Connect Connect Send Email C Send Email C Send Email C etc etc Can anyone see where the in

how to break an email list into manageable sizes for emailing

2014-05-02 Thread MikeKJ
def send( self ): c = Context({ "content": self.introductory_text, "user":None, "request":None, "updates": [] })#Section.updates.all()[:20] }) t = loader.get_template('emailer/html/updates.html') subject = self.subject recipients = [] if self.to_all_prin

Re: a report problem

2014-02-25 Thread MikeKJ
Cheers Erik I'll look at aggregation as well Dates model is because it is supposed to operate on a very limited set of dates -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send

a report problem

2014-02-25 Thread MikeKJ
model: class Dates(models.Model): this_date = models.DateField() class Booking(models.Model) seats = models.IntegerField() date = models.ForeignKey(Dates) report view: this_date = "01-01-2000" seats = 0 daily_arrivals = [] all = Booking.objects.all() for a in all:

Re: invalid syntax (urls.py, line 10)

2013-12-12 Thread MikeKJ
Cheers DR, Moving on I think there are Klingons now. TemplateSyntaxError at /admin/honorary/member/ Exception Type: TemplateSyntaxError Exception Value: Caught TypeError while rendering: __init__() got an unexpected keyword argument 'core' Exception Location: /home/paston2/webapps/seven

invalid syntax (urls.py, line 10)

2013-12-12 Thread MikeKJ
Warning: This is a port from 0.97 to 1.3.7 (thanks DR) The front end of the site is working just the admin is being difficult SyntaxError at /admin/honorary/member/ invalid syntax (urls.py, line 10) location /home/paston2/webapps/sevenkbw/lib/python2.7/django/utils/importlib.py in import_module

Re: porting edit_inline=True to admin.py

2013-12-12 Thread MikeKJ
Hi Daniel Sorry, I believe it was v0.97 and yes I have been chunking through it for a few days now, I have the front end fully working on python2.7 django v1.3.7 mod_wsgi 3.4 I just wanted confirmation on the admin.py for that model as the 0.97 construct for the foreign key relationships alth

Re: porting edit_inline=True to admin.py

2013-12-12 Thread MikeKJ
Hmm just found this http://stackoverflow.com/questions/9738995/django-admin-with-multiple-inlines-of-the-same-model which would make the line of admin.py inlines = [Publications, Paragraphs,]? but I am still getting an error of SyntaxError at /admin/honorary/member/invalid syntax (urls.py, line

porting edit_inline=True to admin.py

2013-12-12 Thread MikeKJ
This is the old model.py that works well in that paragraphs and publications are part of the author model in admin [code] class Author(models.Model): name = models.CharField(max_length=200, help_text="eg Sir John Smith KCMG") picture = models.ImageField(upload_to='honorary_member_images'

why don;t many to many fields save in a .save(commit=False)

2013-11-22 Thread MikeKJ
Why don't manytomany fields save like this? 112 af = editform.save(commit=False) 113 af.level_1 = level_1 114 af.level_2 = level_2 115 af.level_3 = level_3 116 af.level_4 = level_4 117 af.save() altern

how to get at the manytomany fields in for

2013-11-22 Thread MikeKJ
Got this model class AdviceLevel(models.Model): advice = models.ForeignKey(Advice) organisation = models.ForeignKey(Organisation) specialism = models.ManyToManyField(Specialism, null=True, blank=True) service_restriction = models.TextField(null=True, blank=True) in the view dir

Re: data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
Update: So editing AdviceLevel with def edit_advice(request): if not request.user.is_authenticated(): return HttpResponseRedirect('/user/login/') this_advice = request.POST.get('advice_id') sp = Specialism.objects.all().filter(advicelevel=this_advice) de = CRSDeliveryMetho

Re: data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
Decided that the relationship advice = models.ManyToManyField(Advice, through='AdviceLevel') in the Organsiation model is redundant and removed it but it hasn;t made any difference to the now NON intermdiate model AdviceLevel -- You received this message because you are subscribed to the Goo

data not saving through a many to many relationship

2013-11-20 Thread MikeKJ
In the view do_advice the specialism, delivery_method and face_to_face_locations selections are not being saved into the corresponding tables of advicelevel_specialism

Re: presetting a field value with ModelForm

2013-11-12 Thread MikeKJ
Perfect, simple and blindingly obvious now it is pointed out, many thanks C.Kirby and thanks to Sergiy for replying. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: presetting a field value with ModelForm

2013-11-12 Thread MikeKJ
Perfect, simple and blindingly obvious. thanks C.Kirby On Tuesday, November 12, 2013 3:13:18 PM UTC, C. Kirby wrote: > > You don't show your view, which would be helpful but you process the form > with commit = false, then set the org, then save so something like: > > if adviceform.is_valid()

presetting a field value with ModelForm

2013-11-12 Thread MikeKJ
This is driving me nuts I do not want the user to be able to select organisation I want to populate the form field with the known organisation organisation is a foreignkey to the model I am creating this form on so class AdviceLevel(models.Model): advice = models.ForeignKey(Advice

Re: foreign key within a manytomany within a model in admin

2013-11-07 Thread MikeKJ
Think this may be a solution: Models: Advice, AdviceLevel, Organisation class Organsiation(models.Model): title = models.CharField(max_length=150) advice = models.ManyToManyField(Advice, through='AdviceLevel') class AdviceLevel(models.Model): advice = models.ForeignKey(Advice)

foreign key within a manytomany within a model in admin

2013-11-07 Thread MikeKJ
Sorry didnt know how else to describe what I am trying to do I have 3 models Advice AdviceLevel Organisation So the idea is: An organisation can dispense more than 1 advice: class Organsiation(models.Model): title = models.CharField(max_length=150) advice = models.ManyToManyField(Adv

session data and logout

2013-09-19 Thread MikeKJ
I have this oddball requirement where an authenticated user is logged in so I can create a session variable to use elsewhere then do logout(request),so far so good, but it appears that my session variable is destroyed by the logout. Now I honestly thought that this wouldnt be the case as in se

unicode error but weird as there is no data yet

2013-09-14 Thread MikeKJ
The ordinal error is in GroupRegistration becasue if I rem the group line in Register the admin works BUT there is no data in GroupRegistration so how can I have this error? Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode character u'\xf6' in position 26: ordinal not in

unicode error with no data?

2013-09-14 Thread MikeKJ
The unicode error appears to be GroupRegistration but there is *no data* in that table as yet! I checked that by rem the inlines in admin.py and separately the grup line in Register Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode character u'\xf6' in position 26: ordin

Re: form issue.

2013-09-13 Thread MikeKJ
Check that the fields in the database are declared as NULL fields -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. T

django/dajax

2013-09-12 Thread MikeKJ
I simply want to populate a drop select based on what was selected in a previous drop select box I found a dajax/dajaxice method but it does not seem to trigger any clues please? views.py from dajax.core import Dajax from dajaxice.decorators import dajaxice_register @dajaxice_register def upda

Re: list comprehension query

2013-05-03 Thread MikeKJ
Thanks Tom good points as well, between you and Gabriel it a) now works and b) is neater code.thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-

Re: list comprehension query

2013-05-03 Thread MikeKJ
Kudos Gabriel, item_id wasn't an int, I thought I'd check that 1st it is now working... thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+

Re: list comprehension query

2013-05-03 Thread MikeKJ
Yeah trying to debug it. I know each element will be unique as item_id is the row id of a table I just need to know it's position so I can determine if there is a previous and next and from the list get the item_id of the previous and next values in the list which will eventually be passed thr

Re: Form constructor: Learn model instance for ModelChoiceField?

2013-05-03 Thread MikeKJ
have you checked out forms.ModelForm? from django.forms import ModelForm I may be completely wrong, I often am -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

list comprehension query

2013-05-03 Thread MikeKJ
I am using enumerate to find the position in a list but it doesnt seem to be working or throwing an error any ideas please? def detail(request, item_id): item = Item.objects.get(pk=item_id) list = [] count = Item.objects.all().count() all = Item.objects.all() for y in all:

Re: quick problem with str and int

2013-04-29 Thread MikeKJ
I did try that against just the string and got the same error hence the cast to int attempt, when cast to int I am using (r'^json/(?P\d+)/$', '/views/json'), > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: quick problem with str and int

2013-04-29 Thread MikeKJ
Good idea so: In the model added def get_json_reference(self): return "/json/%i/" % int(self.reference) called which does produce the correct url for all in the for loop but still get Exception Type: TypeError at /json/810044/ Exception Value: 'str' object is not callable --

quick problem with str and int

2013-04-29 Thread MikeKJ
So unfortunately due to historical reason a numerical reference is set as a CharField in the model now I want to pass that reference through a url to json serialise something so .*)/$', '/views/json'), I am not entirely sure where it is complaining about str being uncallable but having cast it

Re: can someone rewrite this line please

2013-02-21 Thread MikeKJ
WIDTH, > 800)\" target=\"_blank\">'; > > FYI: if you use an IDE like Eclipse, it will show you what is and isn't > escaped to some degree, using colored text to denote quoted strings versus > compiled commands. > > Cheers, > > Mark > >

can someone rewrite this line please

2013-02-20 Thread MikeKJ
large = '',LEFT, true, OFFSETY, -250, OFFSETX, 0, WIDTH, 800)\" target=\"_blank\">'; so that is comes out of the jquery call as proper html, it needs more escaping somewhere but damned if I can see it. -- You received this message because you are subscribed to the Google Groups "Django users"

returned json + wz_tooltip + jquery carousel

2013-02-19 Thread MikeKJ
view: def json(request,id): g = ProductImage.objects.get(pk=id) large = g.image.url picture = make_thumbnail(g.image.url, maxwidth=400, maxheight=300, root=settings.MEDIA_ROOT, url_root=settings.MEDIA_URL) return JsonResponse({'picture': picture, 'large': large, }) template head

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
Perfect, thanks On Thursday, November 29, 2012 3:48:41 PM UTC, ke1g wrote: > > You have specified related_name to the foreign key in HotTopic. Try > either taking that out, or using newsletter_instance.letter_set.all . > -- You received this message because you are subscribed to the Google Gro

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
Good question, I have attempted to shell the problem out and no I dont get a dataset returned, I should do as NewsLetter is foreignkeyed to Hot_Topic and Hot_Topic_Inline is an inlines to NewsLetterAdmin so the models are definately related -- You received this message because you are subscrib

_set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
I dont get the hot_topic_set.all from the newsletter instance x and I really don't see why can anyone else please? model: class NewsLetter(models.Model): title = models.CharField(max_length=200) text = models.TextField(null=True, blank=True) document = models.FileField(upload_to="news

thumbnail image from original on the fly without using a model field?

2012-11-26 Thread MikeKJ
Trying to port up from *old* django this class/function and having a bit of trouble with the im.save which returns Exception Type: IOError Exception Value: [Errno 2] No such file or directory where the no file or directroy string is a correct path from MEDIA ROOT concatenated with tiny/fil

Re: getting data from a dictionary in a view

2012-10-31 Thread MikeKJ
On Wednesday, October 31, 2012 1:54:07 PM UTC, MikeKJ wrote: > > > Solved using > http://www.daniweb.com/software-development/python/code/217019/search-a-python-dictionary-both-waysby > Ene > Uran <http://www.daniweb.com/members/48000/Ene-Uran>, thanks > -- You re

Re: getting data from a dictionary in a view

2012-10-31 Thread MikeKJ
Solved using http://www.daniweb.com/software-development/python/code/217019/search-a-python-dictionary-both-ways by Ene Uran , thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this

getting data from a dictionary in a view

2012-10-31 Thread MikeKJ
I want to interrogate a dictionary for a particular text cursor = connection.cursor() cursor.execute("SELECT distinct feature, featuredetails from features where the_id = %s", [id]) feature = dictfetchall(cursor) results in [{'featuredetails': u'', 'feature': u'TV_SET'}, {'featur

xml dom (minidom) and python UPDATE

2012-10-23 Thread MikeKJ
Ok so I have realised that what I think I need is a dict of dicts so far I have a dict, stuff which will be populated by boat and engine BUT it doesnt seem to work using for z in [boat, engine]: stuff.update(z) to populate stuff but still seem to be getting a single boat result

xml dom (minidom) and python

2012-10-23 Thread MikeKJ
I cant see the wood for the trees here. help I got this big string of xml from a url which is of data associated to a boat and many boats the tags are 'VehicleRemarketingBoatLineItem' which is the overall tag for a boat set of data whcih contains various tags and tag groups, so dom = mi

Re: saving a model instance in a view

2012-04-05 Thread MikeKJ
Gaaah another brain fart, forget this one too -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2lMhuKetxIcJ. To post to this group, send email to django-use

saving a model instance in a view

2012-04-05 Thread MikeKJ
c = Name.objects.get(trans_id = request.GET.get('trans_id')) if c: u = Name() c.paid = 1 u.save() This isnt saving to same object but adding a blank row and not even changing the boolean value field of paid, someone please point out my error that I cannot see -- You received thi

Re: querysets

2012-04-03 Thread MikeKJ
FORGET THIS, I was having a brain fart -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/s69DS52RSR4J. To post to this group, send email to django-users@goog

querysets

2012-04-03 Thread MikeKJ
Although I use the queryset I dont really understand the object return, when the object is returned just what is returned like list = This.objects.all() list is [, http://groups.google.com/group/django-users?hl=en.

Re: connection.cursor()

2012-02-16 Thread MikeKJ
Actually Bruno thats great, it put me on the right track and I have now solved the error, my bad really I forgot how to properly construct a join sql statment... Cheers -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: CSS reference to Media folder

2012-02-16 Thread MikeKJ
background-image: url(/media/images/base/gradient2.png) eg On Feb 15, 12:37 pm, Kolbe wrote: > Hi all, > > I have a .css file in the /static/ folder where I keep all my styles. > > Now when I want to refer to images that I use in my CSS that are > stored in the /media/ folder, how do I reference

connection.cursor()

2012-02-16 Thread MikeKJ
I got these imported tables from an external source so I need to access the data using connection. The problem I have is getting at the data in more than 1 table with one dict the pure sql call would be something like select * from yw_basics ywb left join yw_next ywn on ywb.id = ywn.id where ywn.

saving in a view

2012-01-27 Thread MikeKJ
I have 2 models Count is purely an incremental counter a model called Sale, the reason for the Count models is to increment a reference for Sale and other models In a view I get the latest sale and count then I want to save the incemented count (number) to Count also save number to Sale customer

{% url 'admin:jsi18n' as jsi18nurl %} error as urls.py

2012-01-06 Thread MikeKJ
This is probably an oldie and I remember coming across it before but damned if I remember the solution: upgrading an old django site Request Method: GET Request URL: http://nortonsdairy.paston2.webfactional.com/admin/products/item/ Django Version: 1.3.1 Exc

Re: string indices must be integers, not str

2011-11-21 Thread MikeKJ
Yep, you found it a missing comma.cheers Ian Clelland-2 wrote: > > On Mon, Nov 21, 2011 at 9:37 AM, MikeKJ wrote: > >> >> Traceback >> >> string indices must be integers, not str >> >> Request Method: POST >> Request UR

Re: string indices must be integers, not str

2011-11-21 Thread MikeKJ
uestion form", msg_header+msg_middle, settings.DEFAULT_FROM_EMAIL [settings.CONTACT_EMAIL_TO], fail_silently=False) ... ▶ Local vars - MikeKJ wrote: > > 1st time I have hit this and I am confused the subject error is returned > as in the se

string indices must be integers, not str

2011-11-21 Thread MikeKJ
1st time I have hit this and I am confused the subject error is returned as in the send_mail line all the fields in the model are either CharField or TextField settings.py DEFAULT_FROM_EMAIL = 'x...@.co.uk' valid email address CONTACT_EMAIL_TO = 'x...@.co.uk' valid

string indices must be integers, not str

2011-11-21 Thread MikeKJ
1st time I have hit this and I am confused the subject error is returned as in the send_mail line all the fields in the model are either CharField or TextField settings.py DEFAULT_FROM_EMAIL = 'x...@.co.uk' valid email address CONTACT_EMAIL_TO = 'x...@.co.uk' valid

Re: no return from image_set.all yet code almost identical

2011-10-26 Thread MikeKJ
My bad, I found the deliberate error! -- View this message in context: http://old.nabble.com/no-return-from-image_set.all-yet-code-almost-identical-tp32723239p32725680.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to

Re: no return from image_set.all yet code almost identical

2011-10-26 Thread MikeKJ
update I have moved all the classes into the one model, image_sets ... from django.db import models from smartpages.models import SmartPage POSITIONCHOICES = [ ('1', 'Top'), ('2', 'Bottom') ] class Set(models.Model): assigned_page = models.ForeignKey(SmartPage, help_text='The s

Re: NEWBIE: using django without a model.

2011-10-26 Thread MikeKJ
If no database requirement then you dont a model just a view and a template but I have no idea what pig!. is damola oyeniyi wrote: > > Hi, > > I am trying to create a simple query page using django and pig!. I would > not be needing a database, so I'm not sure if a model is involved. My pig >

no return from image_set.all yet code almost identical

2011-10-26 Thread MikeKJ
The problem: imsettop and imsetbottrom return an image_set.all headset doesnt, yet the code to get all three are almost identical can anyone spot the error please? I have 2 models going through a view to a template simple models: model image_sets from django.db import models from smartpages.mo

Re: This is nuts why dont I get POST?

2011-08-31 Thread MikeKJ
Ah all for a missing " Thank you Tom talk about not seeing the woods for the trees! Sheesh Tom Evans-3 wrote: > > On Wed, Aug 31, 2011 at 3:06 PM, MikeKJ wrote: > >> > > Incorrectly formatted tag, browser falls back to default method, which is &

This is nuts why dont I get POST?

2011-08-31 Thread MikeKJ
Model from django.db import models # Create your models here. roof_choices = ( ("South", "South"), ("South East", "South East"), ("South West", "South West"), ("East", "East"), ("West", "West"), ("North", "North") ) pv_choices = ( ("0.1-5 kWph", "0.1-5 kWph"), (

Re: 'dict' object has no attribute 'META'

2011-08-19 Thread MikeKJ
Thanks guys! yeah the request parameter was missing, so much for parallel monitor reading! All I can say is that I write code better now, thanks again MJ The first parameter to RequestContext should always be the request, not the context dict. I don't think that has ever been different - see

Re: How to change the schma of database using python manage.py syncdb?

2011-08-18 Thread MikeKJ
Another alternative would be to access mysql from a shell and add the column to the relevant table mysql>> alter table x add column hits int(11) null; for example thinke365 wrote: > > for example at first i have a model named url, the code is as follows: > > class url(models.Model): >

'dict' object has no attribute 'META'

2011-08-18 Thread MikeKJ
I have this old site that was originally pre magic and got ported up 0.96 where it still is and now have to make some alterations, this is a clone site to do something different but the same BUT on getting to the subsubcategory level (sorry my naming conventions back then really sucked) I am getti

  1   2   >