Just found the culprit:
'form-INITIAL_FORMS': u'1', it must be 2.
On Tuesday, April 9, 2013 1:09:10 PM UTC+8, Nora Olsen wrote:
>
>
> The following snippet is returning an empty dictionary for the 2nd form:
>
>
>
>> dct = {'form-0-attachment': u'',
>> 'form-0-id': u'1',
>> 'form-0-name': u'
The following snippet is returning an empty dictionary for the 2nd form:
> dct = {'form-0-attachment': u'',
> 'form-0-id': u'1',
> 'form-0-name': u'1',
> 'form-1-attachment': u'',
> 'form-1-id': u'2',
> 'form-1-name': u'2',
> 'form-INITIAL_FORMS': u'1',
> 'form-MAX_NUM_FORMS': u'1000',
* Shawn Milochik [130408 16:41]:
> It should be fine, unless you're using encrypted fields, using the
> SECRET_KEY setting as the key, and have a different key in production.
>
> Of course, if you want to keep the databases in sync after that, that's
> another issue.
Understood.
Thanks.
--
T
Injecting data into client code is bound the be kludgy any way you slice
it. The reason for passing it through a hidden element has to do with
correct escaping of characters. Consider the following:
$.parseJSON("{{ images_as_json }}");
and lets say this is rendered as:
$.parseJSON("{foo: "bar"}"
It should be fine, unless you're using encrypted fields, using the
SECRET_KEY setting as the key, and have a different key in production.
Of course, if you want to keep the databases in sync after that, that's
another issue.
On Apr 8, 2013 5:09 PM, "Tim Johnson" wrote:
> FYI - I'm new to django,
I appreciate the suggestion, but using a hidden field sounds very
kludgy. Is there no other way?
On Mon, Apr 8, 2013 at 6:01 PM, Nikolas Stevenson-Molnar
wrote:
> Injecting data into a template can be tricky. I would recommend doing
> two things:
>
> 1) Serialize your data to JSON in your view fi
FYI - I'm new to django, but have been doing web programming since
'96 and python since '03.
I intend to put together a test site on my desktop and push it to a
remote server. I will be the only user making changes to this site.
Thus I presume that it is OK to push the database as well.
Am I cor
Injecting data into a template can be tricky. I would recommend doing
two things:
1) Serialize your data to JSON in your view first using Python's json
module. Something like this:
>>> images_as_json = json.dumps(images)
2) Rather than trying to inject it directly into JavaScript, which can
cause
I am passing a list of dictionaries to my template. In the template
language I can do this and it works as expected:
{% for row in images %}
{% endfor %}
But I need to process this data in jQuery. If I pass images into a
function like this:
my_func({{ images
Hi Serdar!
Yeah,i mean django admin by webinterface!I didn't created the spessific
table,i already had a legacy database running.For example i have the next
code for 1 of my tables in models.py:
class Links(models.Model):
interfacein = models.CharField(max_length=20L, db_column='InterfaceIn
Sorry, I answered before reading your full message. It looks like you
understand post loads the object in get_object(). I just want to add
that combined create/update can be done in different ways; I have
an implementation in mcbv.edit module but I'm not sure if it's the
best approach in all cases
Not sure exactly what the issue is, but this may be handy (either as a
replacement or as an example of doing something somewhat similar):
https://github.com/disqus/django-bitfield
I believe on most machines the maximum is 63 "flags" though so you will
likely only be able to use it as an example
On Monday, April 8, 2013 12:22:34 PM UTC-4, Nora Olsen wrote:
>
> Hi,
>
> I'm a new user to Django.
>
> I'm trying to understand how does an UpdateView works when during a POST.
> Is there some state carried between the GET and POST, because I don't see
> the pk in the form. How does the for
On Mon, Apr 8, 2013 at 7:26 PM, Giorgos Kontogiorgakis
wrote:
> Hi there guys!I have an answer about renaming objects on my webinterface.For
> example i have a table named "Map" and i have many obejcts in there(Map
> object,Map object,Map object,Map object,Map object,Map object) How is it
> possib
Hi,
I'm a new user to Django.
I'm trying to understand how does an UpdateView works when during a POST.
Is there some state carried between the GET and POST, because I don't see
the pk in the form. How does the form save() knows that it should be
updating instead of inserting?
The reason I'm
Hi there guys!I have an answer about renaming objects on my
webinterface.For example i have a table named "Map" and i have many obejcts
in there(Map object,Map object,Map object,Map object,Map object,Map object)
How is it possible to rename them?I mean i want to have something like (Map
Asia,Ma
On Mon, Apr 8, 2013 at 4:49 PM, Cody Scott wrote:
> Yes I am using Django 1.5
In 1.5, you can fully customise what fields your User class has. Full
notes in the docs:
https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#auth-custom-user
Cheers
Tom
--
You received this message becau
You can use BaseUserManager, AbstractBaseUser,PermissionsMixin.
here is a exemple:
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,
BaseUserManager
from django.confimport settings
class MyUserManager(BaseUserManager):
def create_user
Yes I am using Django 1.5
On Monday, 8 April 2013 11:11:57 UTC-4, Anderson Borges wrote:
>
> Hey Cody are using django 1.5?
>
>
> On Mon, Apr 8, 2013 at 9:09 AM, Cody Scott
> > wrote:
>
>> To create a User object you need to have a unique username.
>>
>> I would like to use an email and a passwor
Thanks
Resolved
On Monday, April 8, 2013 11:18:32 AM UTC-4, larry@gmail.com wrote:
>
> On Mon, Apr 8, 2013 at 9:02 AM, frocco >
> wrote:
> > on registration, login django is asking for uppercase and special chars
> for
> > password.
> > how do I tell django to allow basic passwords?
> >
On Apr 5, 2013, at 5:33 PM, Nikolas Stevenson-Molnar
wrote:
> How about creating request middleware to sign out deactivated users?
> Something like:
>
> if request.user.profile.expired:
>logout(request)
>
> If you're concerned about the extra database hit per request, then maybe
> cache th
On Mon, Apr 8, 2013 at 9:02 AM, frocco wrote:
> on registration, login django is asking for uppercase and special chars for
> password.
> how do I tell django to allow basic passwords?
>
> My site is live and I am having issues
This may help you: https://github.com/dstufft/django-passwords
--
Hey Cody are using django 1.5?
On Mon, Apr 8, 2013 at 9:09 AM, Cody Scott wrote:
> To create a User object you need to have a unique username.
>
> I would like to use an email and a password to identify users, since an
> email is already required for my site's functionality.
>
> It seems silly
To create a User object you need to have a unique username.
I would like to use an email and a password to identify users, since an
email is already required for my site's functionality.
It seems silly for a framework so restrict you.
--
You received this message because you are subscribed to
on registration, login django is asking for uppercase and special chars for
password.
how do I tell django to allow basic passwords?
My site is live and I am having issues
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe f
You want to output a list of one dict per object, and you want that dict to
contain another dict inside it. So you don’t need dict2. Instead
f = file('report.json','a+')
sys.stdout = f
result = []
objects = game_objects.objects.all()
for obj in objects:
time = time_
On Mon, Apr 8, 2013 at 8:43 AM, Javier Guerra Giraldez
wrote:
> On Mon, Apr 8, 2013 at 5:34 AM, Arun Prabhakar wrote:
>> more can come in the future
>
> that's reason enough to use Generic relations
(of course, much better would be if you can refactor your data
representation so you can go with
On Mon, Apr 8, 2013 at 5:34 AM, Arun Prabhakar wrote:
> more can come in the future
that's reason enough to use Generic relations
--
Javier
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving ema
Thank you
On Friday, April 5, 2013 8:27:34 PM UTC+2, megaBos wrote:
>
> good job
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@google
saved = sys.stdout
f = file('report.json','a+')
sys.stdout = f
result = []
objects = game_objects.objects.all()
for obj in objects:
dict2 ={}
time = time_stamp.objects.filter(user_id = obj.user_id)
obj_id = obj.object_id
per = performance.objects.
When I try to log in on a Django project that has been working for some time
with Firefox on Ubuntu I get a CSRF verification failure while with other
browsers I can log in just fine (Chromium on Ubuntu or Safari on iPad or even
another Firefox on MacOS). I have checked in the POST that the corr
GOT IT WORKING. It was a problem with the default tastypie read only
authorization
On Monday, April 8, 2013 12:00:35 PM UTC+1, psychok7 wrote:
>
> it was a quoting problem.. but now i get another error:
>
> HTTP/1.0 401 UNAUTHORIZED
>
> curl --dump-header - -H "Content-Type: application/json" -X
I see that u use windows... try with these
https://zignar.net/2012/06/17/install-python-on-windows/ first. with
virtualenv you can have more control and diferents versions to try without
any problem.
virtualenv create a virtual machine where you can install django, python,
etc to work with, if som
it was a quoting problem.. but now i get another error:
HTTP/1.0 401 UNAUTHORIZED
curl --dump-header - -H "Content-Type: application/json" -X POST --data
'{"city": "/api/smart/city/35/", "comment": "teste do php", "id": "4",
"resource_uri": "/api/smart/rating/4/", "rating": "3","user_id":
"/ap
guys i am having problems creating a new resource with django tastypie. i
get the following error:
class RatingResource(ModelResource):
city = fields.ForeignKey(CityResource, 'city')
user_id = fields.ForeignKey(UserResource, 'user')
class Meta:
queryset = Rating.objects.all()
On Sat, Apr 6, 2013 at 12:24 AM, John DeRosa
wrote:
> I have a Profile table that's 1:1 with the User table. Each Profile row has
> an account_expiration field.
>
> I want to invalidate users when their accounts expire. By "invalidate", I
> mean: They can't log in, and they can't use the system an
Hi Martin,
A and B are known, and more can come in the future, so it would seem
generic is the way to go, but then I dont want to reference on all tables
in django.
But using the FK has problem of introducing alter tables later.
Confused about going with which approach.
What do you suggest?
Hi guys,
some time ago a post was made on this group (I think) about a custom logger
that you can use to easy add log messages with specific keywords that may
appear in the admin as a filter.
Does any of you know what this package is?
I simply can't find the entry anymore.
Thanks!
Gabriel
-
http://ask.github.io/celery/cookbook/daemonizing.html
On Mon, Apr 8, 2013 at 6:01 AM, sparky wrote:
> Hi Django people,
>
> I'm finding it difficult to get my head around running celeryd as a daemon
> from the docs on Ubuntu. Does anyone know of any good tutorials or reading
> to help me along?
It's simply a question of what you want to model.
*GenericFK* means for each instance "I have a relationship with some
other (undefined) entity". *MultipleFK* means "I have relationships with
both well-known entities A and B". Totally different things.
Cheers,
mjl
--
You received
# I have 2 models, say A and B
class A(models.Model):
pass
class B(models.Model):
pass
"""
Now my query is which of the following would you choose and why?
"""
class GenericFK(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
Hi Django people,
I'm finding it difficult to get my head around running celeryd as a daemon
from the docs on Ubuntu. Does anyone know of any good tutorials or reading
to help me along?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
Also, do have a look at crispy-forms.
-Venkat
On Mon, Apr 8, 2013 at 7:59 AM, Ben Carleton wrote:
> You can use the label attribute on your form fields to override the
> default labels:
>
> dn = forms.CharField(label="dn")
> cv = forms.CharField(label="cv")
>
> -- Ben
>
>
> On 4/7/2013 10:11
43 matches
Mail list logo