Re: multi foreign keys and ordering in admin

2008-11-06 Thread MikeKJ
Rephrased a little On Nov 6, 11:51 am, MikeKJ <[EMAIL PROTECTED]> wrote: > Got something like this > > class A(models.Model): >     x >     class Admin: >         x > > class B(models.Model): >     a =models.ForeignKey(A, edit_inline=models.TABULAR) >

multi foreign keys and ordering in admin

2008-11-06 Thread MikeKJ
Got something like this class A(models.Model): x class Admin: x class B(models.Model): a =models.ForeignKey(A) xxx class C(models.Model): a = models.ForeignKey(A) x classD(models.Model): a=models.ForeignKey(A) xx how do I control th

Re: General question: Django-Profiles, auth.User and "merging" both data

2008-11-13 Thread MikeKJ
I think I may be banging my head on the same problem. I have a UserProfile and Member model in the same app. In views I am using ModelForm on Member for generate a form for def member(request) and a limited set for def associate_member(request) What I really want to do is use the 1st 5 (common an

Vobject

2010-11-16 Thread MikeKJ
Anyone got any experience of the vObject associated to vcard entry, specifically to enter a work telephone number AND a fax number as well as a web page address, I've read through the vobject stuff and vcard stuff and I am none the wiser, what I have at the moment can write the tel and can write t

Re: Can I inport recaptcha?

2010-11-17 Thread MikeKJ
you can use recaptcha directly in the form view add PUBLIC_KEY and PRIVATE_KEY to settings.py in the view of the form add import captcha from django.conf import settings if request.method == "POST": check_captcha = captcha.submit(request.POST['recaptcha_challenge_field'], request.

Re: Can I inport recaptcha?

2010-11-17 Thread MikeKJ
Ahh sorry m8 I forgot to add this in the root of your project directory add captcha.py which is this - import urllib2, urllib API_SSL_SERVER="https://api-secure.recaptcha.net"; API_SERVER="http://api.recaptcha.net"; VERIFY_SERVER="api-verify.reca

Re: Can I inport recaptcha?

2010-11-17 Thread MikeKJ
Think it came from either django snippets or recaptcha but it is open source and been using it for a while as it works a treat. This is a mickey mouse site put together for one of my bosses that uses it so http://www.proofofpurchase.co.uk go look at register and you can see it works all the code

auth user permissions

2010-11-19 Thread MikeKJ
I have forgotten something here, added a model to a site, restarted the server but the add/change/delete permission set is not showing in the auth-user add permission set, what is it I have forgotten please? -- View this message in context: http://old.nabble.com/auth-user-permissions-tp30257316p

Re: auth user permissions

2010-11-19 Thread MikeKJ
Thx, knew I'd forgotten something Łukasz Balcerzak wrote: > > Try running "python manage.py syncdb". Hope that helps > > On Nov 19, 2:00 pm, MikeKJ wrote: >> I have forgotten something here, added a model to a site, restarted the >> server but the

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_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

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

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

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

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"

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

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

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

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

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

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

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

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

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

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

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)

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

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

escaping (where is the exit)

2011-05-03 Thread MikeKJ
I got data from the database in a page, I then merge it as string substitution though another template and end up with double escaping because the escaping is automatic, the only place I can try to de escape is the 2ndary template, I have tried {% autoescape on %}{{ content }}{% endautoescape %}

Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ
In this instance the else is active as there is no incoming context def get_pretty_smartpage_for_email(slug, context=None, surrounding_template='email/pretty.html'): """ Renders a smartpage using the 'pretty' email template returns the rendered content, with any passed-in context re

Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ
In this instance the else is active as there is no incoming context def get_pretty_smartpage_for_email(slug, context=None, surrounding_template='email/pretty.html'): """ Renders a smartpage using the 'pretty' email template returns the rendered content, with any passed-in context ren

Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ
I tried that too after the original post and that made no difference spcontent is escaped HTML and I thought that by marking it safe it wouldnt be escaped again in the pretty.html template Thx Mike spcontent is HTML? from django.utils.safestring import mark_safe    context = Context({  

Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ
MikeKJ wrote: > > > data is stored as This is an exampleof the text > content  > > Is that escaped or unescaped, if it is unescaped then it is being escaped > elsewhere before it gets to be rendered to the template > > Thx > That is unescaped html.. I bel

Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ
data is stored as This is an exampleof the text content  Is that escaped or unescaped, if it is unescaped then it is being escaped elsewhere before it gets to be rendered to the template Thx -- View this message in context: http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p315

Re: Do any financial firms use a Django framework?

2011-05-03 Thread MikeKJ
Aviva (ex Norwich Union) use django they are a big player in insurance markets -- View this message in context: http://old.nabble.com/Do-any-financial-firms-use-a-Django-framework--tp31533283p31534053.html Sent from the django-users mailing list archive at Nabble.com. -- You received this me

legacy code with javascript help please

2011-05-13 Thread MikeKJ
This legacy code outputs an image with a set of thumbnails to change the main image with, to start it is main image above thumbnails but when any thumbnail that is not forloop.first is clicked it swaps upside down like thumbnails with main image under and I cannot see how to maintain image above a

Re: Looking for recommendations to replace vBulletin with a django based forum

2011-05-13 Thread MikeKJ
None of those but have used http://code.google.com/p/django-forum/ which as it says is basic but useable or look at this link http://www.djangopackages.com/grids/g/forums/ Eric Chamberlain wrote: > > Hello, > > We are thinking about replacing our low-usage vBulletin forum with a > django i

where is 'request' as in from x import y

2011-05-26 Thread MikeKJ
I need to get the auth user id in a save method on a model so from django.contrib.auth.models import User user_id = request.user.id the error comes back as name 'request' is not defined Cheers -- View this message in context: http://old.nabble.com/where-is-%27request%27-as-in-from-x-import

Re: where is 'request' as in from x import y

2011-05-26 Thread MikeKJ
Is this really only available to a view? All I want is to know is the auth user id currently logged in so I can save it into another model, has to be in the model so it is part of the admin save method MikeKJ wrote: > > I need to get the auth user id in a save method on a model so >

Re: where is 'request' as in from x import y

2011-05-27 Thread MikeKJ
Interesting, I thought I was doing that in my save method but obviously I cant be. example. Model 1: auth_user_id row_id_of model_being_saved timestamp Model 2: something def save(self): auth_user_id = request.user.id row_id_of_model_being_saved = something Model

tuple comparison to make one tuple

2011-06-08 Thread MikeKJ
I have 3 tuples of email addresses, I want to compare the 3 against each other to make a single tuple of email addresses with no duplicates, any ideas? -- View this message in context: http://old.nabble.com/tuple-comparison-to-make-one-tuple-tp31802229p31802229.html Sent from the django-users ma

Re: tuple comparison to make one tuple

2011-06-09 Thread MikeKJ
Excellent thank you guys and thanks for the pointer to itertools -- View this message in context: http://old.nabble.com/tuple-comparison-to-make-one-tuple-tp31802229p31808134.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subsc

lists and not lists?

2011-07-25 Thread MikeKJ
#from a json stream I have url = "http://..org/api//%s"; % id site = urllib2.urlopen(url) stuff = simplejson.load(site) #within stuff is a list? of images (large, medium and small), just examine large large = map(lambda i: i['paths']['large'], stuff['']['images']) #this returns

sendmail question

2011-08-08 Thread MikeKJ
So I have a pdf I want to send as an attachment file is Doc.objects.all()[0] brochure = file.get_full() // returns http://www..xx/media/docs/file.pdf fp = open(brochure, 'rb') attachment = MIMEImage(fp.read()) fp.close msg_preamble = "dd" msg.attach(attachment) // fp = open(broch

'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

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

text in via model html out in template

2010-12-23 Thread MikeKJ
re phrased heading as this is the real problem model: data = models.TextField(help_text='This is the embedding popup code for the video', null=True, blank=True) method: def data(self): return self.data data.allow_tags = True template: {% for v in x %} {{ v.data|safe }} {% endfor

Re: text in via model html out in template

2010-12-23 Thread MikeKJ
changed as below but still not getting html out just text MikeKJ wrote: > > re phrased heading as this is the real problem > > model: > data = models.TextField(help_text='This is the embedding popup code for > the video', null=True, blank=True) > >

Re: text in via model html out in template

2010-12-23 Thread MikeKJ
solution found and I apologise for this I forgot to mention that the input to the field was (note was) a tiny-mce textfield and in doing that it escaped the html into the database and that was the cause of oozlum bird effect. bruno desthuilliers-7 wrote: > > > > On 23 déc, 1

a chicken and egg - help please?

2011-01-17 Thread MikeKJ
models are: from django.db import models from userprofile.models import Lecturer, UserProfile from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django import forms class Category(models.Model): name = mo

what am I doing wrong?

2011-01-25 Thread MikeKJ
class CertForm(forms.Form): agree = forms.BooleanField(required=True, label="I confirm the above and agree.") cert = forms.BooleanField(required=False, label="I require a certificate") class UserAccountForm(ModelForm): class Meta: model = UserAccount class VideoAccountForm(Mo

IE, CSRF and admin login

2011-02-03 Thread MikeKJ
obviously using django contrib auth works fine in Firefox but IE8 keeps throwing CSRF token error on attempting to log into the admin interface. No admin templates have been altered using django 1.2.3 in pythonpath even tried changing internet options to allow all cookies!!! tried creating a

Re: IE, CSRF and admin login

2011-02-04 Thread MikeKJ
In case anyone else hits this little nasty IE doesn't know what to do with underscored sub domains as far as cookies and therefore csrf_token so dont do as I did and create a subdomain site for development using an underscored name and end up looking for a non existant needle... thank

reverse or selected_related or?

2011-04-06 Thread MikeKJ
There is a way to get it I know there is but I cant see the wood for the trees There are 2 areas each with the same name but belonging to the same PracticeCategory Practice categories are Individual and Business There is a practicetype called Property that belongs to Individual (1) There is a pra

how does this not work????

2011-04-07 Thread MikeKJ
-- View this message in context: http://old.nabble.com/how-does-this-not-work-tp31344282p31344282.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

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

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

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

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

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

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

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

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

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

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

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'

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

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

  1   2   >