Re: Possible Django bug I am considering raising

2020-06-05 Thread Ramiro Morales
Remember you can not juat open/report an issue and bisect the git commit
which could have introduced the change in behavior, but also, if it gets
confirmed as a real bug, you can fix it yourself so to not delay yourself
in your current project. With the nice side effect that the fix will
benefit many others.

Another option would be: If you can't or don't want to do what I suggest
above then Are you willing to commit to funding another Django contributor
to get this immediate attention & personalised service so to be able to
solve the issue affecting your current project/client?

On Fri, Jun 5, 2020, 7:50 AM 'OwlHoot' via Django users <
django-users@googlegroups.com> wrote:

>
>
> On Thursday, 4 June 2020 23:45:53 UTC+1, Tim Graham wrote:
>
> You can try to find the commit that introduced the issue:
>> https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression
>>
>
> I'm happy to try and do this, i.e. produce a simple test case that fails,
> and then find the commit that first caused this, provided I am assured that
> if I can then a Django maintainer/developer will jump on this and fix it
> pronto!
>
> If the result will be added to some list where someone will think about
> maybe fixing it in six months, and then only if anyone else complains, I'll
> have long since moved on to another project and/or another client and the
> issue will be of no interest to 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/016c2855-ec5e-4880-ac18-c4f5660732dbo%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8%3DDfYBbd4UxwvRfdxvgRx9fRp_fm9jLMN1AGVz9YeZjA%40mail.gmail.com.


Re: pip install Django==3.0

2019-12-02 Thread Ramiro Morales
‪On Mon, Dec 2, 2019 at 1:06 PM ‫אורי‬‎  wrote:‬

> Django users,
>
> When I use pip to install a package, does it depend on the version of
> Python I'm using?
>
> pip install Django==3.0 fails with Python 3.5:
> https://travis-ci.org/speedy-net/speedy-net/builds/619671495
>
> But it succeeds with Python 3.6 and 3.7. I noticed that Django 3.0 doesn't
> support Python 3.5. But why does pip fail?
>

Django 3.0 doesn't support Python 3.5.

It's the first item in the release notes document:
https://docs.djangoproject.com/en/3.0/releases/3.0/#python-compatibility

See also:

https://docs.djangoproject.com/en/3.0/faq/install/#what-python-version-can-i-use-with-django


> אורי
> u...@speedy.net
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABD5YeG8ezgQpM7uHmVGsKMrQnw5OArZTf%3DHYTkar7s4QdHt2Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABD5YeG8ezgQpM7uHmVGsKMrQnw5OArZTf%3DHYTkar7s4QdHt2Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Ramiro Morales
@ramiromorales

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-hfB3Cmao_ZLO3eD942aZFADfPNug---jANn_pXR6Q_g%40mail.gmail.com.


Re: Bugs: cannot start runserver since Django 2.2.2

2019-06-05 Thread Ramiro Morales
ut_cache
> self._writeout_input_cache(conn)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/IPython/core/history.py"
> , line 764, in _writeout_input_cache
> (self.session_number,)+line)
> sqlite3.ProgrammingError: SQLite objects created in a thread can only be
> used in that same thread. The object was created in thread id
> 140317622679296 and this is thread id 140318198236928.
>
> --
> 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.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/293d54e9-64f4-47d8-81f5-9624ac806a07%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/293d54e9-64f4-47d8-81f5-9624ac806a07%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9phRhqz2SOxNVevb_58K2Ezz5Gm_4xoiF7M4KKtQDTpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Autoreloader looping Django 2.2

2019-04-29 Thread Ramiro Morales
Hi Dan,

On Fri, Apr 26, 2019 at 11:00 AM Dan  wrote:

> Forgot to mention that this is on a mac osx host with ubuntu 16 virtualbox
> guest, I'm not sure that has something to do with it?
>
> On Thursday, April 25, 2019 at 10:06:59 PM UTC+2, Dan wrote:
>>
>> I'm using Django 2.2 on a new project and suddenly the autoreloader is
>> looping when I change a file
>>
>>
>> DEBUG:
>>
>>
>> /urls.py. is_changed: False, is_new: True
>>
>> /urls.py previous mtime: None, current mtime: 1556221457.0
>>
>> /urls.py notified as changed. Signal results: [(> translation_file_changed at 0x7fd933e05d90>, None)].
>>
>> /urls.py changed, reloading
>>
>> It says the file is new but it was just changed - it refers
>> to translation_file_changed but I have no translation files in my project.
>>
>>
>> My project is on a virtualbox shared folder, if I start a new project
>> from scratch it works ok and previous versions of Django work fine.
>>
>>
>> I tried using watchman + pywatchman and it doesn't seem to work at all, I
>> dont think it works with shared virtualbox folders.
>>
>>
>> Is there anyway I can get this working with 2.2 can I use the old
>> reloader or do I need to revert to 2.1?
>>
>
>
Can you try the stable/2.2.x git branch? it contains a couple of post-2.1
fixes to the reloading code which will get released as 2.2.1 in a few days
AFAIK..

Also, is the folder  where urls-py is located shared between the host and
the VM in some way? What file system type is the host using?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-i_q_utWwRZmv9Ab9rWGLZRtaqW-woZb%3DfP68DSoF%3DAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Handling multiple timezones in Django Admin

2018-10-02 Thread Ramiro Morales
Paul,

You seem to have a good grasp of the usability problem you describe and a
sound strategy to solve it. You've even researched how modern web browser
can help in improving this admin app feature.

I'm sure the project would accept a pull request implementing the changes
you outline. Or if not, it would be a catalyst to get a solution for it
into the code base sooner than later.

Feel free to try your hand.

Regards,

On Tue, Oct 2, 2018, 6:19 PM Paul Tiplady  wrote:

> Timezone handling in the Django admin is quite confusing when there are
> users in multiple timezones -- does anyone have a good way of handling this?
>
> I'm using USE_TZ=True, TIME_ZONE='UTC', USE_I18N, USE_L10N. I have admin
> users in US/Pacific and US/Eastern.
>
> When viewing a datetime field, users see the UTC time, with a note below
> saying "Note: You are 7 hours behind server time". This is better than
> nothing, but still quite sub-par for a 201x-era web UI. We really should be
> localizing the timezones in the browser to the user's own time zone, and
> submitting back to the app using TZ-aware timestamp strings. (It's possible
> to pull the TZ unambiguously from a modern browser:
> https://stackoverflow.com/a/37512371/37481).
>
> Any suggestions for getting round this? I'm wondering if there's a good
> tz-aware datetime widget for the admin? Or perhaps a clean way of storing a
> User.time_zone config property that could be used to localize the admin
> cleanly.
>
> Cheers,
> Paul
>
> --
> 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.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/36a1bd2c-490d-4ad8-86f6-0af5425bb7f2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9RE%2BGJ28SnPAUE%3DV2zwJO8b0NRdP2H6%2B%2BGuUxa91cSsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin makemessages --no-obsolete doesn't seem to be working

2018-03-19 Thread Ramiro Morales
On Sun, Mar 18, 2018 at 11:18 AM, Kishor Pawar <krisp1...@gmail.com> wrote:

> First of all, I am expecting `--no-obsolete` would comment out `msgid` and
> `msgstr` if `gettext` is deleted, right?
>

AFAIK there is no  (and there wasn't ever) a `--no-obsolete` modifier to
the makemessages command.

Did you read about that somewhere? Can you post a link?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_TzeA3Q6wd8K4PMvSCLiux0KOO4cEwOAo7bm%3D_JfYy2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-payslip

2018-01-21 Thread Ramiro Morales
The detailed error page is giving you all the information you need to
diagnose the issue.

It tells you you have two paths defined in your URL map: /admin/ and
/payslip/ as per their respective documentation. So far so good.

But you are accessing / with your browser. Hence the 404 error. Try
accessing /payslip/

Best regards,

On Jan 22, 2018 12:29 AM, "sum abiut"  wrote:

Hi,
Has anyone from list have any experience with django-payslip before. I
follow direction from https://pypi.python.org/pypi/django-payslip/0.2.2

But i got the error below trying to load the page. Please advise

[image: Inline image 1]

cheer,

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/CAPCf-y7qm3AVp5dizF-QqG39dW0OpbJuc783rnW8Ln
HHG4Wwfw%40mail.gmail.com

.
For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-06Q%2BtVwgp0we%3DOKR6RGyaU33kU_LeXLr8TbUia3G-Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Failing to configure Django correctlly (conflict in settings between models.py and manage.py usage).

2018-01-05 Thread Ramiro Morales
On Fri, Jan 5, 2018 at 9:07 AM, alex Tarasiuk <alext...@gmail.com> wrote:

> Hi, I'm new to Django and having some trouble to configure it.
> I'm using Django 1.11.9 (1.11.5 at first but then upgraded with hopes it
> will solve the issue) and Python 2.7.12 from virtualenv.
>
> Here is my project structure (Please pay attention to upper/lower case
> letters - it is intentionally):
>
> :
>
> module 1
>
> module 2
>
> ...
>
> ...
>
> MY_DJANGO:
>
> MY_DJANGO:
>
> __init__.py
>
> settings.py
>
> urls.py
>
> wsgi.py
>
> my_django:
>
> migrations
>
> __init__.py
>
> admin.py
>
> apps.py
>
> models.py
>
> tests.py
>
> views.py
>
> __init__.py
>
> manage.py
>
> in models.py I've added:
>
> import os
> import django
> os.environ["DJANGO_SETTINGS_MODULE"] = "MY_DJANGO.MY_DJANGO.settings"
> django.setup()
>
> before the models import from django.db.
>
> in manage.py, in the main
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MY_DJANGO.settings")
>
> was auto generated by Django
>
> in settings.py, in INSTALLED_APPS:
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django.contrib.sites',
> 'django.contrib.admindocs',
>
> ==>>>>'MY_DJANGO.my_django', or 'my_django', <<<<= Here is
> the problem
>
> ]
>
>
> Problem description:
>
> if I use 'MY_DJANGO.my_django' in INSTALLED_APPS then running 'python
> manage.py check' command yields:
>
>  ImportError: No module named MY_DJANGO.settings
>
>
>
>
> and if I use 'my_django' in INSTALLED_APPS then I have an import error
> while importing models:
>
>  from MY_DJANGO.my_django import models (in some file) yields:
>
> ImportError: No module named my_django
>
>
> Also tried to add  ''my_django.apps.MyDjangoConfig' to INSTALLED_APPS,
> and it didn't helped.
>
> What am I doing wrong??
>
>

You describe the problem you are seeing but don't tell why you are setting
things up .

What are you trying to achieve with things like this:

*in models.py I've added:*

import os
import django
os.environ["DJANGO_SETTINGS_MODULE"] = "MY_DJANGO.MY_DJANGO.settings"
django.setup()

*before the models import from django.db.*

or

*in settings.py, in INSTALLED_APPS:*

INSTALLED_APPS = [
...
==>>>>'MY_DJANGO.my_django', or 'my_django', <<<<===== Here is the
problem

]


*Also tried to add  ''my_django.apps.**MyDjangoConfig' to INSTALLED_APPS,
and it didn't helped.*

All of this is very unconventional.

If you are starting with Django you should refrain from doing weird things.
Django currently does no magic outside the Python import system so there is
no need to over complicate.

TBH No upgrade of Django is going to help you the mess you currently have.


-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9xg8_23kATinOgU%2B%2BKTBYPEOhoSBWyjUj3Sdi5d%3DBdHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I change the TabularInline "title" on Django Admin?

2016-07-13 Thread Ramiro Morales
On Tue, Jul 12, 2016 at 2:42 PM, Fellipe Henrique <felli...@gmail.com>
wrote:


> On Tue, Jul 12, 2016 at 1:52 PM, Ramiro Morales <cra...@gmail.com> wrote:
>
>> Where the 'Conjunto de dados' seen in the screenshot title comes from? Is
>> the code you posted actually in sync with it?
>
>
> Sorry about that, I take the screenshot before change these text to
> "DataSet"...
>
> [image: Inline image 1]
>
> My problem is, the second "Dataset" (on light gray line) and
> "Dataset_users object"* <https://github.com/fellipeh>*
> <https://groups.google.com/group/django-users>
> <https://groups.google.com/d/msgid/django-users/CAF1jwZF2WwricBicEKxPL7eWsp%2BQrTuD7YgCQueNfKAWzyTDrA%40mail.gmail.com?utm_medium=email_source=footer>



I've prepared this simplified app.

Note: All the is completely centered around controlling the labels in the
admin views, this can mean things get completely ugly on ther UI areas.

The Dataset model setup is basically what you posted originally, the Sample
model is very similar to Dataset but the M2M relationship between User and
Sample is defined through an explicit SampleUserRel model. See


https://docs.djangoproject.com/en/1.9/topics/db/models/#intermediary-manytomany


https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.ManyToManyField.through

and


https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#working-with-many-to-many-intermediary-models

sections of the Django documentation.

#
# models.py
from __future__ import unicode_literals

from django.db import models
from django.utils.encoding import python_2_unicode_compatible


@python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=200, blank=True, null=True)
email = models.EmailField(blank=False, unique=True)

def __str__(self):
return self.email


@python_2_unicode_compatible
class Dataset(models.Model):
active = models.BooleanField(default=True)
title = models.CharField(max_length=250)
users = models.ManyToManyField(User)

def __str__(self):
return self.title


@python_2_unicode_compatible
class Sample(models.Model):
active = models.BooleanField(default=True)
title = models.CharField(max_length=250)
users = models.ManyToManyField(User, through='SampleUserRel')

def __str__(self):
return self.title


@python_2_unicode_compatible
class SampleUserRel(models.Model):
user = models.ForeignKey(User)
sample = models.ForeignKey(Sample, verbose_name='this can be set with
the verbose_name option of the FK field to the remote model in the
intermediate model')

def __str__(self):
return "this can be set with the intermediate model's __str__
method"

#
# admin.py
from django.contrib import admin

from .models import Dataset, User, Sample, SampleUserRel


class DatasetInline(admin.TabularInline):
model = Dataset.users.through
verbose_name = 'this can be set with
{Stacked,Tabular}Inline.verbose_name'
verbose_name_plural = 'this can be set with
{Stacked,Tabular}.verbose_name_plural'


class SampleUserRelInline(admin.TabularInline):
model = SampleUserRel
extra = 1
verbose_name = "this can be set with intermediate's model verbose_name
and overridden with {Stacked,Tabular}Inline.verbose_name"
verbose_name_plural = "this can be set with intermediate model's
verbose_name_plural and overridden with
{Stacked,Tabular}Inline.verbose_name_plural"


class UserAdmin(admin.ModelAdmin):
list_display = ('email',)
inlines = [DatasetInline, SampleUserRelInline]


admin.site.register(User, UserAdmin)
admin.site.register([Dataset, Sample])

Btw, something like this is what we talk about when we ask for an excerpt
of the code with only the relevant parts, please take the time to prepare
things by stripping code unrelated to the issue at hand before posting your
code. Help us to help you.

The above setup results in the following Change User view:

[image: Inline image 1]

Hoping this is of help,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_dupadcYtQpwWaCOBxTZ13G-rHh%2B4u2sQLbMwa0UJwnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I change the TabularInline "title" on Django Admin?

2016-07-13 Thread Ramiro Morales
On Tue, Jul 12, 2016 at 8:39 PM, Lachlan Musicman <data...@gmail.com> wrote:

> There's a ticket for this in the tracker iirc, but I can't find it now. I
> think the reason is because that's the name of the DB field - it's not
> localizable (in so much as we don't localize db field names).
>

That was mi recollection too. But I've been unable to find it.

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9ExFBK48FYB4q%2BOHDFxPxM0KoY6-0DbTn-Aip2U4q1jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I change the TabularInline "title" on Django Admin?

2016-07-12 Thread Ramiro Morales
On Tue, Jul 12, 2016 at 1:44 PM, Fellipe Henrique <felli...@gmail.com>
wrote:

>
> On Tue, Jul 12, 2016 at 1:34 PM, Ramiro Morales <cra...@gmail.com> wrote:
>
>> Can you post a simplified excerpt of the relevant (fields, Meta options,
>> __*__ methods) models, admin app ModelAdmin's and *Inline's involved which
>> result in the layout depicted in the screenshot you posted?
>>
>
> Sure, here is:
> [...]
>
>
Where the 'Conjunto de dados' seen in the screenshot title comes from? Is
the code you posted actually in sync with it?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8vzCTb9PCpzVw%2BeOyQ%3DfoWH%2B4emwGPNQNM%2BAR-0U9r4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I change the TabularInline "title" on Django Admin?

2016-07-12 Thread Ramiro Morales
On Tue, Jul 12, 2016 at 12:54 PM, Fellipe Henrique <felli...@gmail.com>
wrote:

>
> On Thu, Jul 7, 2016 at 5:24 PM, Michal Petrucha <
> michal.petru...@konk.org> wrote:
>
>> In that case, the “DATASET” would be the verbose_name of that field,
>> and “Dataset_users object” is the string representation of the
>> original original object that the row corresponds to.
>>
>
> Unfortunately no.. :(
>
> I have set all verbose_name and verbose_name_plural, on all models.. and
> all models have str representation.. but still show these dataset_users
> object... instead the verbose_name
>
> These "problem" occur only when I have M2M field.. in other FK fields
> doesn't appears..
>


Can you post a simplified excerpt of the relevant (fields, Meta options,
__*__ methods) models, admin app ModelAdmin's and *Inline's involved which
result in the layout depicted in the screenshot you posted?

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8owYdEzwVhsDvF%2BXoC-86MbTE-%2BRcnZRcF27TZq3m4_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with dumpdata/loaddata

2016-04-08 Thread Ramiro Morales
It shouldn't. Are you sure you haven't opened and saved the json file with
a text editor that might be adding the BOM, e.g. Notepad before running
loaddata?
On Apr 7, 2016 9:17 PM,  wrote:

> Opening the JSON file in Notepad++ certainly gives some insight... It says
> it's encoded in USC-2 LE BOM. Converting it to UTF-8 with BOM in Notepad++
> solves the problem.
>
> Question though, why does dumpdata create files with an encoding that can
> not be used out of the box with loaddata?
>
> --
> 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.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b3f4fbbf-bcad-4376-8ed1-aa476b8c8a88%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-BeSfPadGMGShP-0K4NCyfiqNFktSOXkYdGz7fQSMnTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: install gettext tools 0.15

2015-10-30 Thread Ramiro Morales
On Fri, Oct 30, 2015 at 5:59 PM, Dariusz Mysior <mysior.da...@gmail.com>wrote:
> I do this and I have msfgmt is not recognized as an internal or external
> command, operable program or a batch file.

Then you'll need to identify, among the directories created by the
installation of gettext tools, which is the one that contains
msgfmt.exe. That's the one you need to add to the PATH env var.

>
> W dniu piątek, 30 października 2015 21:33:52 UTC+1 użytkownik Dariusz Mysior
> napisał:
>>
>> I use Windows 8 Python 3.4 Django 1.8 and I try
>>
>> I set settings and add: USE_I18N = True
>>
>> add to MIDDLEWARE_CLASSES django.middleware.locale.LocaleMiddleware
>>
>> like in describe in link below
>>
>>
>> https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#gettext-on-windows
>>
>> I download gettext-runtime_0.18.1.1-1_win64 and
>> gettext-tools_0.18.1.1-1_win64 extract to C:\Program Files\gettext-utils add
>> path like in link to Control Panel > System > Advanced > Environment
>> Variables and when I write to terminal C:\Python34\ownsite>manage.py
>> compilemessages I had info :(
>>
>> CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15
>> or newer installed.
>>
>> What can I do more??? I have lost a few days on
>

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-1ZGuAQV3pOHWLOeLnj_nS7Tue8KSFRR%3DgMrXDyD35VQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: install gettext tools 0.15

2015-10-30 Thread Ramiro Morales
On Fri, Oct 30, 2015 at 5:33 PM, Dariusz Mysior <mysior.da...@gmail.com> wrote:
> I use Windows 8 Python 3.4 Django 1.8 and I try
>
> I set settings and add: USE_I18N = True
>
> add to MIDDLEWARE_CLASSES django.middleware.locale.LocaleMiddleware
>
> like in describe in link below
>
> https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#gettext-on-windows
>
> I download gettext-runtime_0.18.1.1-1_win64 and
> gettext-tools_0.18.1.1-1_win64 extract to C:\Program Files\gettext-utils add
> path like in link to Control Panel > System > Advanced > Environment
> Variables and when I write to terminal C:\Python34\ownsite>manage.py
> compilemessages I had info :(
>
> CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15
> or newer installed.
>
> What can I do more??? I have lost a few days on

Make sure you can execute msgfmt.exe from any path on your system.
That will indicate the directory where it is located has actually and
correctly been added to the PATH environment variable.

For example, open a Command prompt window and type msfgmt.

This is more a general Windows system admin topic.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-K2XNuxa4cGkp4hmq8mtDL%3DvDY4f22zK7LHgCiXr%3DPtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: py2neo - how to get a node

2015-06-12 Thread Ramiro Morales
On Jun 12, 2015 7:28 PM, "Shekar Tippur"  wrote:
>
> Hello,
>
> I am trying to use py2neo (http://py2neo.org/2.0/ext/ogm.html).
> I am having trouble looking up a node.

Wouldn't this post be more appropriate for the py2neo users mailing list or
similar?

Just in case, you posted your message to the Django users mailing list.

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF__RwnX8qvkgvt1RYsV8_i2UBRjSdW-qC5zv29oZ1OTuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: annotate() questions

2015-04-16 Thread Ramiro Morales
On Wed, Apr 8, 2015 at 3:07 PM, Carsten Fuchs <carsten.fu...@cafu.de> wrote:

> Dear Django fellows,
>
> at https://docs.djangoproject.com/en/1.8/topics/db/aggregation/#joins-and-
> aggregates the first example is:
>
> >>> from django.db.models import Max, Min
> >>> Store.objects.annotate(min_price=Min('books__price'),
> max_price=Max('books__price'))
>
> which will annotate each Store object in the QuerySet with the minimum and
> maximum prices that its books have.
>
> [...]
>
>   2) Can this annotation be filtered? For example, if for each Store we
> wanted to learn the min and max prices of books published in 2014, can this
> be done?
>

I can help with this one. In fact you cant combine annotations with
filters. See

https://docs.djangoproject.com/en/1.8/topics/db/aggregation/#aggregations-and-other-queryset-clauses

"...When used with an annotate() clause, a filter has the effect of
constraining the objects for which an annotation is calculated. For
example..."

e.g.::


Store.objects.filter(books__pubdate__year=2014).annotate(min_2014_price=Min('books__price'),
max_2014_price=Max('books__price'))

HTH

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8iqNxUpk%2B8-J3H%3D4JPDU6GUBZxdW_M6kOUb0K-8a3DRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial missing import: Http404

2015-04-10 Thread Ramiro Morales
On Fri, Apr 10, 2015 at 6:31 PM, John Matthew Ian Davis <
johnmatthewianda...@gmail.com> wrote:

> obviously one needs to change:
>
> from django.http import HttpResponse,
>
> to
>
> from django.http import HttpResponse, Http404
>

If you are talking about part 3 of the tutorial then it in fact contains an
import of Http404 and it's intrdroduced together with the first piece of
code that uses it.

It's right in the views.py snippet located under the "Raising a 404 error"
section title:
https://docs.djangoproject.com/en/1.8/intro/tutorial03/#raising-a-404-error

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-p6F_6reyXKni0kuBeAyWDFia-%2BwZkG9HzLYLQfGYq5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-run only tests that failed last time

2015-03-24 Thread Ramiro Morales
On Tue, Mar 24, 2015 at 7:27 AM, Gergely Polonkai <gerg...@polonkai.eu> wrote:
> Hello,
>
> I have a pretty extended test suite for my application, which can run for
> about 15 minutes. Now when I introduce an error, I will be notified of it
> pretty late, and a one-liner fix needs another 15 minutes to check. Of
> course if only one of my tests fail, I can add the name of the test case as
> a parameter to manage.py test, but in case of many failures it’s pretty hard
> to do the same.
>
> Is there a way to run only the tests that failed last time, even if I have
> to install a separate app/module for that? A quick Google search gave me no
> usable results.

Mine found:

https://pypi.python.org/pypi/django-juno-testrunner
http://nose.readthedocs.org/en/latest/plugins/testid.html#looping-over-failed-tests
plus https://github.com/django-nose/django-nose

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_-Km0%2BHC9jcJ%3DfvFJEJZqQoA_Xp_uSL6r0cTCSXjhN%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: translation of view messages and business related messages not working

2014-10-30 Thread Ramiro Morales
On Oct 30, 2014 8:45 PM, "Marcela Campo"  wrote:
>
> Hi,
>   I am using the translation functionality in Django 1.7 successfully for
plain strings in a template, so something simple like
>
> {% trans "Edit Client" %}
>
> works just fine.
>
>
> I am now trying to translate success_message from views with the
SuccessMessageMixin and also error messages that bubble up from business
logic but I just can't make those work.The messages show up for translation
in the .po file. For example:
>
> # python-format
> #: views/adminDashboard.py:158
> #, python-format
> msgid "Productive Unit %(name)s has been created."
> msgstr "La Unidad Productiva %(name)s ha sido creada."
>
> I have compiled the messages already.
>
> In my view
>
> 
> 
> from django.utils.translation import ugettext as _

Try replacing ugettext with ugettext_lazy. Read the relevante documentation
for the details.

> class CustomerFieldUpdateView(AdminRequiredMixin, SuccessMessageMixin,
UpdateView):
> model = Field
> template_name = 'ui/field_update_form.html'
> success_message = _('Productive Unit %(name)s has been updated.')
> .
>
> In the template:
> 
> {% load i18n %}
> 
> {% if messages %}
> {% for message in messages %}
>   {{ message }}
> {% endfor %}
> {% endif %}
> 
>
>
> If I look at self.request.LANGUAGE_CODE in the view is set to 'es' but
still the messages that bubble up from python code are displayed in the
default ('en') whereas the plain strings in the template are correctly
translated to spanish. I also tried using {% trans message.message %} or
blocktrans as well, but nothing works.
>
> Any ideas what I am missing?
>
> Thanks!!!
> Marcela
>
>
>
>
>
> --
> 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.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/be1ce953-ccee-4016-b4d6-686655755986%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8vJ5fx57V5CqmYqgtz_7Y5V%3DPNV_tx0XzgKBDXcGiMNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TEST_MIRROR not working?

2014-10-26 Thread Ramiro Morales
Actually, in 1.7.x both should work.

Ilya: Can you test if using TEST_MIRROR fixes the issue you are seeing?
On Oct 26, 2014 9:19 AM, "Tom Evans"  wrote:

> On Sat, Oct 25, 2014 at 5:21 PM, Ilya Baryshev  wrote:
> > Hey all!
> >
> > I was writing tests for queries that use replica database, so I tried
> using
> > TEST_MIRROR setting.
> > TEST_MIRROR promises "connection to slave will be redirected to point at
> > default.
> > As a result, writes to default will appear on slave". Which happens not
> to
> > be the case for me,
> > replica queries are not returning expected results.
> >
> > Is this a bug, or am I missing something?
> >
> > Here is my example settings:
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> > 'NAME': 'testmirror',
> > 'HOST': '127.0.0.1',
> > 'PORT': 5432,
> > },
> > 'slave': {
> > 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> > 'NAME': 'testmirror2',
> > 'HOST': '127.0.0.1',
> > 'PORT': 5432,
> > 'TEST': {
> > 'MIRROR': 'default'
>
> This should be 'TEST_MIRROR': 'default'
>
> Cheers
>
> Tom
>
> --
> 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.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1L%3DU95K4_XreTm%3D2aET3JRPCCeQL1773wgRZ_25eJX7gQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8F6d3rqYHJ5hj7Rfkom8%3DeHv7h1TTbpkSack1ATjg8Lg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-cms apphook urls don't work with reverse() using Python shell

2014-08-19 Thread Ramiro Morales
On Tue, Aug 19, 2014 at 8:14 AM, Philipp <webmas...@radio.ch> wrote:
> [...]
>
> This is my urls.py file:
>
> urlpatterns = patterns('',
> url(r'^(?P[\w\-]+)?', ArticleView.as_view(),
> name='article-by-slug'),
> )
>
> [...]
>>>> reverse('article_app:article-by-slug', kwargs={'slug': a.slug})

Try with::

reverse('article_app:article-by-slug', args=[a.slug])

> # Reverse for 'article_app:article-by-slug' with arguments '()' and keyword
> arguments '{'slug': 'this-is-article-1'}' not found.

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-UrHAgOOFC2iS3NZbyXUs99%2B9xC7MrnXDUDaMFBkLT2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in shell when following Django tutorial

2014-08-09 Thread Ramiro Morales
Ramiro Morales
@ramiromorales
On Aug 9, 2014 7:13 PM, "Daniel Grace" <danwgr...@gmail.com> wrote:
>
> I get an error in the shell when following the tutorial
> https://docs.djangoproject.com/en/1.6/intro/tutorial01/
>
> C:\Users\Daniel\My Documents\Python\DjangoTest\mysite>python manage.py
shell
> Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64
bit (AM
> D64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from polls.model import Poll, Choice
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named 'polls.model'
> >>> from polls.model import Poll, Choice
>

The name the Python module you've created/modified in a prior step and need
to import now is 'models'. Note how it's in plural while you are trying to
import 'model'.

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-Kn9zteUXaXowsjiVxBmqFC%3DFe-NZs0cNk-yc2px0H_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Seems to be a bug in makemessages management command

2014-05-31 Thread Ramiro Morales
On Sat, May 31, 2014 at 7:50 AM, Андрей Меньков
<nothingelsematte...@gmail.com> wrote:
>
> I thing the problem is in function django.utils.translation.templatize. It's
> implementation could be found in django.utils.translation.trans_real module.
>
> From docstring for it:
>
> Turns a Django template into something that is understood by xgettext. It
> does so by translating the Django translation tags into standard gettext
> function invocations.
>
> Function calling results:
>>> templatize(" {{ _('kfhdsajfkh') }} ")
>>> ('kfhdsajfkh')
>
>>> templatize(""" {{ _(''' abcdefg
> hhjkfhsdajfk
> fsdauyuirywer
>''') }}
>
>   """)
>>>  XX X XXX
>  
>  X
>   XX
>
>
> So it can be seen that templatize function marks multiline strings as not
> needed to translate.

As Russ says, it's not clear to me if the _() template construct you
are using is from Django i18n or from Jinja.

Django template tags (including trans) aren't multi-line. There is a
ongoing discussion about this.

If you use the Django blocktrans template tag, multi-line literals are
perfectly suported by templatize():

In [1]: from django.utils.translation import templatize

In [2]: templatize("""{% blocktrans %}foo
bar
baz
{% endblocktrans %}""")
Out[2]: " gettext(u'foo\\nbar\\nbaz\\n') SSS\nSSS\nSSS\n"

In [3]:

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8%3DrNwR%3DOxAGs7TVv8NXA6c8Q%3DA5kD71eOb2mY8mWixCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django ugettext translation glitch or as designed?

2014-05-30 Thread Ramiro Morales
On Fri, May 30, 2014 at 10:51 PM, visionary800 <drjosereyn...@gmail.com> wrote:
> Bad: 2 - This Fails: when ugettext is in another file
> file : /project/app/views.py
>
> ...other imports
> from .mytext import FROM_ANOTHER_FILE
>
> class BaseView(ContextMixin, View):
> template = 'base.html'
>
> def get(self, request, *args, **kwargs):
> context = self.get_context_data()
> return render(request, self.template, context)
>
> def get_context_data(self, **kwargs):
>
>context['translate_this']= FROM_ANOTHER_FILE
>return context
>
> file: /project/app/text.py
> from django.utils.translation import ugettext
>
> FROM_ANOTHER_FILE = ugettext('name')
>
> -
>
> The primary difference between the two examples is that when I separate
> ugettext() to another file - it fails.
> The result is that 'name' never converts to 'nombre' when changing the
> language.
> It works fine in example 1, 'name' and 'nombre' change depending on language
> selected but not in example 2.

In example 2 your translatable literal is defined and marked-up with
the translation function at the global scope of the module. In these
cases you need to use lazy translations, i.e. ugettext_lazy() instead
of ugettext().

Read the the relevant documentation carefully for the details:

https://docs.djangoproject.com/en/1.6/topics/i18n/translation/#lazy-translation

HTH,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9uu7BF%2Bf5DK5kXa%2B5NeSQmne89N2x%3DGEwxLckQYyTBig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syntax usage for the Database name ??

2014-05-14 Thread Ramiro Morales
On Wed, May 14, 2014 at 8:38 AM, Eran Ariel <eran.ar...@gmail.com> wrote:
> Hi,
>
>
>
> I am uncertain as to the proper syntax usage for the Database name.
>
> I have a MYSQL database called "test". Does the subsequent script
> automatically point to the folder where mysql databases reside on my Ubuntu
> machine?
>
>
>
> os.path.join(BASE_DIR, 'db.test ')
>
>
>
> Furthermore, the instructions as per the Django site are to provide the full
> path where the database resides… However, I am again uncertain whether that
> refers specifically to all databases and how to apply it in proper syntax
>
>
>
> Can someone provide me with a configuration example?

If you are using a RDBMS like mysql, or any of them different from
sqlite3 then in the NAME value you should simply specify the name of
the database in which you want Django creates the tables for the apps
of your project.

Per 
https://docs.djangoproject.com/en/1.6/topics/install/#get-your-database-running
and https://docs.djangoproject.com/en/1.6/intro/tutorial01/#database-setup,
that database should have been created previously using the MySQL
administrative tools and the user you plan to use should have the
right permissions on it.

sqlite3 is special in the sense that it is a embeddable library (as
opposed to a RDBMS). That's why you need to specify the file system
path to the file the library will create the first time. No need to
provide USER/PASASWORD credentials because that's another feature it
doesn't provide.

With a RDBMS you connect to it possibly through the network and use
SQL to handle tables. It is in charge of handling low level details
like which files(s) it is using to store your data.

An example DATABASES setting value (for postgres)::

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '',
'NAME': 'django_test_suite',
'USER': 'ramiro',
'PASSWORD': '123',
},
'other': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '',
'NAME': 'other',
'USER': 'ramiro',
'PASSWORD': '123',
}
}

HTH

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-zRbZG4dX90MET8ynynajTYdM%2BvwRqjaOuCNeDMHNC-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incorrect SQL

2014-03-22 Thread Ramiro Morales
On Sat, Mar 22, 2014 at 7:48 PM, egon.frer...@gmx.de
<egon.frer...@gmx.de> wrote:
> With django 1.6.2, python3 and MySQL manage.py inspectdb brings this error:
>
> django.db.utils.ProgrammingError: (1064, "You have an error in your SQL
> syntax; check the manual that corresponds to your MySQL server version for
> the right syntax to use near '%s AND table_schema = DATABASE()\n
> AND character_maximum_length IS' at line 2")
>
> I put some print statements in
> - django/db/backends/mysql/introspection.py line 43
> - django/db/utils.py line 111, 125, 151, 154, 165, 202
> - django/db/backends/util.py line 47
>
> The output with traceback shows in line 22 (from line 43 introspections.py)
> the table_name auth_group
> and then from util line 47 the sql statement in which the table_name  should
> be inserted.
>
> But that doesn't happened. The executed sql statement contains still %s and
> not the table name.
>
> Any idea?

It's weird.

Can you modify the execute() method in
django/db/backends/mysql/base.py to verify the args argument actually
contains  your 'auth_user' table name?

Also, what's the origin of the python-MySQLdb driver you are using?
AFAIK there isn't a 1.2.3 version compatible with Python 3.x. See
https://docs.djangoproject.com/en/1.6/ref/databases/#python-3

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-RfkDO-feDNZoQNLYhyNSRvDk42zNfkja_9fgJ45y9EQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I nedd help - first Django app, part 2 - Admin - Adding related objects

2014-01-27 Thread Ramiro Morales
On Mon, Jan 27, 2014 at 7:54 AM, Rafał Szymański <r.szyman...@gmail.com> wrote:
> Hello everybody.
> I'm Rafał. I just started learnig and I'd like to ask You for little help.
> I'm in the part 2 of tutorial - admin, Adding related objects.
> I have no three slots for related Choices.
> Here is my code.
> [snip]
> class PollAdmin(admin.ModelAdmin):
> ...
> inline = [ChoiceInline]

The correct option name here is 'inlines':

     inlines = [ChoiceInline]

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-uyJAXa3mshH9nF5ptNkdCHUosD1PfK2GS%3Dtu8Eo9nuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Exception on start django server in windows 7

2014-01-20 Thread Ramiro Morales
On Mon, Jan 20, 2014 at 9:08 PM, Moisés Batista dos Santos Filho <
msneofi...@gmail.com> wrote:

> Hi, everyone. I need help!
> I was reading django's tutorial when the next step was start server. But
> when I put this instruction in command line, python manage.py runserver:
>
>
> <https://lh3.googleusercontent.com/-f4UxBCs4w6Q/Ut26KNbt3iI/ACM/woo9lQU5Id0/s1600/django-exception.jpg>
>
> I'm trying solve this error but no successful.
>

does by chance the host name of your Windows workstation have a non-ASCII
(e.g. an accented) character?

If so, as a temporary workaround, try changing it to a pure-ASCII one.

Also in the future pklease copy and paste the text of error messages like
this in the body of the email intead of attaching a screen capture. This is
better for getting the content indexted by search engines.

Also you might wat to widen the size of your terminal to to not get these
ugly line wraps.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-%2Bns-KhuZnVrN0%2BTmWMN-OWA0B-J4gXBvy%3D4dNoTkObw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Translation from templates doesn't work.

2013-11-24 Thread Ramiro Morales
On Sun, Nov 24, 2013 at 4:21 AM, Shahar Or <mightyiamprese...@gmail.com> wrote:
> String in my template don't translate. They stay English even though they do
> pop up in the po files using `makemessages`.

Do you comvert these -po files to .mo files using the compilemessages
Django command or the msgfmt GNU gettext utility?

Otherwise the translations wont be picked up.


-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_eh5Qr_d_KbgaoaC2YCuu-q1M-qcAvQUTeLO59opohvA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Startproject failing on Django 1.6

2013-11-13 Thread Ramiro Morales
On Wed, Nov 13, 2013 at 10:31 PM, Steve Sawyer <ssawye...@gmail.com> wrote:
> Thanks, Tom - however, I completely removed the Django 1.5 folders prior to
> installing Django 1.6, so unless there are Django components installed
> outside of those folders, I should be good.
>
> It seems that I might have something mis-configured. I have the http.cookies
> module and I've done everything I can think of to ensure that it can be
> found by Python, but so far I'm not having any luck. I think this is the
> issue, and it may not be specific to Django at all.

Do you by chance have both Python 2.x and 3.x installed side by side?

Because http.cookies got added (or rather moved to that path) in Python 3.

If so, make sure you install Django to and with your chosen Python. It
could be that you installed it in Python3 but e.g. the python.exe
interpreter binary one that has precedence in your PATH is the 2.x
one, etc.

Also, don't simply try to use::

  django-admin.py startproject blah

because on Windows the options to get interpreted languages scripts
like django-admin.py to be transparently executed through their
respective  interpreter just like if they were simple apps are (still)
unreliable and ugly.

It's better to be explicit and simply specify the full path to both
you python.exe and to django-admin.py, e.g.::

  c:\python3.x\python c:\the\full\path\to\django-admin.py startproject blah

This (using python explicitly) is something we tried to make more
clear in some recent changes to the Django docs but I'm seeing now we
missed it some places.

HTH

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF9OK7TNiSMwixptDOEJjNWR85ot6aYLJJUKAM24drbd9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: difference in datetime aggregation when using sqlite3 instead of mysql

2013-10-26 Thread Ramiro Morales
On Sat, Oct 26, 2013 at 3:47 PM, Wesley George <wesley.geo...@gmail.com> wrote:
>
> I'm working on a django application that uses the mysql backend in production 
> but the sqlite3 db backend during dev to speed up testing.
>
> I was surprised to find these backends differ when populating extra model 
> fields with aggregated datetimes. Specifically, if you use Queryset.extra to 
> create a field that is a maximum of some datetime objects, the sqlite django 
> backend makes this field a string, while the mysql backend makes this field a 
> datetime object. I've put a minimal django app at github (here) that 
> exemplifies this difference on my setup, Django 1.5.1, python 2.7.4, Ubuntu 
> 13.04.
>
> I know there are situations where these backends will behave differently, I 
> took the above aggregation operation to be basic enough that this shouldn't 
> be such a situation. The django docs on database backends note an old bug 
> concerning date aggregation with sqlite in windows, but I didn't think this 
> should apply.
>
> I'd love to hear from some other Django users. For example,
>
> Is this behaviour expected?
>
> (was I naive in subbing the sqlite backend in during development?)
>
> Is this a known bug?
> Is there a better way to use django's ORM to accomplish what I'm doing?
>
> (e.g. create a full-fledged DateTime field on the model, that must be kept up 
> to date when the other table is updated).

I'd recommend to use the same components in your development
enviroment as in the production one, and not only for issues like
this.

At the low level, sqlite3, has no datetime (and similar) data types,
all of them are stored as strings.

The Django sqlite DB backend makes use of some pysqlite-provided hooks
to convert information coming from the DB for columns corresponding to
model DateTimeField's, etc. fields This latter knowledge is the one
that allows it to keep track and perform the casting correctly.

But I suspect all bets are off  when one is using .extra() because in
that case the Python code would need to interpret the arbitrary. user
defined SQL query and deduct the type result(s).

But, if I change::

qset = qset.extra(select={'expiry_dt':'SELECT MAX(sub.end_dt) '\
  '  FROM
example_app_subscription AS sub '\
  '  WHERE sub.user_id=id'})

to use the ORM's native annotation capabilities::

qset = qset.annotate(expiry_dt=models.Max('subscription__end_dt'))

Then I get::

database engine: sqlite3
aggregated datatime type: 

Hopefully this is something you can actually use in your real project.

See 
https://docs.djangoproject.com/en/1.5/topics/db/aggregation/#following-relationships-backwards

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_dzLuk_kMZxQeKyy2U-KmFKPMW6MGsmSi0nDHeYfeYuw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
On Tue, Oct 22, 2013 at 8:26 PM, Ramiro Morales <cra...@gmail.com> wrote:
> On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales <cra...@gmail.com> wrote:
>>
>> Could you give us more information about how to reproduce this? i.e. what 
>> tests are you trying to run? etc.
>
> Never mind, I've reproduced it and opened ticket [1]12307.

This has been fixed in the 1.6.x branch and the fix will be included
in the soon to be tagged 1.6 rc.

Please test it and report back if you find any additional problems.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF-SRd0zPcmcHA086gzoPdbCos6FhrAGFzcxMJgjz%2Btgig%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales <cra...@gmail.com> wrote:
>
> Could you give us more information about how to reproduce this? i.e. what 
> tests are you trying to run? etc.

Never mind, I've reproduced it and opened ticket [1]12307.

-- 
Ramiro Morales
@ramiromorales

1. https://code.djangoproject.com/ticket/21307

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF8ms4sajxk1BkRkeOB%2BybLg-EWbbhduR%3Dg%3DChuNGCbxaw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
Matthieu,

On Tue, Oct 22, 2013 at 1:22 PM, Matthieu Rigal <matt.ri...@googlemail.com>
wrote:
> Hi all,
>
> I know that TransRealMixin already was a problem in the past and I thought
> it was "fixed"in the meaning that it was incorporated in the project.
> (https://github.com/django/django/pull/1147)
>
> I tried to run my actual tests (developed on 1.4.x) on the 1.6b4 and here
is
> what comes out when I use the following parameter
>
> TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
>
>
> Traceback (most recent call last):
>   File "manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py",
> line 397, in execute_from_command_line
> utility.execute()
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py",
> line 390, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py",
> line 50, in run_from_argv
> super(Command, self).run_from_argv(argv)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py",
> line 240, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py",
> line 71, in execute
> super(Command, self).execute(*args, **options)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py",
> line 283, in execute
> output = self.handle(*args, **options)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/management/commands/test.py",
> line 8, in handle
> super(Command, self).handle(*args, **kwargs)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py",
> line 88, in handle
> failures = test_runner.run_tests(test_labels)
>   File
> "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/runner.py",
> line 144, in run_tests
> suite = self.build_suite(test_labels, extra_tests)
>   File
> "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py",
> line 247, in build_suite
> suite.addTest(build_suite(app))
>   File
> "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py",
> line 149, in build_suite
> test_module = get_tests(app_module)
>   File
> "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py",
> line 101, in get_tests
> test_module = import_module('.'.join(prefix + [TEST_MODULE]))
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/utils/importlib.py",
> line 35, in import_module
>     __import__(name)
>   File
>
"/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/contrib/humanize/tests.py",
> line 22, in 
> from i18n import TransRealMixin
> ImportError: cannot import name TransRealMixin
>

Could you give us more information about how to reproduce this? i.e. what
tests are you trying to run? etc.

Thanks.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF_L4GeZwmYykk%2BK3vFTWDbv-BH4JjRNQuXFZdT2ZrK2yg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Extension to QuerySet.values()

2013-10-10 Thread Ramiro Morales
On Oct 10, 2013 10:02 AM, "Arnaud Delobelle"  wrote:
>
> Hi Russ,
>
> Thanks for the feedback.  I agree that this could possibly be integrated
into the values() method.  I just used a new method in order to minimise
interference with our existing code.  I'll read the 'contributing' document
then see if I can find a bit of spare time to do this properly!
>
FYI IIUC this has been reported in ticket 16735:

https://code.djangoproject.com/ticket/16735

>
> --
> Arnaud
>
>
> On Thursday, 10 October 2013 00:44:45 UTC+1, Russell Keith-Magee wrote:
>>
>> Hi Arnaud,
>>
>> I can see value in the feature you're describing here.
>>
>> From a design perspective, my question would be whether a whole new
method is needed, or whether it could be integrated into the existing
values() method. There will be some complications around the 'flat' key,
but its worth exploring the possibilities before we introduce a whole new
API entry point.
>>
>> If you're interested in taking this to the next level, we'll need tests
and documentation for the new feature. If you want to discuss finer details
of the API, the django-developers mailing list is a better forum. Our
contribution process is also documented; if you want to get involved in
contributing to the internals of Django, it's worth giving this document a
read [1].
>>
>> [1] https://docs.djangoproject.com/en/1.5/internals/contributing/
>>
>> Yours,
>> Russ Magee %-)
>>
>> On Wed, Oct 9, 2013 at 6:19 PM, Arnaud Delobelle 
wrote:
>>>
>>> Hi there,
>>>
>>> I quite often find that when using queryset.values() I would like to be
able to define myself the values of the keys, especially when they span
models:
>>>
>>> e.g.
>>>
>>>my_query_set.values('foo__bar__baz', 'quux',
'another__long__field__name')
>>>
>>> Then I end up with dictionaries with unnecessarily long keys.  What I'd
like to be able to do is something like:
>>>
>>> my_query_set.values('quux', baz='foo__bar__baz',
name='another__long__field__name')
>>>
>>> Executing this would yield dictionaries of the type:
>>>
>>> {'quux': 2, 'baz': 'type 2', 'name': 'Frobulon'}
>>>
>>>
>>> I've had a quick look at the ValuesQuerySet class and there seems to be
a simple enough way to get this feature.  I'm presenting it in the form of
a new ValuesQuerySet subclass and a monkey patch to the parent QuerySet.
 It's not unlikely that it will break some things as this is my first peek
into the QuerySet class.  I'd like to know if this is something that other
people feel the need for and if it is worth pushing for inclusion of such a
feature into django.
>>>
>>> Cheers,
>>>
>>> Arnaud
>>>
>>> 
>>>
>>> from django.db.models.query import QuerySet, ValuesQuerySet
>>>
>>>
>>> class ValuesDictQuerySet(ValuesQuerySet):
>>>
>>> def iterator(self):
>>> # Purge any extra columns that haven't been explicitly asked for
>>> extra_names = list(self.query.extra_select)
>>> field_map = self.field_map
>>> field_names = [field_map.get(fname, fname) for fname in
self.field_names]
>>> aggregate_names = list(self.query.aggregate_select)
>>>
>>> names = extra_names + field_names + aggregate_names
>>>
>>> for row in self.query.get_compiler(self.db).results_iter():
>>> yield dict(zip(names, row))
>>>
>>> def _clone(self, klass=None, setup=False, **kwargs):
>>> c = super(ValuesDictQuerySet, self)._clone(klass, **kwargs)
>>> c.field_map = self.field_map
>>> return c
>>>
>>>
>>> def QuerySet_values_dict(self, *field_list, **field_dict):
>>> fields = list(field_list)
>>> fields.extend(field_dict.values())
>>> field_map = dict(zip(field_dict.values(), field_dict.keys()))
>>> return self._clone(klass=ValuesDictQuerySet, setup=True,
_fields=fields, field_map=field_map)
>>>
>>>
>>> # Now we monkey-patch QuerySet with the new method
>>> QuerySet.values_dict = QuerySet_values_dict
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/d4f8d6f0-3723-44d5-991a-9c6b3c13165d%40googlegroups.com
.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
> --
> 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.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit

Re: Query parameters for receiving post

2013-10-08 Thread Ramiro Morales
On Tue, Oct 8, 2013 at 11:42 AM, Hélio Miranda <helio...@gmail.com> wrote:
>
> Hi
> Here I am having a problem which is as follows:
> I 'm getting parameters via post to make querys depending on paramtros I are 
> passed ... doing gender filters.
> So I'm doing well
> def filter(request):
> if request.method == 'POST':
> namepost = request.POST.get('name')
> surnamepost = request.POST.get('surname')
>
> if namepost != None and surnamepost != None:
> result = [a.get_json() for a in 
> Player.objects.filter((Q(name=namepost) & Q(surname=surnamepost)))]
>elif namepost != None and surnamepost == None:
> result = [a.get_json() for a in 
> Player.objects.filter(name=namepost)]
>
> data = {"meta": {"total_count":len(result)}, "objects": result}
> aa = json.dumps(data)
> return HttpResponse(aa, content_type='application/json')
>
> Is working properly , the problem is :
> If it were only these two parameters , there was no problem , was to complete 
> the rest of the hypotheses ... the problem is that I can have up to 10 
> parameters passed by post to the filters , and I never know which are passed 
> , can be 1 , 2, 4, ... as the user makes the filter ...
>
> But doing so would take a lot of ifs , it would have many chances ...
> is there any way I can do this another way ?
> Someone can help me ?

I can't thes this now but hopefully something similar to thois could
be of help: https://dpaste.de/FTnt

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO7PdF80K5SxRAKXVgi55JtjuRRcwNq58Df-DZXZrZeuJSBRdg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: So this needs to be fixed

2013-09-06 Thread Ramiro Morales
On Fri, Sep 6, 2013 at 1:29 PM, Robert Steckroth
<robertsteckr...@gmail.com> wrote:
> Also, the manytomany field selector highlight is waaay to light.
>
>
> On Fri, Sep 6, 2013 at 11:22 AM, Robert Steckroth
> <robertsteckr...@gmail.com> wrote:
>>
>> Why is the user permissions widget not re-sizing? I can hear it now...
>>
>> http://postimg.org/image/mcfbfhs83/

These are both great suggestions Robert.

Please if at all possible open a ticket in our issue tracker
(http://code.djangoproject.com)
reporting them, maybe linking this thread.

Bonus points if you have solutions to these issues and post a patch to
get things moving.

Thanks again.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [] error

2013-08-26 Thread Ramiro Morales
On Mon, Aug 26, 2013 at 11:17 AM, Patrick Larmann
<rails4product...@gmail.com> wrote:
> Hello guys I am following the django docs tutorial part 1 and am having
> trouble moving on. Instead of receiving [] i get   [ Poll object>]. I have tried converting the unicode to str but to no avail. I
> am just trying to move on. THx guys.

This is the third post in which you've posted screen shots of the errors
you get.

Please don't do that. Copy and paste the error text including the traceback
i.e. the content if the lower panel in you IDE.

In this particular case you've attached a file named 'python
models.py' but with contents
that seem to be a PNG file. And I can't open it (the image viewer
reports it is corrupt).

Also, make sur you report the versions of Django and Python you are using.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Ramiro Morales
On Wed, Aug 14, 2013 at 11:46 PM, Victor Hooi <victorh...@gmail.com> wrote:
> Hi,
>
> I have a Django model:
>
>> class iOSClient(models.Model):
>> ...
>> class meta:
>> ...
>> verbose_name = 'iOS client'
>> verbose_name_plural = 'iOS clients'
>
>
> However, when this model appears in the Django Admin, or in say, Django Rest
> Framework, the human-readable name seems to given as "I os client" or "i os
> client".
>
> Is there any way to easily suppress this behaviour?

These textual representations should be obeying what you specified with
the verbose_name* options.

Are you actually using "meta"? It should be Meta with a capital M.

Can you try that and tell us if that solves things for you?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Exception Value: Could not parse the remainder: '().order_by('-votes')' from 'poll.altword_set.all().order_by('-votes')'

2013-08-07 Thread Ramiro Morales
On Wed, Aug 7, 2013 at 6:59 PM, Pepsodent Cola <pepsodentc...@gmail.com> wrote:
> How come when I replace this:
> {% for choice2 in poll.altword_set.all %}
> to this:
> {% for choice2 in poll.altword_set.all().order_by('-votes')  %}
> then I get this error:
>
> Exception Type: TemplateSyntaxError
> Exception Value:
>
> Could not parse the remainder: '().order_by('-votes')' from
> 'poll.altword_set.all().order_by('-votes')'
>
>
>
> How do I write the correct syntax for ordering my list?

You can't. The template language only supports calling methods without
arguments, and in that case the () aren't needed.

Please read this section of the documentation fully for more details:

https://docs.djangoproject.com/en/1.5/topics/templates/#accessing-method-calls

You will need to implement the ordering with a method in another layer
and invoke it from the template layer.

Regards,

--
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: label_tag() escapes output twice

2013-07-19 Thread Ramiro Morales
On Fri, Jul 19, 2013 at 4:09 PM, sephii <sylvainterside...@gmail.com> wrote:
> Anyway it looks like a bug so I'll just report it.

Can you test things easily with the in-development 1.6 and trunk?

There have been a few changes to that code lately and the issue could have been
fixed. It's the kind of change that isn't backported to a stable
branch like 1.5.x

Thanks.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Project/App Folder Hierarchy Ambiguity

2013-07-12 Thread Ramiro Morales
On Fri, Jul 12, 2013 at 6:18 PM, Nkansah Rexford <seanmav...@gmail.com> wrote:
> My problem is the one in the question on the site. the Second answer is the
> solution.
>
> I'm using django 1.5.1
>
> My problem is the same as the one on the site

If you are copying your code from the question verbatim the problem
is in the mysite.urls.py file, it has this import::

from mysite.books import views

But there is no mysite.books Python module and that must be the cause
of the import error.

The parent mysite filesystem folder (the one with a manage.py file in it)
has nothing to do with this and isn't a Python module. It's simply
a container folder (you can rename to whe name you wish it if you can).

The books module is in the python module search
path so, to import a books app view you simply can use::

from books import views

The recommendation given in answer #2 to move the books app's Python
module under the mysite project python module is bogus because it takes
things back to where they were in Django <= 1.3.

All this is described in the documentation:

Introductory tutorial:

  https://docs.djangoproject.com/en/1.5/intro/tutorial01/#creating-a-project

Other places:

starproject command documentation:

  
https://docs.djangoproject.com/en/1.5/ref/django-admin/#startproject-projectname-destination

Django 1.4 release notes:

  
https://docs.djangoproject.com/en/1.5/releases/1.4/#updated-default-project-layout-and-manage-py

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Project/App Folder Hierarchy Ambiguity

2013-07-12 Thread Ramiro Morales
On Fri, Jul 12, 2013 at 5:38 PM, Nkansah Rexford <seanmav...@gmail.com> wrote:
> I'm new to Django, and for the past 2 days, I've been struggling with the
> ImportError thing until I came across this useful answer that solved my
> problem

I don't see an answer there. I see one questions and three answers.

It would be great if yopu actually describe your problem with the the scenario
(concrete, simplified project/app hierarchy), the error you get,
including the full
stack trace, and what are you trying to do when it happens, and what do you mean
with 'ambiguity'.

Oh and also the version of Django you are using.

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Translation: Why is there no pgettext_noop or npgettext_noop?

2013-07-09 Thread Ramiro Morales
On Tue, Jul 9, 2013 at 7:02 PM, Bob Barcklay <bbarck...@thuuz.com> wrote:
> I want to use contextual markers and plural forms in strings with deferred
> translation.  I'm curious why _noop versions of pggettext and npgettext
> don't appear anywhere.

What do _noop-suffixed version(s) of gettext function(s) have to do with
contextual markers, plural forms and deferred translation?

Are you confusing _noop with _lazy?

> My plan is to modify the xgettext invocation found
> in django/core/management/commands/makemessages.py to include new --keywords
> for pgettext_noop and npgettext_noop.  Is this the correct approach?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django1.5 - url resolver vs i18n_patterns : wrong behaviour

2013-07-05 Thread Ramiro Morales
On Thu, Jun 6, 2013 at 3:24 PM, Ivan Tatarchuk
<ivan.v.tatarc...@gmail.com> wrote:
> Not shure if I understand you correctly, but if I use static linking all
> works fine.
> Problem appears only with dynamic linking(like in admin templates).
> Is this a feature or a kind of bug?
> really want to use django's i18n_patterns in my project, but can’t
> understand how to escape from this case. ='(

Sorry for the delayed follow-up.

I've just tested he scenario you describe on trunk (1.7dev), 1.6beta1 and
1.5.1 and I couldn't reproduce the issue.

The admin app is always published at /admin/ and the URLs of the
'apps.other' app with an 'apps.other.urls' included urlconf plus views
are always prefixed by the language code
(e.g. /en/other/hello/ or /es-ar/other/hello/)

There seems to be something else at play in your setup that is causing
the problem.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: testing

2013-07-05 Thread Ramiro Morales
On Thu, Jul 4, 2013 at 8:42 PM, Larry Martell <larry.mart...@gmail.com> wrote:
>
> I'm just getting involved with setting up testing using the django
> testing facilities, and I have a couple of questions.
>
> If I do this from the django shell:
>
> $ python manage.py shell
> Python 2.7.2 (default, Oct 11 2012, 20:14:37)
> [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on
> darwin
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from django.test.utils import setup_test_environment
> >>> setup_test_environment()
> >>>
>
> Should I expect to see that the test db was created? Because I do not
> see it. (The docs say "This convenience method sets up the test
> database").

It seems you are using Django <= 1.4. the docs were wrong n these versions.
setup_test_environment() doesn't actually creates the test DB.

That section of the docs were [1]updated in >= 1.5 to point to the
.setup_databases() method the relevant TestRunner class which is
the one in charge of the DB creation.

> But then I read:
>
> create_test_db: Creates a new test database and runs syncdb against
> it. So then I thought maybe I have to call that. But I got:
>
> >>> create_test_db()
> Traceback (most recent call last):
>   File "", line 1, in 
> NameError: name 'create_test_db' is not defined
>

That create_test_db() is a low-level DB backend method that provides
the low-level support
to this functionality. Its easy to miss but thee is a

"The creation module of the database backend (connection.creation)
also provides some utilities that can be useful during testing."

paragraph above its description.

>
> Concerning fixture, I read in the docs where it says you can set up
> fixture files for initialing the test db. What will prevent those test
> fixtures from getting loaded when I do a syncdb of my 'real' database?

Documentation is clear in this case:

- The only DB fixtures leaded automatically on syncdb are the ones
named 'initial_data'
- You should explicitly specify the names of the DB fixtures you want
loaded for a given test case.

So there are two safety nets there. You need to break them explicitly
to get to that potentially disastrous scenario.

--
Ramiro Morales
@ramiromorales

1. 
https://docs.djangoproject.com/en/1.5/topics/testing/advanced/#running-tests-outside-the-test-runner

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django1.5 - url resolver vs i18n_patterns : wrong behaviour

2013-06-04 Thread Ramiro Morales
On Tue, Jun 4, 2013 at 6:23 AM, Ivan Tatarchuk
<ivan.v.tatarc...@gmail.com> wrote:

> from django.conf.urls import patterns, include, url
> from django.conf.urls.i18n import i18n_patterns
>
> urlpatterns = patterns('',
> url(r'^admin/', include(admin.site.urls)),
> )
>
> urlpatterns += i18n_patterns('',
> #   url(r'^other/', include('apps.other.urls')),
> }
>
> now {% url 'admin:password_change' %} resolved as 'admin/password_change'
> (normal behaviour)
> but if we uncomment line in i18n_patterns it will be resolved  as
> 'curr_lang/admin/password_change'
>
> Can somebody explaine my why?

Can you try to isolate reduce and isolate your environment to something similar
to a test case so we can find the reason of that behavior?

I've just added a test to our test suite exercising (correct behavior
in) a similar scenario:

https://github.com/django/django/blob/master/tests/i18n/patterns/urls/default.py#L9
https://github.com/django/django/blob/master/tests/i18n/patterns/urls/included.py
https://github.com/django/django/blob/master/tests/i18n/patterns/tests.py#L52

The only difference is that in your case you are including the admin dynamic,
namespaced url map so laying with some variation there would be a good way to
get further.

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: makemessages failing with non ascii characters in templates

2013-03-26 Thread Ramiro Morales
On Tue, Mar 26, 2013 at 9:23 AM, Bastian <bastien.roche...@gmail.com> wrote:
> If I understand well, your fix is used to allow non ascii characters in the
> comments of a template. I found non ascii characters outside comments too,
> won't this break also?

Unfortunately we don't have information about which template file is the one
triggering the issue.

it would be great if you could isolate it and create a simple test case.

Non ASCII characters in non-comment template content should be handled
transparently.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: makemessages failing with non ascii characters in templates

2013-03-26 Thread Ramiro Morales
On Tue, Mar 26, 2013 at 8:04 AM, Bastian <bastien.roche...@gmail.com> wrote:
> Hi, I am trying to create a .po file to start a translation. I use the
> command './manage.py makemessages -l ru' to try to create the Russian
> locale. The script seems to be working for a while and then crashes with:
>
> processing language ru
> Traceback (most recent call last):
>   File "./manage.py", line 15, in 
> execute_manager(settings)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 438, in execute_manager
> utility.execute()
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 379, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/base.py",
> line 191, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/base.py",
> line 220, in execute
> output = self.handle(*args, **options)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/base.py",
> line 351, in handle
> return self.handle_noargs(**options)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/commands/makemessages.py",
> line 365, in handle_noargs
> make_messages(locale, domain, verbosity, process_all, extensions,
> symlinks, ignore_patterns, no_wrap, no_obsolete)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/core/management/commands/makemessages.py",
> line 233, in make_messages
> f.write(templatize(src, orig_file[2:]))
>   File
> "/home/env/project/lib/python2.7/site-packages/django/utils/translation/__init__.py",
> line 127, in templatize
> return _trans.templatize(src, origin)
>   File
> "/home/env/project/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
> line 450, in templatize
> content = u''.join(comment)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7:
> ordinal not in range(128)

Upgrade your copy of Django 1.3.x to a supported version (1.3 isn't
for this kind
of fixes) or apply this fix manually:

https://github.com/django/django/commit/0defa7dc9dc97a11baea3b91158fbc7c57e5c3a6

Django versions 1.4 or newer already include it.

As a general rule, if you find a problem with an ancient version it's
better to test
with a newer version because chanes are it has been fixed.

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django makemessages is marking translated strings as fuzzy

2013-02-12 Thread Ramiro Morales
On Tue, Feb 12, 2013 at 10:08 AM, Mohammad Abbas
<mohammad.abba...@gmail.com> wrote:
> I am having issues with the Django makemessages management command. It seems
> like it is randomly marking messages as fuzzy even though they have already
> been translated. For example
>
> #: templates/profile/edit.html:21
> msgid "Save Changes"
> msgstr "Save Changes DE"
>
> Would become...
>
> #: templates/profile/edit.html:21
> #, fuzzy,
> msgid "Save Changes"
> msgstr "Save Changes DE"
>
> The behaviour is very intermittent and hard to recreate, so debugging hasn't
> been straightforward.
>
> Does anyone have any ideas?

OOps, that'svery strange and awkward. Tools shoudn't be automatically
changing content nor properties of translations written by a human translator.

Unfortunately I have no idea what could be happening.

Please tell us which version of Django, GNU gettext tools and OS you are using.
and keep us posted about if/how you manage to reproduce this.

Have you been able to identify if it happens with literals extracted from
(only, any, all of) Python files?, JS files?, template files?

One hypothesis: Is it possible "Save Changes" also appears as the
singular literal of a singular/plural construct (ungettext() calls or
{% blocktrans %}...{% plural %}...{% endblocktrans %} tags)?

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-admin.py and manage.py both fail in dev

2013-02-10 Thread Ramiro Morales
On Sun, Feb 10, 2013 at 3:22 AM, David Flory <david.c.fl...@gmail.com> wrote:
> When I run either django-admin.py or manage.py all I get is the help screen
> for the command regardless of the parameters I give.
>
> For example:
> django-admin.py startproject mysite
> returns the help screen.  It does not create mysite/.
>
> I am working with Python33 and the Dev version of Django refreshed with git.
>
> Clearly django-admin is on the python path since it is executed.
>
> import django
> print(django.get_version())

What that shows is that Django is in the Python search path.

It doesn't mean django-admin.py is on the OS PATH.

What you need to do is execute django-admin.py through your
Python interpreter like any Python script:

C:\Users\Me\work> C:\python27\python path\to\django-admin.py startproject mysite

(Replace C:\python27\ with the path to your python.exe. Or if you have
already added such dor to your OS PATH then you can simply use
>python django-admin.py startproject mysite)

Don't rely on any brittle faking of the .py file extension as a native
so it behaves like a native executable or .bat file. IMHO all of them
are broken in some way or another under Windows. Hopefully the PEP 397
'py' launcher included with Python >= 3.3 will solve this for good.

Write it explicitly Instead like shown above. That's something that
works on every platform for every interpreted programming language.

Same advice goes to executing the manage.py script you will get
afterward. e.g.:

mysite> C:\python27\python manage.py startapp my1stapp

Regards,

-- 
Ramiro Morales
@ramiromorales

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Polls tutorial receive object not object representation

2013-02-01 Thread Ramiro Morales
On Jan 27, 2013 10:58 PM, "Sayth Renshaw"  wrote:
>
> Now the only thing is that when I call p.choice_set.all() I don't get the
representation 'The sky' or 'Just Hacking again' . I receive choice object
itself. Is this normal?

That happens because you seem to hsve missed or decided to skip the
instructions located right above the interactive section you are at:

The one about adding __unicode__ methods to the models and saving the
models.py file.

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?

2013-01-29 Thread Ramiro Morales
Ramiro Morales
On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari" <isac.new...@gmail.com>
wrote:
>
> thanks for the link!
>
> So Isn't there a way to set DEBUG=True in tests?

No. There isn't (at least with the built-in testing toolbox).

Now, I'm trying to understand why do you rely in the debugging 500 response
contents on your tests. Do you screen scrap it to extract  information
about the origin of the failure?

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?

2013-01-29 Thread Ramiro Morales
On Jan 29, 2013 9:57 AM, "Alessandro Pelliciari" 
wrote:
>
> Hi, I'm writing some tests with Selenium.
>
> When i run my selenium tests (LiveServerTestCase type) and i have some
error in my code (not in the test, i mean in the code executed, like the
homepage view i reach with selenium) i get the 500 public template (that
usually i get when i have DEBUG = False) even if i have:
>
> DEBUG = True
> INTERNAL_IPS = ('127.0.0.1',)
>
> I'm stuck with that and i can't see why my test failed (because in the
public 500 ofc i don't show the exceptions).
>
> When i run the runserver it works perfectly (i get the tracebacks).
>
> I've checked the ip from request.META when i run it in a selenium test
and it's the localhost, not other network IP.
>
> Why does it behave like that? Where can i look to resolve?

See
https://docs.djangoproject.com/en/1.4/topics/testing/#other-test-conditions

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Missing files on a new project

2013-01-29 Thread Ramiro Morales
Ramiro Morales
On Jan 28, 2013 11:03 PM, "Ricardo Diaz" <ricardotk...@gmail.com> wrote:
>
> Well, i'm following a video tutorial -> this guy is using Django 1.4 and
when he uses startmanager on shell Django creates all of those files on the
main folder.
>
> Check it about 3:11 https://www.youtube.com/watch?v=fVNL5MwskiQ

That video tutorial is wrong. I suggest to simply ignore material from that
source.

I suspect he is doing something that is explicitly warned against in the
first paragraphs of the official tutorial: Installing a version of Django
without uninstalling an older one (1.3.x?) before.
The directories layout set up by startproject changed to what you see in
1.4.

-- 
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.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Python shell doesn't launch

2012-12-26 Thread Ramiro Morales
On Dec 26, 2012 7:46 PM,  wrote:
>
> You know what? I didn't "expect" anything because I HAVEN'T DONE THIS 
> BEFORE That is why I am doing an introductory tutorial. Thanks, Ramiro - 
> highly intelligent answer. Ryan - you are a professional.

Wait. Why do you assume I was trying  to troll you?. I'm not a native
english speaker and my question was honest and to the point, even if
terse.

But now you've made me think:

One of the basic things repeated many many times in our field (I think
it must have been so in the last decade) when it come to ask smart and
effective question is to state not only what are the results you get but
also what did you expect. How do you think we will be able to help you
if you don't tell us what were your expectations?

In the end, this might come to this sentence in part one of the official
tutorial (that I assume is the one you are following) when talking about
running manage.py shell:

"Now, let's hop into the interactive Python shell and play around with
the free API Django gives you. To invoke the Python shell, use this
command:

python manage.py shell
"

( https://docs.djangoproject.com/en/1.4/intro/tutorial01/#playing-with-the-api )

Personally I think people should not learn Python and Django at the same
time. In this way, having some Python familiarity will mean at this
point the reader will know at what the 'interactive Python shell' is.
Because it's beautifully explained in the most basic official Python
tutorial:

http://docs.python.org/2/tutorial/interpreter.html#interactive-mode

(it even has an example output very similar to the seemingly confusing
output you pasted in your first post).

This is the second thread in which my impression is that you'd be less
frustrated if you took the time to make yourself comfortable with the
basic Python concepts first.

Regards,

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Stuck

2012-12-26 Thread Ramiro Morales
On Dec 26, 2012 5:56 PM,  wrote:
>
> This is strange - the original code is indented correctly; however, the
copy/paste shows incorrect indentation.

This could happen if you mix spaces andás tabs. Read some introductory
Python material to know more why this is a bad idea and a basic mistake.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python shell doesn't launch

2012-12-26 Thread Ramiro Morales
On Dec 26, 2012 7:05 PM,  wrote:
>
> Whenever I run "python manage.py shell," I don't get any errors, but  I
get the following:
>
> C:\Python27\Lib\site-packages\django\bin\mysite>python manage.py shell
> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
>
> Any ideas on what am I doing or have done wrong?

That's what is supposed to happen. What did you expect?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django.db.utils.DatabaseError: (1046, 'No database selected')

2012-12-23 Thread Ramiro Morales
On Sun, Dec 23, 2012 at 12:59 PM, Ramiro Morales <cra...@gmail.com> wrote:
> On Sun, Dec 23, 2012 at 6:45 AM, Praveenkumar Venkatesan
> <praveev...@gmail.com> wrote:
>> Hey All,
>>
>> I was walking through the tutorial part 1 on polls. When i executed "python
>> manage.py sql polls" i got this stack trace
>>
>> Traceback (most recent call last):
>>  [...]
>> django.db.utils.DatabaseError: (1046, 'No database selected')
>>
>> I've been googling and everyone says that i don't have access to the mysql
>> database for "polls" but i was able to access the database when i entered
>> mysql -u root -h localhost polls
>>
>> This is how my settings.py looks like for database:
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
>> 'mysql', 'sqlite3' or 'oracle'.
>> 'NAME': '',  # Or path to database file if using 
>> sqlite3.
>
> It sems you have correctly created a MySQL database, you've given it
> the name 'test' and you've verified it exist adn can be used. Good.
>
> You've also provided Django presumably the right server name (localhost)
> and credentials (root/empty) so it can access such database. Great.
>
> But there is a crucial link missing. You haven't told Django you want it to 
> use
> that database fotr this project/application.
>
> That's what the NAME setting above is for. Use it.

Forgot to say that this is clearly derscribed in the relevant tutorial section:

https://docs.djangoproject.com/en/1.4/intro/tutorial01/#database-setup

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django.db.utils.DatabaseError: (1046, 'No database selected')

2012-12-23 Thread Ramiro Morales
On Sun, Dec 23, 2012 at 6:45 AM, Praveenkumar Venkatesan
<praveev...@gmail.com> wrote:
> Hey All,
>
> I was walking through the tutorial part 1 on polls. When i executed "python
> manage.py sql polls" i got this stack trace
>
> Traceback (most recent call last):
>  [...]
> django.db.utils.DatabaseError: (1046, 'No database selected')
>
> I've been googling and everyone says that i don't have access to the mysql
> database for "polls" but i was able to access the database when i entered
> mysql -u root -h localhost polls
>
> This is how my settings.py looks like for database:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': '',  # Or path to database file if using 
> sqlite3.

It sems you have correctly created a MySQL database, you've given it
the name 'test' and you've verified it exist adn can be used. Good.

You've also provided Django presumably the right server name (localhost)
and credentials (root/empty) so it can access such database. Great.

But there is a crucial link missing. You haven't told Django you want it to use
that database fotr this project/application.

That's what the NAME setting above is for. Use it.

The eror message isn't as clear as one would wish, I think it's generated by
the MySQL low level driver. But it points in the right direction about which
is the issue.

Good luck,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-18 Thread Ramiro Morales
On Tue, Dec 18, 2012 at 10:12 AM, Thomas Orozco <tho...@orozco.fr> wrote:
> What version of django are you using?
>
> admin.site.urls was introducd four years ago
> (https://github.com/django/django/commit/1f84630c87f8032b0167e6db41acaf50ab710879),
> but maybe you're running an older version?

On Fri, Dec 14, 2012 at 11:06 PM, 向浩 <ambih...@gmail.com> wrote:
> Environment:
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/admin/
> Django Version: 1.0.4
> Python Version: 2.7.3

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Ramiro Morales
On Dec 15, 2012 11:30 AM, "Phil"  wrote:
>
> Hi,
>
> I had django setup and working for over a year now working with it on and
off. I was away for a month, came back and now whenever I run
"django-admin.py runserver 8080" I get the following error...
>
> ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
>
> I can import django from command line(version 1.4.3), I ran
"django-admin.py startproject test" to try a new project. It has
"os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared
in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so
how is my DJANGO_SETTINGS_MODULE undefined?

Hace you by chance actually upgraded Django todo 1.4.x from aún older
versión? Are you using Mac OS X?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-08 Thread Ramiro Morales
On Fri, Dec 7, 2012 at 6:21 PM, easypie <program...@gmail.com> wrote:
> Here's my wsgi.py file located in my project: http://dpaste.org/dBRqQ/
>

Sorry I miesread the traceback. In,oine 4 of wsgi.py you import settings
and the one reporting the about about /etc/apache2/https is settings.py

Is it possible that you somehow are importing/including/referencing
/etc/apache2/https from settings.py?

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-08 Thread Ramiro Morales
On Fri, Dec 7, 2012 at 6:16 PM, easypie <program...@gmail.com> wrote:
> Here's my apache log. I know this is outside of django but this might help
> find the cause: http://dpaste.org/V9ONE/  thanks for the helps.

>From the traceback you attached to the first message I'd say you need
to review or post the /home/easyi/.virtualenvs/tomw/project/tomw/wsgi.py
file.

According to the traceback it has in line 4 a reference to a
/etc/apache2/https or /etc/apache2/https: file that doesn't exist.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.5 b1 django-admin.py error

2012-11-28 Thread Ramiro Morales
On Wed, Nov 28, 2012 at 3:43 AM, Sultan Imanhodjaev
<sultan.imanhodj...@gmail.com> wrote:
> Hello,
>
> I just downloaded and type django-admin.py to start a new project and having
> errors
>
>> (devel)ninja devel: django-admin.py startproject hello
>> Traceback (most recent call last):
>>  [..]
> But when I just type django-admin.py I have error
>
>> (devel)ninja devel: django-admin.py
>> Usage: django-admin.py subcommand [options] [args]
>> Options:
>> [...]
>
> Why Django cause this error since I simply use django-admin.py?

I've just tried to reproduce this based on ther rather sparse description you've
given us and I don't seee these problems.

Please expand the decription of your setup, particularly the "I just downloaded"
part. I see you are using a virtualenv.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Documentation Bug report

2012-10-28 Thread Ramiro Morales
On Sun, Oct 28, 2012 at 4:34 PM, Lachlan Musicman <data...@gmail.com> wrote:
>
> The funniest/worst part is the title:
>
> Django v1.3.2 documentation
>
> :)
>
> I believe this should read DEV or at least 1.5

I suspect it's because of a change I introduced a few hours ago.
I will fix it now and hopefully it will be reflexted in the downloadable
content soon.

This is in the master branch (nascent 1.6). The 1.5 stabilization
branch shoudn't
be affected.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with URL configuration - cannot use absolute URLs in my case

2012-10-08 Thread Ramiro Morales
On Sat, Oct 6, 2012 at 10:25 PM, Rohit Banga <iamrohitba...@gmail.com> wrote:
>
> So how do I code my url conf / view / template in order to be independent of
> mywebsite name.
> Is there anything wrong with the way I am wiring up my application.

Take a look at the docs for:

URL reversing: 
https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse-resolution-of-urls

Naming URLs: 
https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns

These links point to the in-development version of the docs. This is because
there has been a refactor lately to make presentation of these concepts more
clear and because there hasn't been significant changes in this functionality
since Django 1.4.

HTH

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Missing manage.py

2012-10-04 Thread Ramiro Morales
I think so. The usual reason for the problem you are experiencing is a
previous installation of Django on top of which the one you are trying
to use was installed without unintalling the older one first *.

So, the recommended action in such cases is to ensure you start with a
clean slate buy removing any and all traces of the old files causing
trouble.

2012/10/4, Django_Newbie <anuj...@gmail.com>:
> Hi..
> I am using Django 1.4.1 on Windows 7 and face similar problem. I dont see
> manage.py
>
> All I have is:
> __init__.py
> settings.py
> urls.py
> wsgi.py
>
>
> Is reinstalling Django only option?
>
>
> On Monday, 16 April 2012 16:56:32 UTC+5:30, Faeez wrote:
>>
>> Hi,
>>
>> I have a problem whenever I create a new project using the start project
>> command, no manage.py file is created.
>>
>> I'm using Mac OS X. Thank you in advance
>>
>
> --
> 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/-/_GE2ct9_qi0J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Enviado desde mi dispositivo móvil

Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Ramiro Morales
On Fri, Sep 7, 2012 at 9:21 PM, William Hart <hart...@gmail.com> wrote:
> Hi,
> Yes as per my first and second replies and the SO link I have done it with
> and without quotes.
>
> To be clear - this is not a 'fix my code' question as I had already found
> the workaround before posting, the question is more whether it is expected
> behaviour for the {% url %} tag to act differently in and out of a
> virtualenv...

Well you could start bu telling us which version(s) of Django are you using
and if you've verified they are actually the same.

You've posted five time on StackOverflow and four times on this thread
and haven't provided that rather basic piece of information.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How well does South work in a team?

2012-08-16 Thread Ramiro Morales
On Thu, Aug 16, 2012 at 12:44 AM, Benjamin Lei <benlei1...@gmail.com> wrote:
> I'm just wondering since it seems the migrations created are all prepended
> with an incremental number... so if two developers were to push two
> different migrations, each with the same id, I'm afraid something bad will
> happen.
>
> For example:
> Dev A: creates 001_somedesc
> Dev B: creates 001_someotherdesc
> Dev A: commits 001_somedesc into repo
> Dev B: commits 001_someotherdesc into repo
>
> Is it better to just use the default django "syncdb"?

Have you read South documentation?.

Because part 5 of the tutorial has an entire section devoted precisely
to this topic:

http://south.readthedocs.org/en/latest/tutorial/part5.html#team-workflow

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-admin.py startproject mysite... this command does nothing for me

2012-07-23 Thread Ramiro Morales
On Mon, Jul 23, 2012 at 4:58 PM, boxxtcy <wjh...@gmail.com> wrote:
> I tried without the .py, still doesn't do anything.  django-admin.py lives
> in my C:\Python27\Scripts  just as it is supposed to.  I don't really see
> what the issue is :/

Don't rely on the association of .py files with the Python interpeter
and executability of .py files features provided by the OS.

Simply specify the full path to the django-admin.py script
(and if needed, the full path to the Python interpeter).

As in:

python C:\Python27\Scripts\django-admin.py startproject foo

or

C:\Python27\python C:\Python27\Scripts\django-admin.py startproject foo

The basic concepts will always work. The above techniques will allow
you to execute script in any interpreted language on any platform.

HTH

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: m2m through intermediate model: template friendly syntax not working. dj1.3

2012-07-16 Thread Ramiro Morales
On Mon, Jul 16, 2012 at 4:10 PM, brycenesbitt
<digitalbitstr...@gmail.com> wrote:
> I'm still stuck on this.  Is there any tutorial example that shows access
> m2m intermediate model data from a template.  The issue is the template
> library won't accept parameters.  Do I have to write a custom tag to get the
> m2m intermediate data fields?

The problem you've found isn't related to access to the relationship model
from template but that you aren't using the right names to access them.

Reading
https://docs.djangoproject.com/en/1.4/ref/models/fields/#manytomanyfield
and
https://docs.djangoproject.com/en/1.4/topics/db/models/#intermediary-manytomany
will be of great help.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing psycopg2 for PostGreSQL as django backend using virtualenv

2012-07-14 Thread Ramiro Morales
On Sat, Jul 14, 2012 at 10:56 PM, Doug S <webcoach...@gmail.com> wrote:
> Hello django people,
> I'm just installing my PostgreSQL backend for my django projects that I
> install in isolated virtualenv's
> I've followed what seem like easy installation instructions here:
> http://initd.org/psycopg/install/
> I have installed python-dev,   libpq-dev and also postgresql-server-dev-9.1
> I workon my virtualenv and use its pip installation to install psycopg2:
> (env) $ sudo pip install psycopg2
> It appears to install successfully:
> Successfully installed psycopg2
> but when I use yolk to list my virtualenv packages or look in my
> site-packages for my virtualenv or try to import psycopg2 I find that it is
> not installed in the virtualenv like I thought it would be.
> I found I do have a psycopg2 installed in my system wide python installation
> and I'm not sure if my attempt to install it locally actually installed it
> globally or if the global installation was there to begin with from some set
> up installation I did using someone else's code ( that I don't pretend to
> understand )
>
> Two questions:
> 1) why didn't it install like I expected?
> 2) do I want psycopg2 insalled in my local virtualenv's python installation
> for django? or should it be in my global python installation?

Maybe it is related to he fact you used sudo when running pip intall?

Why are you doing that? After all, one of the advantages of using
a virtualenv is that you don't need o be a system admin
because you don`t want to/can't touch the globali system-wide
installation.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Time zone support enabled in Django 1.4, yet "Django does not support timezone-aware times"

2012-05-22 Thread Ramiro Morales
On Mon, May 21, 2012 at 9:57 PM, Arthur <kaend...@mtu.edu> wrote:
> Hello,
>
> I recently upgraded one of my machines to Django 1.4 to patch a bug related
> to the use of PostGIS 9.1. I read the documentation on the new support for
> time zones and added USE_TZ=True to my settings.py file. Nonetheless, when I
> attempt to load data into my PostGIS database in one of the following ways,
> I receive a ValueError: Django does not support timezone-aware times.

If what you did in that machine is upgrade to Django 1.4 from an older version
then you might be victim of a problem because of whcih the files form the
previous installation aren't overwritten and you end with a broken mix of
things.

The documentation has recently been [1]amended with instructions on how
to avoid this. Please use the [2]updated section in the relevant document.

HTH

-- 
Ramiro Morales

1. 
https://github.com/django/django/commit/6ed7d40727f70934df6ab0ac96f5f1c4f01c534f
2. 
https://docs.djangoproject.com/en/dev/topics/install/#remove-any-old-versions-of-django

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 1.4 on git

2012-05-06 Thread Ramiro Morales
You will need to read the Git documentation because we are in Git territory now.

)ou got the latest development code by default but remember that when
you clone you get (most of) the development history and it is
available locally.

You need to get a checkout of the commit pointed to by the '1.4' tag.
IIRC you can achieve that with::

  git checkout 1.4

On 5/6/12, Larry Martell <larry.mart...@gmail.com> wrote:
> On Sat, May 5, 2012 at 7:06 PM, Ramiro Morales <cra...@gmail.com> wrote:
>> On Sat, May 5, 2012 at 8:42 PM, Larry Martell <larry.mart...@gmail.com>
>> wrote:
>>> Last month I set up a system and when I cloned django from git I got
>>> version 1.4. Now I an setting up another system, and when I clone
>>> django from git I get 1.5, and my app is failing. How I can get 1.4? I
>>> see a django-nonrel / django-1.4 but it says "Work in progress 1.4
>>> port, DON'T USE"
>>
>> The github.com/django/django repository is now the official Django
>> development repository, we migrated from SVN a week ago.
>>
>> Problem is that we've only migrated the development mainline. We are
>> working to also migrate the release tags (1.4, 1.3, ...) and the
>> post-release maintenance branches. The plan is to have it ready in a
>> couple of days.
>>
>> The repository that previously was at github.com/django/django is called
>> now github.com/django/django-old and it has the 1.4 tag. You can clone
>> from it if you can't wait.
>
> i cloned from django-old, and I get 1.5 alpha (which does not work for me):
>
>>>> django.VERSION
> (1, 5, 0, 'alpha', 0)
>
> My working system has:
>
>>>> django.VERSION
> (1, 4, 0, 'final', 0)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Main app name with a startproject template (1.4)

2012-05-06 Thread Ramiro Morales
On Sat, May 5, 2012 at 4:27 AM, Dominique Guardiola Falco
<dom.guardi...@gmail.com> wrote:
> I have a template project I want to use to ease deployment of instances of a
> rather complex app
>
> In the example source of django, the name of the "main app" folder, just
> above the root project folder is named "project_name" and when the command
> is used, the name is replaced by the project name.

It is very hard to understand what you are trying to. Please try to refomulate
your question more clearly. Try to don't use ad-hoc names like "main app"
because it confuses things even further. A good idea would be to use the
same terms used in the documentation of the startproject command.

And please keep this topic on this list that's where it belongs.

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 1.4 on git

2012-05-05 Thread Ramiro Morales
On Sat, May 5, 2012 at 8:42 PM, Larry Martell <larry.mart...@gmail.com> wrote:
> Last month I set up a system and when I cloned django from git I got
> version 1.4. Now I an setting up another system, and when I clone
> django from git I get 1.5, and my app is failing. How I can get 1.4? I
> see a django-nonrel / django-1.4 but it says "Work in progress 1.4
> port, DON'T USE"

The github.com/django/django repository is now the official Django
development repository, we migrated from SVN a week ago.

Problem is that we've only migrated the development mainline. We are
working to also migrate the release tags (1.4, 1.3, ...) and the
post-release maintenance branches. The plan is to have it ready in a
couple of days.

The repository that previously was at github.com/django/django is called
now github.com/django/django-old and it has the 1.4 tag. You can clone
from it if you can't wait.

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Why does django use mysqldb over mysql-connector?

2012-05-04 Thread Ramiro Morales
On Thu, May 3, 2012 at 10:18 PM, john2095 <john...@gmail.com> wrote:
> I've just been through a slice of hell simply because I did not want to
> install mysql-server on my (osx) django development machine - my app
> connects to a remote mysql database.  It turns out that python's "mysqldb"
> depends on mysql binaries which are only packaged up with the server
> release.  This means that if you want to run django and connect to a remote
> mysql you still need to install mysqlserver locally.  I think that
> blows. Especially when there is a purely python mysql driver in
> "mysql-connector".
>
> Has this happened by default or by design?  Is mysqldb really that much
> faster, or featureful, or just because it's more common?

IMHO who you really need to ask and whine to is with the providers of the
packaging of mysqldb and MySQL in your platform. It is really nasty that in
2012 you need to install the binaries of a database server to be able
to install the client-side drivers of a programming language. This is a
problem solved decades ago.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: i18n - local translation does not show up - bug

2012-05-03 Thread Ramiro Morales
On Thu, May 3, 2012 at 9:17 AM, kenneth gonsalves
<law...@thenilgiris.com> wrote:
>
> I had gone through the docs and added the LOCALE_PATHS setting - but it
> just does not work - have tried on fedora, debian, ubuntu ...

Good to know that, I couldn't infer that from your initial email.

It'd be strange, but certainly possible, it is broken. We have
a test case checking that such feature works:

https://github.com/django/django/blob/master/tests/regressiontests/views/tests/i18n.py#L140

Could you reduce your failing case to the simplest form
and share it so we can do more research?.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: i18n - local translation does not show up - bug

2012-05-02 Thread Ramiro Morales
On Wed, May 2, 2012 at 4:13 AM, kenneth gonsalves
<law...@thenilgiris.com> wrote:
> hi,
>
> I want two languages in my project - en and ta. I have set this up in
> many projects over the years and this is the first time I am seeing
> failure. The problem is that on switching to tamil, the django strings
> are getting translated, but not the local strings. Django is obviously
> not finding my local .mo file. Makemessages and compilemessages work
> fine. My locale directory is at the same level as manage.py. Even if I
> put it at the same level as settings.py, it still does not work.
>
> django version - latest trunk
>
> later: on checking, this works upto revision 17860 and breaks from 17861

Well if you are using the development version it is assumed you are closely
following the development activity (so this kind of changes don't take you by
surprise) and/or can read the Fine Manual where the decprecation
and the steps you need to take are (and have been since Django 1.3 Apr 2011)
documented.

Two hints: The Django 1.3 release notes and the LOCALE_PATHS setting.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Automatic indexes on foreign keys

2012-04-21 Thread Ramiro Morales
On Sun, Mar 25, 2012 at 9:30 AM, Aryeh Leib Taurog <v...@aryehleib.com> wrote:
>
> On Mar 23, 3:56 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> > On Fri, Mar 23, 2012 at 4:37 AM, Aryeh Leib Taurog <v...@aryehleib.com>
> > wrote:
> >
> > > My understanding is that one usually
> > > wants an index on the *referenced* field, not the *referencing*
> > > field.
> >
> > it's for the back-reference link.  so that you can do
> > group.item_set.all() and get all the items that share a group.
>
> Ah, okay.  Yes, this would definitely improve performance of that
> query.  But why the second index (varchar_pattern_ops in postgresql)?

See this ticket

https://code.djangoproject.com/ticket/12234

and the commit that fixed it:

https://code.djangoproject.com/changeset/11912

--
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: High Traffic

2012-04-16 Thread Ramiro Morales
On Mon, Apr 16, 2012 at 5:22 PM, Yarden Sachs <yrd...@gmail.com> wrote:
> i have 9000 rows. and using mod_wsgi on apache2. what am i doing wrong? i
> tried to switch to nginx+fcgi. and tried ubuntu srrver as well. same
> results.
>
> any ideas?

Do you have DEBUG=False in your settings?

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Book

2012-04-12 Thread Ramiro Morales
On Thu, Apr 12, 2012 at 5:51 AM, Timothy Makobu
<makobu.mwambir...@gmail.com> wrote:
> Mmmm, any dev willing to tell us the final word on this?

There is no relationship between the Django project and the
Django book apart from the fact that the tw authors are
so I don't think you will get any official word about book
updates here.

Fortunately there is at least one book from a community member
(Reinout van Rees) in the works:

http://reinout.vanrees.org/weblog/tags/book.html

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bump to Django 1.4rc1 causes near doubling of test run time

2012-03-10 Thread Ramiro Morales
On Sat, Mar 10, 2012 at 4:16 PM, Philip Kimmey <phi...@rover.com> wrote:
> Hi folks,
>
> I bumped Django from 1.4 alpha to 1.4rc1 and all of a sudden my unit
> test runs went from ~16mins to ~29mins. The 16 minutes was extremely
> stable before (many hundreds of runs in Jenkins) and the 29 mins is
> very consistent now (about 10 runs.)
>
> Any ideas what might have changed between Django 1.4 alpha as of a
> couple months ago to 1.4rc1 that would cause such a dramatic increase
> in test times?

Tell us more about your testing enviroment and your tests. Do you use the
DB? To which degree? If yes, what database? MySQL, sqlite, etc.
If MySQL, which storage engine?, etc.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Implementing Foreign Key without admin interface

2012-03-08 Thread Ramiro Morales
On Thu, Mar 8, 2012 at 4:44 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote:
>                        job_no_id = client.job_no
>                        ...
> Am I wrong somewhere?  How should I do this?  Please help!!

Yes, that client variable appears magically. Please paste working code,
an abridged version but working code.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.4b1; syncdb parameters

2012-02-28 Thread Ramiro Morales
On Tue, Feb 28, 2012 at 10:44 AM, KACAH <kacah...@gmail.com> wrote:
> Hi django users,
>
> In Django 1.4b1, syncdb.Command().execute() has required parameters
> "verbosity" and "database". In 1.4a version they had default values
> (verbosity=1, database="default"). Is this a bug or feature?

I suspect the reason is a cleanup performed during the 1.4 development cycle
in handling of options passed to management commands that focused in the
options passed via the command line.

You are seeing this because presumably you are using the command y calling it
from Python code. A valid use case. Perhaps an addition to the release notes
would be helpful.

Now, the mentioned cleanup was performed well before the 1.4 alpha (Dec 27
2011): 1 Oct 23 2011 so I don't understand how you are seeing the change in
behavior between alpha1 and beta1.


-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: default folder structure in 1.4 beta

2012-02-24 Thread Ramiro Morales
On Fri, Feb 24, 2012 at 1:24 PM, Dominic Montreuil
<dominic.montre...@gmail.com> wrote:
> Using the 1.4 beta on my workstation to perform a startproject yields
> a different result than what I was expecting.
>
> I end up with:
> __init__.py
> manage.py
> settings.py
> urls.py
> mysite/
>    __init__.py
>    settings.py
>    urls.py
>
>
> When according to the documentation @
> https://docs.djangoproject.com/en/dev/releases/1.4-beta-1/#updated-default-project-layout-and-manage-py
>
> I was expecting:
> manage.py
> mysite/
>    __init__.py
>    settings.py
>    urls.py
>
> Can anyone confirm this behavior and/or explain why this is happening?
> Why two settings files? Why is there an __init__ at the manage.py
> level? Why is there a urls.py file at that same level?

Please make sure you've uninstalled any old version of Django before
performing a clean installation of 1.4 beta1.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Question regarding ticket #17062

2012-01-30 Thread Ramiro Morales
On Mon, Jan 30, 2012 at 6:21 AM, Ashe <matthieu@gmail.com> wrote:
> Could you help me make this modification working in the 1.3.1 ? I
> looked at the file modified in the changeset 17128, but it looks like
> it changed a lot between the release and this changeset.

Are you sure?. I've just tried and this is what I've found:

The changes to the tests (tests/regressiontests/backends/tests.py)
apply cleanly to 1.3.1, patch only reports some fuzz:
Hunk #1 succeeded at 11 with fuzz 2.
Hunk #2 succeeded at 230 with fuzz 2.

My copy of GNU patch can't apply the changes to the code itself
( django/db/backends/postgresql_psycopg2/base.py)
presumabily because the lines where the modified code lies
have changed.
But of you edit that file side by side with the .diff file from r17128
you will able to easily transfer the changes, because it is mostly
composed from deletion of code and moving of a block of code to
another spot.

Have you actually triedporting the changes of that commit
to a copy of 1.3.1?

> Or would you recommend to install the trunk ? I won't hide that I'm a
> bit scarred to put a trunk version on production.
> Will it be in the 1.4 ? I wasn't able to tell from the changeset page.

Yes, it will be in 1.4
-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial for dev version not working (Polls app): admin

2012-01-30 Thread Ramiro Morales
On Sun, Jan 29, 2012 at 12:15 AM, Alec Taylor <alec.tayl...@gmail.com> wrote:
>
> Going through the tutorial using the latest trunk in a virtualenv.
>
> I am getting stuck in this section:
> https://docs.djangoproject.com/en/dev/intro/tutorial02/#s-customize-the-admin-form
>
> No matter how I rearrange the fields (even when I remove the
> "question" field), I cannot notice any difference in the poll admin
> screens. I have tried syncdb, and restarting the server.

I've just followed tutorial up to that  and it's working for me.
>
> I've looked at [...] the view screen
> (http://localhost:9400/admin/polls/poll/1/) and the add screen
> (http://localhost:9400/admin/polls/poll/add/). There are no
> differences in field order/display on any of these pages.

The two pages above are the ones that are supposed to reflect
the changes in vusual order) you perform to the 'fields' field of your
django.contrib.admin.ModelAdmin subclass named PollAdmin.

In that step of the tutorial one is supposed to work with the
polls/admin.py and edit it so the final contents are::

01  from polls.models import Poll
02  from django.contrib import admin
03
04  class PollAdmin(admin.ModelAdmin):
05  fields = ['pub_date', 'question'] # or the order you want to use
06
07  admin.site.register(Poll, PollAdmin)


Are you sure you are doing that?

--
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-admin.py startproject will NOT work.

2011-12-31 Thread Ramiro Morales
On Fri, Dec 30, 2011 at 4:04 PM, Chris Kavanagh <cka...@gmail.com> wrote:
>>
>>   C:\python27\python C:\path\to\django-admin startproject foo
>>
>> or, if you have C:\python27 in the PATH, simply:
>>
>>   python C:\path\to\django-admin startproject foo
>>
>
> Thanks for the reply, however it didn't work. I get the exact same
> thing: "Usage: django-admin.py subcommand [options] [args]" with
> options below for help.
>

Try both, I think both of them should work.

BUT, that isn't the important part. The important part is abut you should
make sure you execute it with the Python interpreter.

Forget about trying to simple invoke django-admin (or django-admin.py)
as a standalone program.

Good luck.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-admin.py startproject will NOT work.

2011-12-30 Thread Ramiro Morales
On Fri, Dec 30, 2011 at 1:32 AM, Chris Kavanagh <cka...@gmail.com> wrote:
> Hi, I'm using WinXP, Python27, django 1.3.1.
>
> When I try django-admin.py startproject mysite, I get a "Usage django-
> admin.py subcommand [options] [args]" listing of commands instead of
> starting the project in mysite folder. . .I've tried every workaround
> I've found on Google & on this site. I've put C:\Python27\Lib\site-
> packages\django\bin in my Env Variable Path, I've changed the registry
> setting HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command
> to PYDIR\\python.exe" "%1" %*. I've typed in the full path in the
> command line (python django-admin.py startproject mysite) & nothing
> works. And yes, I set it up using python setup.py install.
>
> Any suggestions or other work arounds??? I'm at my wits end!!! Thanks
> for any help.

The safest, OS-independent and interpreted language-independent way to
get a script like django-admin to run is to simple use:

  path\to\the\interpreter\binary path\to\the\script

In your case it could be:

  C:\python27\python C:\path\to\django-admin startproject foo

or, if you have C:\python27 in the PATH, simply:

  python C:\path\to\django-admin startproject foo

This is particularly true and useful in platforms like Windows where
there is no robust/official way to associate a scripting language source
code file to signal the OS which interpreter binary should process and
execute it (like the #!/path/to/python line in Unix).

There are a handful of third party solution and tricks (like the ones
you tried) but from the number of times this topic appears in mailing
lists IMHO it is evident they only muddle the landscape and/or break
things.

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem re-creating SQLite database with manage.py...

2011-12-17 Thread Ramiro Morales
On Fri, Dec 16, 2011 at 5:44 PM, J. Marc Edwards
<marc.edwa...@nimbisservices.com> wrote:
>
> # sqlite database for testing
> DATABASES = {
>     'default': {
>     'ENGINE': 'django.db.backends.sqlite3',
>     'NAME': os.path.join(PROJDIR, 'db.sqlite'),
>     }
> }
>
> SOUTH_DATABASE_ADAPTERS = {
>     'default': "south.db.mysql"
> }

You are:

* Telling Django to use the SQLite3 backend
* South to use its MySQL support code.
* Getting the following text in the next to last line of the traceback:

File 
"/home/jmarcedwards/foobarr/local/lib/python2.7/site-packages/South-0.7.3-py2.7.egg/south/db/mysql.py",
line 38, in connection_init
cursor = self._get_connection().cursor()

Note the python module it mentions is /south/db/mysql.py,
that's what tracebacks are great for, if you read them
you quickly can get clues about what's wrong with your setup.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: static file problem with modwsgi+ apache2 with django1.3

2011-12-10 Thread Ramiro Morales
On Sat, Dec 10, 2011 at 7:01 AM, Jiss <jisson.vargh...@dexetra.com> wrote:
> Settings.py
> STATIC_ROOT = '/home/jisson/Desktop/testcloud.aws/DjangoApis/
> teststaticfiles/'

This is wrong (although it shouldn' t affect your apache+mod_wsgi deployment),
 per the tree structure you posted earlier, you don't have a teststaticfiles
directory.

>
> /etc/apache2/sites/enabled/DjangoApis:
>
> [...]
> Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static
> 
> Order deny,allow
> Allow from all
> 
>
> [...]
>
> apache errorlog:
> tail /var/log/apache2/error.log
> [Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
> exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
> referer: http://test.webapp/

Looks like you are missing a trailing / in the Alias definition. i.e.
it should read:

Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static/

(see https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/)

but the fact that all the error log entries are about subdirectories
of the static dir (js, images) but no about actual static files is a
bit strange.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial help: Make the poll app modifiable in the admin

2011-10-17 Thread Ramiro Morales
On Mon, Oct 17, 2011 at 7:05 AM, Daniel <dgam...@gmail.com> wrote:
> Hello i am progressing well on the tutorial here:
> https://docs.djangoproject.com/en/1.3/intro/tutorial02/
> however, I am stuck on Make the poll app modifiable in the admin.
>
> I have created an admin.py file within my polls directory. with the
> suggested code. However I keep getting this error ImportError: No
> module named polls.models
>
> any suggestions??

1. Have you followed part #1 of the tutorial where you create the 'polls'
application (that creates the polls/ subdir) and then edit the
paceholder models.py file inside it adding the Poll and Choice
model definitions?
2. Make sure you don't remove the __init__.py file inside that polls/ subdir
3. Are you effectively using Django 1.3?

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial confusion: flat project layout with django 1.3.1

2011-10-16 Thread Ramiro Morales
On Sun, Oct 16, 2011 at 11:27 PM, garyrob <gary...@mac.com> wrote:
> [...]
> But Part 1 of the django tutorial
> (https://docs.djangoproject.com/en/dev/intro/tutorial01/) shows a directory
> [...]
> But the tutorial is for version 1.3
> 'final', 0).

I'd ike to ask you what visual part of that online tutorial page makes you
think you are reading the documentation for the 1.3 release and
not the in-development code one.

We've implemented a couple of different strategies so the visitor really
knows what docs she/he is actually reading , the last one
being the light green selector in the lower right corner of all
the documentation pages that shows and controls what version
you are reading.

Maybe we can try to make it even more visible but I'm afraid
we are running out of ideas for this persistent problem some
users keep running into.

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: `manage.py syncdb` fails, but what does the error mean?

2011-10-01 Thread Ramiro Morales
On Sat, Oct 1, 2011 at 8:06 AM, chrisbuchholz
<christoffer.buchh...@gmail.com> wrote:
> Hey,
>
> I have this django 1.2 app, Snowy[1], that I try to get to run locally. But
> everytime I do `manage.py syncdb` I get this[2] error, but I have no idea
> what it means.
>
> Snowy uses, by default django 1.2, python 2 and SQLite3, and at first, I
> thought it was because that django couldnt talk to SQLite3, but if I create
> a new django 1.2 app in a python 2 environment, it works fine, so that is
> not it.
>
> I have no idea what the error means, and the Snowy devs haven't been able to
> help me out either. I hope some of you guys can.
>
> [1]: http://git.gnome.org/browse/snowy
> [2]: http://paste.pocoo.org/show/485318/

Your traceback shows you have a weird mixup of paths, both
/home/cb/.virtualenvs/snowy/ and /home/cb/Projects/snowy/
appear as locations of the snowy app.
Perhaps you created a virtualenv with a copy of the app
there but already have a global one?.

Also, is seems the app ships a copy of several third party
django apps (like south) inside their lib/ subdir.

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: FW: MySQLdb version doesn't match _mysql version

2011-08-21 Thread Ramiro Morales
On Sun, Aug 21, 2011 at 5:08 AM, Hadassa Golovenshitz <hgo...@gmail.com> wrote:
>
>
> Hi everyone,
>
> Thank you for taking the time to look at my question.
>
>
>
> I’m setting up a django project that I got from a code repository, and in
> trying to run ./manage.py syncdb I get the following error:
>
>
>
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> this is MySQLdb version (1, 2, 3, 'final', 0), but _mysql is version (1, 2,
> 2, 'final', 0).

Seems you mysqldb (the Python DB-API 2.0 compatible library to access
MySQL databases) installation is borked.

mysqldb is composed of two layers:

_mysql is a low level one, a more or less thin wrapper over the C mysql client
libraries.

On top of that there is mysldb itself, that uses the services of _mysql
and implemets the DB-API specification.

You seem to have a a corrupt copy because both pieces are released together,
and when a correct installation has been performed, they are built and installed
together with matching version IDs.

You might find better answers in a mailing list or IRC channel
devoted to mysqldb. This isn't a Django -related or -specific issue.

Regards,

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Splitting models.py results in table rename?

2011-08-19 Thread Ramiro Morales
On Fri, Aug 19, 2011 at 11:42 PM, Joshua Russo <josh.r.ru...@gmail.com> wrote:
> My models.py was getting too large so I tried to split it into
> /models
>   __init__.py
>   someLogicalGroupOfModels.py
>   andSoOn.py
> in the __init__.py I have
> from appName.models.someLogicalGroupOfModels import *
> from appName.models.andSoOn import *
> All of my imports still work but the queries are now looking for
> models_someTableName instead of appName_someTableName.
> I know I've done this before. Is there something I'm doing wrong?

Not wrong, you only need a small additional detail:

https://docs.djangoproject.com/en/1.3/ref/models/options/#app-label

-- 
Ramiro Morales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TransactionTestCase and Fixture Teardown

2011-07-11 Thread Ramiro Morales
On Mon, Jul 11, 2011 at 6:52 PM, David Cramer <dcra...@gmail.com> wrote:
> We're currently in the process of converting from unittest (pure) to
> Nose, and one of the issues I've noticed while doing this was that the
> database wasn't flushing correctly when switching from a
> TransactionTestCase to a TestCase. I've been digging through the code
> this morning, and I honestly can't even figure out how this would work
> in the standard test suite (excluding nose).

For our test runner it seems test case [1][2]reordering works in a way
so the TransactionTestCase's go to a bucket after the TestCase's even
when you specify an opposite explicit order. e.g.:

$ ~/django_test/pg83
backends.FkConstraintsTests.test_integrity_checks_on_creation
basic.ModelTest.test_object_creation -v2
[...]
test_object_creation (modeltests.basic.tests.ModelTest) ... ok
test_integrity_checks_on_creation
(regressiontests.backends.tests.FkConstraintsTests) ... ok

--
Ran 2 tests in 1.031s

So there isn't possibility of a TestCase being run after a
TransactionTestCase with our test infrastructure.  I can't say this is
by design or a result of gradual evolution of our test support code.
That's why I'm leaving this note here just in case we want to revisit
this at some point (although I suspect adding a flush at the end of
every test case for MySQL+MyISAM  TransactionTestCase will make it even
slower).

-- 
Ramiro Morales


1. 
https://code.djangoproject.com/browser/django/trunk/django/test/simple.py#L172
2. 
https://code.djangoproject.com/browser/django/trunk/django/test/simple.py#L252

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   3   4   >