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: 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

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: 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

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

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

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

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: 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

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

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() #

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

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

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

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

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

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

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

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){

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

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

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

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

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 {

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-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
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

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.

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 )

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

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

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)

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 /

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

<    1   2