hello list
i'm a newbie with django trying to learn
Now i have a question
when i do
---
from django import newforms as forms
django throw an exception : "Error was: cannot import name newfor
ok, thanks. Now I feel more relaxed.
On 8 jun, 15:50, Michael wrote:
> On Tue, Jun 8, 2010 at 3:46 PM, refreegrata wrote:
> > hello list
> > i'm a newbie with django trying to learn
> > Now i have a question
> > when i do
> > --
Hello list. I'm a newbie with django and have a problem with the
encoding. I use postgreSQL 8.3 with psycopg2. My database is in latin1
and i can't change this to utf-8(i don't have the permission), however
the database have a client-encoding in utf-8. I think this solves the
problem.
Now my probl
Hello list. I'm a newie in django with many questions. I want to do
something like this:
def (valor):
raise ValidationError("A")
class Mm
on in that case(blank) is never be evaluated.
On 15 jul, 11:26, Oleg Lomaka wrote:
> http://docs.djangoproject.com/en/1.2/ref/forms/fields/#required
>
> usu = forms.CharField(required=False, ...)
>
> On Jul 15, 2010, at 5:25 PM, refreegrata wrote:
>
> > Hello list. I'
Hello list. I have a problem. I'm a newbie in Django using his first
formset.
I have this:
class BaseFormFormato_habilitar(BaseModelFormSet):
def __init__(self, *args, **kwargs):
super(BaseFormFormato_habilitar, s
Aug 10, 2010 at 9:21 PM, refreegrata wrote:
> > Hello list. I have a problem. I'm a newbie in Django using his first
> > formset.
>
> > I have this:
> >
> > class BaseFormFormato_habilita
Hello list. I'm a newbie in django and now i am working with
"modelformset_factory".
I have something like this
--
class MyForm(forms.ModelForm):
myField = forms.BooleanField
with a model like this:
--
class Format(models.Model):
name1 = models.CharField(max_length=5)
name2 = models.CharField(max_length=5)
--
and a modelform like this:
-
M
Opps, I forgot to mention that I work with "Django 1.2.1". Apparently
is a Django bug.
Other persons has the same question "http://groups.google.com/group/
django-users/browse_thread/thread/c4899b0806e67ee7/d938f33a5f100af8?
show_docid=d938f33a5f100af8&fwc=1"
I will try to implement the solution y
Hello list, i have a newbie question
My code
--
class Format(models.Model):
name = models.CharField(max_length=5, unique=True)
myBoolean = models.BooleanField(default=False)
class FormFormat(forms.ModelForm):
boolean1 = forms.BooleanField(required=False
thing like {{ fieldcode|id }}
or {{ fieldcode.id }} in the template?
Best regards
On 13 ago, 02:16, Boguslaw Faja wrote:
> Hi,
>
> fast question: why fields = ['nombre'] instead of fields = ['name2'] ?
>
> Best regards
>
>
>
> On Wed, Aug 11, 2010 a
the idea isn't depend of javascript.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
Fo
somebody have an idea ?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more option
{{ form.instance.field of the model }}
is a way to access.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr.
Hello lista, I'm a newbie in django. In php i have the urlencode
function for encoding an url with characters "+","ñ","ó", Has
Django an urlencode or similar function?
Thanks for read, and sorry my bad english
P.D.: django 1,2.1
--
You received this message because you are subscribed to t
i'm sorry in my last time accidentally send the post before of
finish.
I try to do in the template something like
{{ my_var|urlencode }}
but don't work. Can i do something like an urlencode in the template?
P.D.: I'm from Chile.
--
You received this message because you are subscribed to the Go
our problem is with codification, and not with urlenconde...
> try to search about utf8 and html
>
>
>
> On Mon, Aug 30, 2010 at 22:09, refreegrata wrote:
> > i'm sorry in my last time accidentally send the post before of
> > finish.
> > I try to do in the templ
> and then in your template use: {% url the_name %}
>
> If it need a id or similar you can provide it with {% url the_name ID %}
>
>
>
> On Mon, Aug 30, 2010 at 23:08, refreegrata wrote:
> > for the moment i don´t have a problem, the section of my site work
now works for all characters. I don't know why, but now finally
works. ñ is converted to "%C3%B1", ó is converted to "%C3%B3", + to
"%2B", ...
thanks.
P.D.: I hate use special characters in an url, generaly is a bad idea,
but is necessary in my application.
The client want to filter registers ac
rewrite the __init__., redefining the form element in this place. The
error must to dissapear.
class FormMyForm(ModelForm):
def __init__(self, *args, **kwargs):
super(FormMyForm, self).__init__(*args, **kwargs)
self.fields[''] =
forms.CharField(widget=forms.TextInput(attrs=
just a few moments ago i saw this in the django documentation. Now
works fine. Thanks.
On 1 sep, 12:10, Tom Evans wrote:
> On Mon, Aug 30, 2010 at 10:45 PM, refreegrata wrote:
> > now works for all characters. I don't know why, but now finally
> > works. ñ is convert
Hello list, I have question. With this model:
-
1) class EE(Persona):
.
2) class DD(models.Model):
ee_id = models.ForeignKey(EE)
3) The User table
4) class PPDD(models.Model):
user_id = models.ForeignKey(User)
U0 WHERE U0."user_id" = 2)
the problem is SELECT U0."id". For my requeriments must to be SELECT
U0."departamento_id"
And other question. In this query
"EE.objects.filter(dd__ppdd__user=2)"
with something like this:
my_query = PPDD.objects.select_related('dd__ee').filter(user=2)
can works,but i need do a distinct clause over the rows of "ee" , How
can I do that?
DD.objects.select_related('dd__ee').filter(user=2).distinct() don't
works, because this query pick all the columns,if i ca
> EE.filter(dd__ppdd__user=2).distinct()
it work. The problem was mine. I must to put in the query the
"related_name" not the model name.
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...
Hello list. I'm have a questio. if I have an "inner join" query an use
an "only" restriction, how can i put a field of the second table in
the "only" tuple?
Example:
Model
-
class Abc(models.Model):
fk_user = models.ForeignKey(User, related_name='user_pp')
fk_ee = models.ForeignKe
that don't work. The query can find the "User" fields.
On 6 oct, 05:43, Daniel Roseman wrote:
> On Oct 6, 2:44 am, refreegrata wrote:
>
>
>
> > Hello list. I'm have a questio. if I have an "inner join" query an use
> > an "only" r
starting from Abc works with "select_related"
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroup
Hello i want to do a diagram to explain de mtv pattern. Any idea?
for explain the mvc I can do something like:
request--->controller->model->view->response
| ^
|-|
but i do
I have some questions.
difference between : views in mtv and controllers in mvc,
difference between : templates in mtv and views in mvc,
I read the documentation for Django, but still not clear to me.
--
You received this message because you are subscribed to the Google Groups
"Django users" g
Or:
request
|
|
V
internal controller(urls.py)
|
|
V
||
| views |<-->model
|___|<--->template
|
|
V
response
is this diagram most specific? have any error?(this post is only
because i need put a di
Hello, how can i get fields from different tables related for a
foreign key?
When I do a inner join like
AA.objects.filter(bb__field = ...) ...
I just can access to the AA fields, and not to fields in the other
table
in a normal query i can do something like "select AA.*, BB.* FROM. AA
inner jo
n unique "join", but
the second "join" can do multiple "join"s and I just need the AA
fields and the BB fields.
Is this idea correct?
On 15 oct, 12:27, Daniel Roseman wrote:
> On Oct 15, 4:19 pm, refreegrata wrote:
>
>
>
> > Hello, how can i get fiel
Hello list. I want to validate the data in a field of a model.
with this
validators=[MaxValueValidator(14)]
the field is correctly validated
but with this
validators=[MaxValueValidator(14.5)]
always is invalid
Somebody know how use the "MaxValueValidator" when the "max_value" is
a decimal?
than
Now works.
validators=[MaxValueValidator(Decimal('14.5'))
But I must to do an explicit declaration Decimal('14.5').
Somebody knows why?
On 15 oct, 18:13, refreegrata wrote:
> Hello list. I want to validate the data in a field of a model.
>
> with this
>
Hello list. I have a model with a ManyToMany field.
For example:
--
class Table(models.Model):
myField = models.ManyToManyField(OtherTable)
--
The modelForm
Hello list, I have a newie question, are in django some function like
nl2br in the template to print data saved previously from a
"textarea"? because in my template all the lines are printed in the
same line.
P.D.: nl2br is PHP function to do this:
"a
b
c"
is tranformed in
"abc"
Thanks for read
Thanks, is clearly explained in the documentation. I feel embarrassed
for do a post for something like this.
On 26 oct, 13:25, Daniel Roseman wrote:
> On Oct 26, 5:02 pm, refreegrata wrote:
>
> > Hello list, I have a newie question, are in django some function like
> > nl2br
maybe I not explain correctly. For any modelForm the forms for a field
"ManytoMany" are "select multiple". If I want to change this I must
to redefine the widget for that field in the declaration of the
"modelForm". This works correctly, I can transform the field from
"select multiple" to any "for
Yes, I know that, this is strange. My models.
--
Table 1: Enterprise
Table 2: Department with : fk_enterprise =
models.ForeignKey(Enterprise)
Table 3: Item with: fk_departament =
models.ManyToManyField(Departament)
If somebody know some way to save a Manytomany field (the
departments) manually in the view and not with form.save() would be
helpful.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroup
Hello list. I have a model "PP" with a "float" field "val" and a
modelform for this model
For update the data of a existent "PP" I use a form like this
Form_for_PP(request,POST, instance=instance)
Now my question is, Can I change the initial data for the field
"val"?
I want to do this:
If the
Thanks, you are the best
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more optio
This don't work to me. Now I must to use the "." like a thousand
separator and the "," like decimal separator (x.xxx,xx) (requirement
of the boss). I try to follow the guide to "custom format fields" in
the Django documentation, but I can't get formatted numbers.
I have this:
-
Hello list. I want to use the clean method in a model.
--
class myModel(models.Model):
fields
def clean(self):
raise ValidationError('The Error.')
---
Thats works fine. My question is
o associate a error with a specific field
> in a form class.
>
> On Nov 8, 8:40 pm, refreegrata wrote:
>
> > Hello list. I want to use the clean method in a model.
> > --
> > class myModel(models.Model):
> > fields
>
&g
iding how to
> raise the error.
>
> The issue is that a form and a model use validation errors in
> different ways. A form will send errors back to the templating layer
> to show to a user but a model doesn't work like that as it would only
> be manipulated directly in python co
Hello list, I have a question. How can i define a custom
decimal_separator and a custom thousand_separator independently of the
locale?. I don't want redefine this values to every "locale". To my
problem, in every the template must to display the same thousand
separator and the decimal separator.
Hello list, I want to do something like my_field = 1000(this value can
change depending of some situations, but the idea is a value injected
with Django, not with some data entered by the user in the HTML form.
I already try this:
-
def clean(self):
cleaned_data
Ok, with hidden fields. But if the user manually, with some tool,
change the value, thats will be a problem. For my safety I must to use
the hidden fields and still keep the clean methods to overwrite any
possible editing over the fields value. Originally the idea of this
post was search a way to p
Yes, you have reason. I prefer use something like an "exclude" or
"fields" tuple in the form meta, and set default values in the model
to the fields that I need, but some of the default values are foreign
keys.
I want to do something like:
.default = MyModel.objects.get(field=True)
and raise
ok, thanks for the answer. I have a final question. The other way is
in the __init__ set initial values in hidden fields, but if the user
(malicious) edit the value in some of this fields the form is invalid,
and the form comeback, but with the values edited for the user and the
error messages. Can
Hello list
I know, this question has been posted and resolved before, but the
solutions don't work in my situation. I don't know why.
When I try to use the "url" tag in any template an exception is raised:
"'str' object has no attribute 'regex'"
for example, with this I got the error:
-
Hello list.
Obviously, I come here with a question. I have a web application developed
with Django. It's working Ok. The app is just for internal use and the
access to every view is only avaliable for authenticated users with
permissions over the section (except for the view log-in)
Now other
Hello list
I have a question. I need to build a multi-level MultipleChoiceField.
Something like this:
---
Heavy Rain
KOF XIII
Halo 3
Watchmen
Swamp thing
Spiderman
Hello list. I have a question. To my could be really helpful write a
"log file" with the errors, to revise at the next day if something
happen. For the moment I have this, a middleware class:
--
from django.
For example in PostgreSQL, at least from the 8.3 version, you can't
have, in the same server, databases with differents encoding. But can
be defined a client_encoding for any database. With this you can have
a database with encoding='latin1' and client_encoding='utf8'. In
postgresql the client_enco
hello list. I have a question. With "python manage.py syncdb" the
tables are created in a database. Is possible use the configuration
declarated in the settings.py to create the database if this not
exists and make a script with lines like :
#---SCRIPT--
if not exists datab
ok, thanks i forget that the settings.py is just a python script.
On 18 mayo, 11:02, Shawn Milochik wrote:
> Sure, you can do this.
>
> Just write a Python script that imports settings (it should be on your
> PYTHONPATH) and read the database config info, and do your thing. The
> Django settings
Hello guys and girls. I have a question. In my apache configuration I
have this:
WSGIScriptAlias /misite "rute_to_file.wsgi"
The users can access from:
http://mysite/
and
https://mysite/
I need to enable the access only from "https://mysite/";. Every access
from "http://mysite/"; must to be red
Thanks men, I did this:
--
...
...
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
...
Works ok to me. Now I must to test the "Require Auth".
Bye.
On 31 mayo, 13:33, Michael Sc
Hello list, I have a question. Take a look to the next models.
class MyDoc(models.Model):
code = models.BigIntegerField()
class Myline(models.mode):
fk_myDoc = models.ForeignKey(MyDoc)
---
In my view I do something like
myPa
if I return another list:
---
for i in range(len(paginatorDocs.object_list)):
resultados = {'myDoc': paginatorDocs.object_list[i],
'myLines':
Myline.objects.filter(fk_myDoc=paginatorDocs.object_list[i].id),}
---
With this I
thanks for the answer, but the solution don't show anything. I must be
doing something wrong.
if now I have
---
class Myline(models.mode):
fk_myDoc = models.ForeignKey(MyDoc, related_name="")
---
How Can I use {% for line doc.X_set.all %} in the t
Hello list. I have a question. Whit a model like this
--
class Ghi(models.model):
dat = models.IntegerField(unique =True)
class Def(models.Model):
ghis = models.ForeignKeyField(Ghi)
class Abc(models.Model):
hello list. I have a model like this
class Dcto(models.Model):
..
fk_dcto = models.ManyToManyField('self', blank=True, null=True)
this create a this internal table with thi
to the first question, symmetrical=False, with this generate an
inverted information.
I want this.
id | from_dcto_id | to_dcto_id
x |old_dcto 1 | new_dcto
x |old_dcto 2 | new_dcto
---
finally I do this
--
class form(forms.ModelForm):
fk_dcto = forms.ModelMultipleChoiceField(queryset= ,
required=False, widget=forms.CheckboxSelectMultiple)
--
with this I can save with checkboxselectmultiple.
To define a correctly order to the many to manyfields in the
I still have the doubt.Does anyone know?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
hello list, I have a question. How can I get the width and the size of
an image previously saved?. This is , because I need to generate a
report with reportlab, and I must to resize the image, but I need the
original size to keep the scale.
Thanks and sorry for my bad english
--
You received thi
Hello list, I have a question. I want to assign the size of a file to
a var in the view, but the value must to be formated in a human-
readable file size. This is for a PDF report. In a template I can be
used the filter "filesizeformat", but Are some way to use that filter
in a view?
Thanks for re
thanks.
--
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 gr
Hello list, I have a question. I need to generate some gantt chart or
time line image to represent every step of an element in a process. I
already have saved the history, but I need represent this in a
graphic. Somebody know some library to do something like this? The
idea is build the graphic in
Hello list. I have a question. I've never done unit testing with
Django before. I still don't write any unittest but when I do this:
sudo. / manage.py test
Many errors appears. Errors related with the authentication. Errors
like:
===
I don't know but maybe the problem is related with this:
I use Middleware class provided by Ryan Witt. Whit this class the user
must to be authenticated to view any page other than LOGIN_URL
Can be this a problem to run the tests?
--
You received this message because you are subscribed to the G
Yeahh , I already try this. The number of errors decreases, but I
still have some errors (15)
-
==
ERROR: test_password_change_fails_with_invalid_old_password
(django.contrib.auth.tes
I add this to my settings:
---
TEMPLATE_CONTEXT_PROCESSORS = (
.
'django.contrib.messages.context_processors.messages',
<- new line
)
--
Hello list. I must to do a document to compare the most populars web
frameworks (Django, Ruby, Zend, ...), in terms like performance,
utilities, documentation, etc. For this document, the opinions of this
list would be helpful.
for example, for you, Why I must to choose Django instead of Ruby or
Z
thanks for the answers.
On 8 abr, 03:52, Xavier Ordoquy wrote:
>
> Isn't Ruby a language ?
Ok, my mistake, I want to say Ruby on Rails (typing error).
Bye.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
80 matches
Mail list logo