Re: I really about to give up Django

2013-08-30 Thread Aaron C. de Bruyn
Feel free to use whatever names you'd like in models. def Ikhouvanjou(models.Model): #whatever field names you want... -A On Fri, Aug 30, 2013 at 6:23 PM, Dan Gentry wrote: > > Just my opinion, but I see no reason to use English names in models. Use > whatever you wish. English speaking p

Re: I really about to give up Django

2013-08-30 Thread Dan Gentry
Just my opinion, but I see no reason to use English names in models. Use whatever you wish. English speaking programmers have been using cryptic variable names for decades. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje
anyone? -- 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 email to django-users@googlegroups

Re: Script to move django 1.4.3 to 1.5.1

2013-08-30 Thread Dan Gentry
I've been using Django since v1.0, and when each major version is released, I run through the release notes to see what I need to change. Russell is correct that most things will work from one version to the next, but I like to keep as up to date as possible to minimize my risk of hitting a de

Re: OperationalError: unable to open database file

2013-08-30 Thread Dan Gentry
When using sqlite3, one has to provide a full path to the database file. For my projects I use something like this on my development machines (for a database file named 'db'): import os PROJECT_DIR = os.path.dirname(__file__) DATABASES = { 'default': { 'ENGINE': 'django.db.backen

Re: JSON or YAML?

2013-08-30 Thread Andre Terra
It depends on where your data is coming from. YAML has less cruft in it, so if you're writing your own serializer you can consider it to have an advantage over JSON. OTOH, many applications can already export to JSON, so you can leverage that if that's the case. Finally, If you're writing anythin

Re: Admin: Add new dataset with a pre-selected foreign key?

2013-08-30 Thread Kelvin Wong
Take a look at filters in the admin. You might be able to add log entries to recent items using an appropriate ModelAdmin on 'entry_created' https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter Then use an InlineModelAdmin https://docs.djangoproje

Re: list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje
In my view i do this form, and it only works when i use list {% csrf_token %} {{ form.media }} Kies een profielnaam {% for field in form|slice:":1" %} {{ field.label_tag }} {{ field }} {% if field.errors %}{{ field.errors }}{% endif %} {% endfor %} Profielgegevens {%

list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje
Why does list(form) make my form not safe anymore? @login_required def create(request): if request.POST: logger.debug('>>>POST POST POST<<<') form = ProfielenForm(request.POST, instance=request.user.profile) if form.is_valid(): form

Re: JSON or YAML?

2013-08-30 Thread Rich Haase
Personal preference. Python has excellent libraries to support parsing both JSON and YAML. Sent from my iPhone On Aug 30, 2013, at 7:34 AM, Floor Tile wrote: > Helle everybody, > > Just a short and simple question: > > It seams that both JSON and YAML can be used for initial data loading. (

Why no locale (formats.py) for Australia en_AU or Canada en_CA?

2013-08-30 Thread Justin Hill
https://github.com/django/django/tree/master/django/conf/locale Does anyone have an idea as to why Australia doesn't have a locale format? en_GB is there, but no en_CA, or en_AU. My code is in seven countries and my forms are working in all of them except Australia and Canada. It's looking f

Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
Hi all, I got a form filed called : profilename When this field is filled in i want to skip if in my form, but i want to shot it when its empty. any easy way todo this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
thats doesnt work like i tought do :D class ProfielenForm(forms.ModelForm): #kleurogen = forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id='kleurogen')) #lengtehaar = forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id__name='lengtehaar'))

Re: Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
proberly something like this? def get_form(self, request, obj=None, **kwargs): if request.user.is_superuser: kwargs['exclude'] = ['foo',] return super(CategoryModelAdmin, self).get_form(request, obj, **kwargs) -- You received this message because you are subscr

Re: Removing the logged in user's name from the list of users in django

2013-08-30 Thread C. Kirby
I think you can use "is", but try this: {% if not likes.user == request.user %} On Friday, August 30, 2013 12:21:41 PM UTC-5, Robin Lery wrote: > > > I am getting an error: > > TemplateSyntaxError at /forum/ > > Unused 'is' at end of if expression. > > > > On Fri, Aug 30, 2013 at 10:05 PM, C. Kir

Re: A quick Question about ManyRelatedManager.

2013-08-30 Thread Laurent Meunier
On 30/08/2013 18:53, Abhishek Vaid wrote: Now I want to define *__unicode__(self)* method, in which I'll be creating a string representation for the *BacklogEntry* object. In doing so, I need to access all *users *which are referenced by *ManyRelatedManager*. Basically, I want to access name attr

Re: Removing the logged in user's name from the list of users in django

2013-08-30 Thread C. Kirby
To remove the current user from your list just use an if statement in your template that tests the user instance you are iterating over against request.user i.e. {% for likes in forum.likes.all %} {% if not likes.user is request.user %}{{likes.get_full_name}}{% endif

Re: Removing the logged in user's name from the list of users in django

2013-08-30 Thread Robin Lery
I can still see my name (the logged in user's name) on the list.. On Fri, Aug 30, 2013 at 10:05 PM, C. Kirby wrote: > To remove the current user from your list just use an if statement in your > template that tests the user instance you are iterating over against > request.user > i.e. > >

A quick Question about ManyRelatedManager.

2013-08-30 Thread Abhishek Vaid
I'm new to django and my question may be immature, but I really need answer to it. I have a model in my application as following. class BacklogEntry(models.Model): > > PRIORITY_CHOICES = dict([(0, 'NA'), (1, 'Low'), (2, 'Medium'), (3, > 'High'), (4, 'Very High'), (5, 'Apocalypse')]) >

Re: [View Django] Problem with view that makes add and update

2013-08-30 Thread Marcos Luiz Wilhelm
Hello! The problem that occurred was that the view when answering the case of modification, the id of the record was not passed when submitting the form. My solution was to add a block if / else to change the action of the form. The following code: http://pastebin.com/BtPrpqSJ I do not know if i

Admin: Add new dataset with a pre-selected foreign key?

2013-08-30 Thread Katja
Hi, I have a data model like this: class Samples(models.Model): sample_id = models.CharField(max_length=128, help_text='Id of the sample') entry_created = models.DateTimeField(auto_now_add=True) sample_status = models.CharField(choices=SAMPLE_STATUS_CHOICES, max_length=128) comments = m

Re: JSON or YAML?

2013-08-30 Thread Floor Tile
In that case I'll go for JSON too as I'm already familiar with it. Thanks for the quick reply. On Fri, Aug 30, 2013 at 2:37 PM, Some Developer wrote: > On 30/08/2013 14:34, Floor Tile wrote: > >> Helle everybody, >> >> Just a short and simple question: >> >> It seams that both JSON and YAML can

Re: JSON or YAML?

2013-08-30 Thread Some Developer
On 30/08/2013 14:34, Floor Tile wrote: Helle everybody, Just a short and simple question: It seams that both JSON and YAML can be used for initial data loading. (among other data types but I don't care about them for the moment) But can't figure out what the up and/or downsides of them are. Is

JSON or YAML?

2013-08-30 Thread Floor Tile
Helle everybody, Just a short and simple question: It seams that both JSON and YAML can be used for initial data loading. (among other data types but I don't care about them for the moment) But can't figure out what the up and/or downsides of them are. Is it purely a matter of personal preference

Re: reload counts

2013-08-30 Thread Ninja Master
How about django-hitcount or django-tracking if you're after analytics support? Warm regards On Friday, August 30, 2013 7:27:26 AM UTC+1, Harjot Mann wrote: > > I want to add a feature in my app in

Re: OperationalError: unable to open database file

2013-08-30 Thread jumpmanlane
make sure you don't have another instance of django running already. -J On Monday, July 22, 2013 1:48:43 PM UTC-4, Stian Sjøli wrote: > > i get this error while going throught the tutorial from the django > website. I am a mac user, and have modified my settings-file to use sqlite3 > and the na

Re: Browsing a certain website within another website?

2013-08-30 Thread jumpmanlane
iframes? -J On Tuesday, August 6, 2013 12:43:32 AM UTC-4, Somnath wrote: > > is it possible to browse certain website within another website in django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rec

Re: Django error with installing reviewboard on solaris.

2013-08-30 Thread jumpmanlane
you might need Python 2.7+ -J On Wednesday, August 21, 2013 4:25:29 AM UTC-4, tomoya.f...@gmail.com wrote: > > I'm trying to install reviewboard on solaris 10, but this Django problem > stops me to do that. > Does anyone know how to get through this problem? > (python is 2.4) > > bash-3.2# pwd >

Re: django refreshing problem

2013-08-30 Thread Sithembewena Lloyd Dube
Clear your browser cache and check your preferences. Then restart the browser. On Fri, Aug 30, 2013 at 8:28 AM, Harjot Mann wrote: > On Mon, Aug 26, 2013 at 2:36 PM, Harjot Mann > wrote: > > In django whenever I make some template I need to refresh it. I am not > > getting what is the problem,