Re: Fixtures won't load twice in same testcase

2016-05-06 Thread Alasdair Nicol
#x27;t posted any code that can reproduce the problem. It doesn't need to be the actual code, in fact the simpler the example is the better. Cheers, Alasdair [1]: https://docs.djangoproject.com/en/1.9/releases/1.8/#testcase-data-setup [2]: https://docs.djangoproject.com/en/1.9/topics/testi

Re: django1.7, python3.4 and MySQL

2015-05-20 Thread Alasdair Nicol
Hi eduardo, Have you tried the following? pip install mysqlclient Usually, you should use the package name, you don't need to specify the specific wheel you want to install. Cheers, Alasdair On 20/05/15 16:03, eduardo.canaljun...@gmail.com wrote: Hi, sorry but I tryed to in

Re: Django 1.8 tutorial-Chapter4: ValueError at /polls/1/vote/

2015-05-14 Thread Alasdair Nicol
On 14/05/15 02:50, charito.romeo wrote: | | The problem is that there is a new line in the middle of "{{ choice.id }}". Change it to: value="{{ choice.id }}"/> Cheers, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://

Re: Django 1.8 ImportError: No module named formtools

2015-03-12 Thread Alasdair Nicol
github repository to make a PyPi release. Django 1.8 is in beta at the moment, hopefully django-formtools will be on PyPi by the time Django 1.8 is released. In the meantime, you can install django-formtools from github with: pip install git+ssh://g...@github.com/django/django-formtools

Re: TemplateSyntaxError with {% cycle "Hello, how are you?" "Fine!" %}

2015-03-06 Thread Alasdair Nicol
wasn't clear. By 'as expected', I meant that you want the cycle tag to return "Hello, how are you". Switching to single quotes isn't a fix, because it only returns 'Hello'. Cheers, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com w

Re: TemplateSyntaxError with {% cycle "Hello, how are you?" "Fine!" %}

2015-03-05 Thread Alasdair Nicol
{% cycle hello "Fine!" %}. {% endwith %} On 05/03/15 16:48, Vijay Khemlani wrote: > Changing the double quotes for single quotes seems to do the trick, but I don't know why it works If you use single quotes and render the template, it outputs 'Hello', not '

Re: TemplateSyntaxError with {% cycle "Hello, how are you?" "Fine!" %}

2015-03-05 Thread Alasdair Nicol
On 05/03/15 16:53, Alasdair Nicol wrote: {% with hello="Hello, how are you?" {% cycle hello "Fine!" %}. {% endwith %} Oops, that should have read: {% with hello="Hello, how are you?" %} {% cycle hello "Fine!" %}. {% endwith %} -- Alasdair Nicol Deve

Re: malicious requests?

2014-12-22 Thread Alasdair Nicol
ming host > validation, thus an entry with a trailing dot isn’t required. cheers, Alasdair On 22/12/14 12:05, Alex Haylock wrote: Thanks Markus. So, as per the RFC, are 'example.com' and 'example.com.' considered to be the same domain, or two separate domains? Are there an

Re: Replacing usage of form._errors in Django 1.7

2014-11-20 Thread Alasdair Nicol
Hi Collin, On 17/11/14 21:19, Collin Anderson wrote: Hi Alasdair, I'm upgrading to Django 1.7, and updating my forms to use the new form.add_errors() method. I have one remaining pattern which uses form._errors. class MyForm(forms.Form): ... def

Replacing usage of form._errors in Django 1.7

2014-11-14 Thread Alasdair Nicol
use self.errors instead? Looking at the source code [2], errors is a property, not an attribute. By the time the clean() method is called, self._errors should have been created, so I think that accessing self.errors should be safe. cheers, Alasdair [1]: https://docs.djangoproject.com/en/dev/rel

Re: Did Ubuntu 14.04 or Linux Mint 17 break your Django project files?

2014-07-16 Thread Alasdair Nicol
s_cheese = models.BooleanField(default=False) For more info see the release notes [1]. It would be worth going through them to see if there are any other changes you should or need to make. [1]: https://docs.djangoproject.com/en/dev/releases/1.6/#booleanfield-no-longer-defaults-to-false Cheers, Alasdair --

Re: Writing your first Django app, part 1 (1.6)

2013-12-11 Thread Alasdair Nicol
retry and follow the instructions, it should work. You can select the version of the tutorial using the selector in the bottom-right corner of the screen. Cheers, Alasdair On 10/12/13 22:19, Suhendri wrote: Hi, I'm new in Django, I'm excited with Django so I have to following th

Re: Long url parameter in GET request locks python

2013-01-30 Thread Alasdair Nicol
k.views.isProjectDuplicate'), For a further explanation, see the question "url regex keeps django busy/crashing" [1] from the django-users group. [1]: https://groups.google.com/d/msg/django-users/Bxq9i0mttSc/DEz7S7M8lxAJ Cheers, Alasdair -- Alasdair Nicol Developer, MEMSET

Re: A question about Model.full_clean

2012-06-01 Thread Alasdair Nicol
? The default value for the CharField is the empty string, which as you show in your first example, doesn't cause a problem. Cheers, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick

Re: Possible bug in the Django documentation

2012-05-14 Thread Alasdair Nicol
he template includes the following statement. {% load url from future %} If you don't include this, then the alternative is to remove the quotes, as you found. Hope that explains things. Cheers, Alasdair https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi

Re: Problems with {% url %} in templates

2012-03-29 Thread Alasdair Nicol
(.*)$ in the regex for the include. The documented pattern [1] for the include is (r'^d/events/', include('myproject.events.urls')), Regards, Alasdair [1]: https://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs -- Alasdair Nicol Developer, M

Re: Trouble setting up website with mysql as backend

2012-03-17 Thread Alasdair Nicol
with a really long name, or * defined a model with a really long name so that "Can view " is longer than 50 characters. Regards, Alasdair Nicol [1]: https://docs.djangoproject.com/en/dev/topics/auth/#default-permissions -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web

Re: Help on forms.py

2012-02-16 Thread Alasdair Nicol
27;keyword1'), ('keyword1', 'keyword1')] What you probably want is a ModelChoiceField [1], which takes a queryset argument. keywords = forms.ModelChoiceField(queryset=Keyword.objects.all()) [1]: https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoice

Re: Model.delete() was not called.

2012-02-16 Thread Alasdair Nicol
onsole. Should I consider this behaviour as a bug or I am doing something wrong? The delete select action uses the queryset's delete method [1], which means the model's delete method is not called. It's not a bug, the behaviour is documented on the admin actions page. [2]

Re: MySQL limit sub-query problem

2012-01-26 Thread Alasdair Nicol
a separate query: total_objects = (obj_assigned | obj_class.objects.filter(pk__in=list(inner_q))) Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, Surrey, GU2 7YD, UK. --

Re: change min_length in form __init__?

2012-01-13 Thread Alasdair Nicol
lidators in the __init__ method instead, Cheers, Alasdair [1]: http://stackoverflow.com/questions/8818261/django-change-min-length-in-form-init/ -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick San

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-12 Thread Alasdair Nicol
def form_valid(self, form): form.instance.user = request.user return super(CreateCampaignView, self).form_valid(form) I haven't had a chance to test the code. I hope that it works, or at least leads you in the right direction! Regards, Alasdair -- Alasdair Nicol Developer, MEM

Re: clean function for field that may be blank

2011-11-16 Thread Alasdair Nicol
_birth: if date_of_birth.year < 1890: raise forms.ValidationError(u"It is very improbable...") return date_of_birth Regards, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4

Re: Strange traceback: DoesNotExist not callable

2011-10-20 Thread Alasdair Nicol
process is handles a different request later on, you get the type error because your code is trying to call the DoesNotExist instance which has replaced Sample.MultipleObjectsReturned. tschüss, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memse

Re: Filtering html for django comments

2011-10-07 Thread Alasdair Nicol
following {{ text|markdown }} with and without the safe parameter! text = """ alert(boo!); **This is bold** """ Regards, Alasdair On 07/10/11 15:04, arkai...@gmail.com wrote: Hi, I am aware that Markdown is a formatting language like textile or any other. It is

Re: ORM only/defer calls do not work on cross-table relations

2011-09-27 Thread Alasdair Nicol
Hi John, Use select_related [1] to tell Django to 'follow' the foreign key. Try the following: testmodels = models.ATestModel.objects.all().select_related('other').only('other__name') print testmodels[0].other.name Regards, Alasdair [1]: https://docs.djang

Re: AssertEquals __unicode__

2011-08-25 Thread Alasdair Nicol
oice_number self.assertEqual("2011/1", invoice) AssertionError: '2011/1' != Thanks for help Torsten You want to compare the unicode string for the object, so use the unicode function. The following should work: self.assertEqual("Invoice: 2011/1", unicode

Re: [ANN]: FeinCMS v1.4.0.rc1

2011-08-08 Thread Alasdair Nicol
account anymore. Great news Matthias! We're looking forward to using 1.4, especially the django-reversion support. Regards, Alasdair -- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick Sanger

Re: url names

2011-07-19 Thread Alasdair Nicol
On 19/07/11 11:08, NISA BALAKRISHNAN wrote: how to add url names to the following entry in urls.py. ( r'^all/synchro/download/file/', "get_all_data_download" ) Use the url function [1] url( r'^all/synchro/download/file/', "get_all_data_download", n

Re: Linking to Django Admin from 1.3

2011-07-14 Thread Alasdair Nicol
template using: {% url admin:index %} For Django 1.3, the documented way [2] to include the admin site is: *url(r'^admin/', include(admin.site.urls)),* Regards, Alasdair Nicol [1] https://docs.djangoproject.com/en/dev/topics/http/urls/#url-namespaces [2] https://docs.djangoproject.

Re: Multiple forms into one form/trouble accessing form fields

2011-06-15 Thread Alasdair Nicol
https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms Regards, Alasdair On 15/06/11 14:09, Thomas Weholt wrote: I got several forms I need to display in one page and post to one site. Actually, what I want to do is take all the fields from all the forms and display them as

Re: VERY cheap django hosting?

2011-06-08 Thread Alasdair Nicol
I have used djangohosting.ch before and recommend them. As BR says it's very easy to deploy, and I thought their support was super. Alasdair On 08/06/11 22:13, Tiago Almeida wrote: I use http://djangohosting.ch/ for a small company website and haven't experienced any issues on

Re: login -->then on success--> my custom page

2011-04-05 Thread Alasdair Nicol
If you only need to change the success url, then use the LOGIN_REDIRECT_URL setting [1]. You won't need to customise the login page. Alasdair [1] http://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url On 05/04/11 10:14, GOUTAM KUMAR RANA wrote: please help me to make or in

Re: Managers in admin

2009-09-09 Thread Alasdair
I got the admin to use the models.Manager() by overriding the queryset method in my EntryAdmin class: class EntryAdmin(admin.ModelAdmin): [...] def queryset(self, request): return Entry.objects --~--~-~--~~~---~--~~ You received this message becaus

Re: Managers in admin

2009-09-08 Thread Alasdair
Thanks for your reply, Peter. When I set live = BadManager(), it properly returns posts, so maybe the issue is with my LiveEntryManager: class LiveEntryManager(models.Manager): def get_query_set(self): return super(LiveEntryManager,self).get_query_set().filter (status=self.model.LIVE_

Managers in admin

2009-09-08 Thread Alasdair
I've defined a custom manager class Entry(models.Model): [...] live = LiveEntryManager() objects = models.Manager() so that when I use _default_manager.all() it uses the LiveEntryManager (). However, the django admin is now also using LiveEntryManager. How can I get the admin to use

Re: Generic view 'archive_year' produces blank HTML page

2009-08-10 Thread Alasdair
ok at the docs at http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-date-based-archive-year Alasdair On Aug 11, 1:27 am, Matthew wrote: > I am using Django's generic views to create a blog site.  The > templates I created, entry_archive_day, ent

Re: psycopg installation error: C compiler cannot create executables

2007-01-05 Thread Alasdair
don't know if this helps - there might be a way grab it without DarwinPorts trying to install PostgreSQL but I don't know of a way. Please excuse my ignorance in these matters... - Alasdair --~--~-~--~~~---~--~~ You received this message because you a

Re: psycopg installation error: C compiler cannot create executables

2007-01-05 Thread Alasdair
PostgreSQL and psycopg without SSL support, or something like that. I hope everything works out - keep us posted. - Alasdair --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to