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
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
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:
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
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
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
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
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
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
*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
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()
#
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
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
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
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
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
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
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
(cardInfo){
ShellData =
(ShellData){
availableShellActions[] =
"CHANGE_SHELL_ITERATION_NUMBER",
None,
"IPE_FULFILMENT",
"LIST_SHELL",
None,
isrn = ""
products[] =
(Product){
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
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
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
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
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 {
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
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
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
[, ]
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.
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 )
” 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
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 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)
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 /
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
101 - 134 of 134 matches
Mail list logo