Re: Dealing with redundant JS inclusions at template levels

2013-09-30 Thread Darren Spruell
On Mon, Sep 30, 2013 at 6:11 AM, Rafael E. Ferrero
 wrote:
> I Dont know your design, usually i include the js library on base template
> and my apps templates extend from that... or just put another base template
> for every app...
>
> If you have some example code or tell us why you do that then we be more
> helpfull

My setup looks like this:

Django 1.5

Project/app structure:

mysite/ # Project root
 mysite/
  settings.py   # INSTALLED_APPS includes 'foo', a reusable app
 templates/
  base.html # Project base template, includes jQuery &
# Bootstrap JS for project
 static/# Static assets for project
  js/
   jquery.js
   bootstrap.min.js


foo/# Reusable app
 templates/
  foo/
   index.html   # app template, extends 'base.html'. Requires
# and includes jQuery and Bootstrap JS for app
 static/# Static assets for 'foo' app
  foo/
   js/
jquery.js
bootstrap.min.js
app.js

So when 'index.html' from the foo app is rendered, the JS imports look
like this:


  
  

  
  
  
 
  


...because both the project and the reusable app are using jQuery and
Bootstrap JS, loading them twice on the same page results in screwed
up JS behavior.


Also,

On Mon, Sep 30, 2013 at 6:18 AM, Dariel Dato-on  wrote:
> You can consider using Django Sekizai to manage your Javascript and CSS
> imports:
>
> https://django-sekizai.readthedocs.org/en/latest/

Seems interesting, I'll look into it more. To be honest, I think I'm
looking for a best practice rather than a solution; how are others
managing redundant JS includes when combining their own projects and
reusable apps? I imagine there's no app required to do this
intelligently.

DS



> 2013/9/30 Darren Spruell 
>>
>> Spent a bit of time debugging some faulty JavaScript library
>> functionality before I realized that I had included the library at
>> multiple levels in the project - first site-wide in the base template,
>> and then within a app. I think I ran into this:
>>
>>
>> http://stackoverflow.com/questions/4891278/what-is-the-danger-in-including-the-same-javascript-library-twice
>>
>> Is there a good design pattern to this situation, bearing in mind a
>> need to include JS libraries at project level and a desire to use apps
>> that include the same libraries in an attempt to be reusable?
>>
>> Looking at jQuery and Bootstrap for this.
>>
>> --
>> Darren Spruell
>> phatbuck...@gmail.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 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/CAKVSOJVxQ8XF9wojenv6FW53CTHw28xMsD7LCoYas5%2BRchxtBA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Rafael E. Ferrero
>
> --
> 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/CAJJc_8XTE884Y9oCCK1StrtRGxt0Jvd%3DcJiOfboNOdarK%3DC05A%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Darren Spruell
phatbuck...@gmail.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 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/CAKVSOJU9zxR3qJQHFq22X2oRPeTyz38SF%2B9QNfTkuExMiEwGYg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Интегрция django и 1c

2013-09-30 Thread Иван Земцов
Sorry, I asked the question in the wrong group.


On 30 September 2013 17:41, Rafael E. Ferrero wrote:

> No Che!, no lo usé nunca... ni siquiera tenía idea de su existencia,
> igualmente veo muchas urls con la extensión PHP que no me hacen ninguna
> gracia :P
>
> Saludos !!
>
>
> 2013/9/30 Иван Земцов 
>
>> Всем привет!
>> Кто нибудь обладает более подробной информацией по протоколу обмена чем
>> тут ?
>> http://v8.1c.ru/edi/edi_stnd/131/
>>
>> Может у кого-то есть какая-нибудь реализация данного протокола?
>>
>> --
>> С уважением, Иван
>>
>> --
>> 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/CACt1%2BqctgCtF0qbmxOtmFi2rRQ06zXn2AMyyPh_%3D5cswBUNA6w%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Rafael E. Ferrero
>
> --
> 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/CAJJc_8V-9xdN38dsBOmy_1CngU4UM2aBCf36vUvkcWc2LVLFoA%40mail.gmail.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 
https://groups.google.com/d/msgid/django-users/CACt1%2BqfNMm4ukxY%3DOYrHOZKo%3DjgvcMPTTv2ZFwW%2Bd-xFg04oAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Multiple versions of Django

2013-09-30 Thread Jasvir Singh
On Mon, 30 Sep 2013, Jasvir Singh wrote:

> Is it possible to install multiple versions of Django on single ubuntu server.
> If yes, please tell me how to do this.
@all, thanks for their help but my requirement is to use multiple 
versions of django on single server. I have to use it apache web server.
Here is the full scene. 
I have django 1.4.2 installed on ubuntu server which uses apache. 
There are several django based applications installed on it. All of 
them are working on django 1.4.2 . But recently I have developed an 
another application using django 1.5.2. Now I have to install that 
application on server, but problem is that, I can not remove django 
1.4.2 from server. For this purpose, I have tried virtual environment 
using steps given in following link:
http://serverfault.com/questions/413879/how-can-i-run-two-django-versions-in-the-same-server

But when I wish to use to application, I have to switch on virtual 
environment and start then django server. I want that app to run without 
using django server. 
Hope that I am able to explain the problem. If there is any confusion, please 
ask.


-- 
Jasvir Singh Grewal
Blog: jasvirsinghgrewal91.wordpress.com

:
[ GNU/Linux One Stanza Tip (LOST) ]###
 
Sub : To randomly play mp3 songs from a directoryLOST #243

mpg123 -z /path/to/mp3s/*.mp3
This will randomly play mp3 songs from the specified folder.
 
[ajitabhpandey (at) users.sourceforge.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 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/20131001031536.GA9891%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-30 Thread Serge G. Spaolonzi
Thanks, it worked.
Changing @override_settings(AUTH_USER_MODEL='auth.User') for
@override_settings(AUTH_USER_MODEL='auth.CustomUser') made the trick.

On Sun, Sep 29, 2013 at 9:09 PM, Russell Keith-Magee
 wrote:
>
> On Mon, Sep 30, 2013 at 7:27 AM, Serge G. Spaolonzi 
> wrote:
>>
>> Hi,
>>
>> I am failing to override the AUTH_USER_MODEL settings for a unittest, it
>> throws:
>>
>> "Manager isn't available; User has been swapped for 'None'"
>>
>> Is it possible to override AUTH_USER_MODEL in the unittest?
>> My goal is to use the default user model provided by django for the test
>> only.
>
>
> Yes, it is possible. That's why the approach is documented:
>
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-testing-fixtures
>
> If you're getting an error, It sounds like something else is going wrong in
> your test suite -- my guess would be that you haven't got the auth app in
> INSTALLED_APPS. However, it's impossible to say for sure without seeing more
> code.
>
> Yours,
> Russ Magee %-)
>
> --
> 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.



-- 
Serge G. Spaolonzi
Cobalys Systems
http://www.cobalys.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 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/CA%2BrwjWXc-k166BhY5%3DRRM9LR21MFTyf9KqDMSozKErohbMEchw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django-cart. How to run method add_to_cart?

2013-09-30 Thread Ricardo
Hi, I have this same problem.
I'm looking for answer everywhere.
enemybass could implement?
If someone can help me with this

[] s

Em quarta-feira, 26 de setembro de 2012 05h33min24s UTC-3, enemybass 
escreveu:
>
> https://github.com/bmentges/django-cart
>
> *I'm* a total *newbie* to *Django. *How to run method *add_to_car*t? In 
> template I would have button "add to cart".
>
> Thanks.
>
> def add_to_cart(request, product_id, quantity):
> product = Product.objects.get(id=product_id)
> cart = Cart(request)
> cart.add(product, product.unit_price, quantity)
>
> My model look something like this:
>
> class Product(models.Model):
> name = models.CharField(max_length=50)
> slug = models.SlugField()
> unit_price = models.DecimalField(max_digits=5, decimal_places=2)
> category = models.ManyToManyField(Category)
>
> class Meta:
> verbose_name = "Product"
> verbose_name_plural = "Products"
>
> def __unicode__(self):
> return self.name
>
>

-- 
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/cfabbfd6-01ac-4b40-b887-ea7d7cd59c06%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Marcin Szamotulski
Thanks, I thought I checked this.

Marcin


On 30 September 2013 18:22, Daniel Roseman  wrote:

> On Monday, 30 September 2013 18:18:00 UTC+1, Zoltan Szalai wrote:
>
>>  try not to use the same value ('about') for the name attribute of the
>> textarea and your submit button.
>> not sure it helps the situation though.
>>
>>
> I'd say that is the exact cause of the problem, actually.
> --
> DR.
>
> --
> 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/33dbbd77-5726-4a85-b334-02f2041b9b0b%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 
https://groups.google.com/d/msgid/django-users/CADkSB_3PpSHwWjoDdcTHNxbApDMLo2QE0r2Wnmnzjb-4gTOV9g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Vancouver Python Day

2013-09-30 Thread Mike Doroshenko II

That sounds cool, I would consider going if I lived in Vancouver.

On 09/30/2013 03:25 PM, Andy McKay wrote:
The Vancouver Python User Group and the Vancouver Django Meetup Group 
are pleased to announce:


Vancouver Python Day
Saturday, November 16, 2013
SFU Harbour Centre

Part of Vancouver Developer Week 2013, Vancouver Python Day is a 
one-day mini conference celebrating the Python Developer Community in 
Vancouver.


We hope to have talks covering a wide variety of Python development, 
from web development to gaming to performance and optimization. To 
that end, we're currently seeking talk proposals. Please visit 
https://github.com/andymckay/vancouver-python-day and submit your 
proposal today.


Tickets will be offered for a nominal fee; we'll be sending another 
announcement before tickets go on sale. In the meantime, please mark 
your calendars!


More information on Vancouver Python Day:
http://www.vanpyday.com/

More information on Vancouver Developer Week:
http://vancouver.devweek.org/

--
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/CAOjXX8byc%2BVWV6Eu3m_f6ZykPdnF%3Dd7mra4BJkUjdhSy9CDX1g%40mail.gmail.com.

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


--
Mike Doroshenko, Junior Sys Admin
TecKnoQuest Inc.
mi...@tecknoquest.com
www.tecknoquest.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 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/5249EF09.9070305%40tecknoquest.com.
For more options, visit https://groups.google.com/groups/opt_out.


Vancouver Python Day

2013-09-30 Thread Andy McKay
The Vancouver Python User Group and the Vancouver Django Meetup Group are
pleased to announce:

Vancouver Python Day
Saturday, November 16, 2013
SFU Harbour Centre

Part of Vancouver Developer Week 2013, Vancouver Python Day is a one-day
mini conference celebrating the Python Developer Community in Vancouver.

We hope to have talks covering a wide variety of Python development, from
web development to gaming to performance and optimization. To that end,
we're currently seeking talk proposals. Please visit
https://github.com/andymckay/vancouver-python-day and submit your proposal
today.

Tickets will be offered for a nominal fee; we'll be sending another
announcement before tickets go on sale. In the meantime, please mark your
calendars!

More information on Vancouver Python Day:
http://www.vanpyday.com/

More information on Vancouver Developer Week:
http://vancouver.devweek.org/

-- 
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/CAOjXX8byc%2BVWV6Eu3m_f6ZykPdnF%3Dd7mra4BJkUjdhSy9CDX1g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using unique_together with foreign key fields which may be None

2013-09-30 Thread Karen Tracey
On Mon, Sep 30, 2013 at 4:55 PM, Berndt Jung  wrote:

> Because the lookup_value of a null field is None, the validation check is
> aborted entirely.  This seems wrong to me, and I'm wondering if I'm doing
> something wrong here.  Redefining the models is not something I can do at
> this point.


None in Python corresponds to NULL in SQL. SQL defines that NULL != NULL.
So when checking for unique values the database will not consider two NULLs
to be the same value; the NULLs will be considered to be different and will
not violate the unique constraint. The Django code is doing the same check
for uniquess that the database will be enforcing. There is no way I know of
to make a database enforce uniqueness among NULL values...

-- 
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/CACS9raekOZyHHmjEuNRCH-JC9xL7qFqCTuYJbu55pCuONHw-oA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using unique_together with foreign key fields which may be None

2013-09-30 Thread Berndt Jung
Well, I may have answered my own question.  It looks like per the SQL 
standard NULL values are unique.  Here from the postgres docs:

In general, a unique constraint is violated when there are two or more rows 
in the table where the values of all of the columns included in the 
constraint are equal. However, null values are not considered equal in this 
comparison. That means even in the presence of a unique constraint it is 
possible to store duplicate rows that contain a null value in at least one 
of the constrained columns. This behavior conforms to the SQL standard, but 
we have heard that other SQL databases may not follow this rule. So be 
careful when developing applications that are intended to be portable.

So it looks like django is doing the right thing although it seems pretty 
unintuitive.  It looks like I may have to modify the models afterall.

On Monday, September 30, 2013 1:55:11 PM UTC-7, Berndt Jung wrote:
>
> Hi,
>
> I'm having trouble using the unique together constraint with a a field 
> which may be None.  Given this model:
>
> class Rule(models.Model):
>
> internal = models.BooleanField(default=False)
>
> port_range_from = models.PositiveIntegerField(null=True, blank=True)
> port_range_to = models.PositiveIntegerField(null=True, blank=True)
>
> # either cidr_ip or src_group for ingress rules
> cidr_ip = IPNetworkField(blank=True, null=True)
> is_ingress = models.BooleanField(default=True)
>
> # a security group is used as src in this rule
> src_security_group = models.ForeignKey(
> SecurityGroup, to_field='uuid', null=True, blank=True)
>
> class Meta:
> app_label = "nomos"
> unique_together = (
> ('port_range_from', 'port_range_to', 'cidr_ip', 
> 'src_security_group', 'is_ingress'),
> )
>
> Now in this instance src_security_group may be None OR cidr_ip may be 
> None.  In this case they are mutually exclusive.  Regardless I want to use 
> the unique_together to ensure that no two identical rules are created. 
>  However, in the django models/base.py code the following logic is in 
> _perform_unique_check:
>
> lookup_kwargs = {}
> for field_name in unique_check:
> f = self._meta.get_field(field_name)
> lookup_value = getattr(self, f.attname)
> if lookup_value is None:
> # no value, skip the lookup
> continue
> if f.primary_key and not self._state.adding:
> # no need to check for unique primary key when editing
> continue
> lookup_kwargs[str(field_name)] = lookup_value
>
> # some fields were skipped, no reason to do the check
> if len(unique_check) != len(lookup_kwargs):
> continue
>
> Because the lookup_value of a null field is None, the validation check is 
> aborted entirely.  This seems wrong to me, and I'm wondering if I'm doing 
> something wrong here.  Redefining the models is not something I can do at 
> this point.
>
> Berndt
>

-- 
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/f5710e1c-04ca-4e9c-aa13-0ec756b3a40a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Using unique_together with foreign key fields which may be None

2013-09-30 Thread Berndt Jung
Hi,

I'm having trouble using the unique together constraint with a a field 
which may be None.  Given this model:

class Rule(models.Model):

internal = models.BooleanField(default=False)

port_range_from = models.PositiveIntegerField(null=True, blank=True)
port_range_to = models.PositiveIntegerField(null=True, blank=True)

# either cidr_ip or src_group for ingress rules
cidr_ip = IPNetworkField(blank=True, null=True)
is_ingress = models.BooleanField(default=True)

# a security group is used as src in this rule
src_security_group = models.ForeignKey(
SecurityGroup, to_field='uuid', null=True, blank=True)

class Meta:
app_label = "nomos"
unique_together = (
('port_range_from', 'port_range_to', 'cidr_ip', 
'src_security_group', 'is_ingress'),
)

Now in this instance src_security_group may be None OR cidr_ip may be None. 
 In this case they are mutually exclusive.  Regardless I want to use the 
unique_together to ensure that no two identical rules are created. 
 However, in the django models/base.py code the following logic is in 
_perform_unique_check:

lookup_kwargs = {}
for field_name in unique_check:
f = self._meta.get_field(field_name)
lookup_value = getattr(self, f.attname)
if lookup_value is None:
# no value, skip the lookup
continue
if f.primary_key and not self._state.adding:
# no need to check for unique primary key when editing
continue
lookup_kwargs[str(field_name)] = lookup_value

# some fields were skipped, no reason to do the check
if len(unique_check) != len(lookup_kwargs):
continue

Because the lookup_value of a null field is None, the validation check is 
aborted entirely.  This seems wrong to me, and I'm wondering if I'm doing 
something wrong here.  Redefining the models is not something I can do at 
this point.

Berndt

-- 
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/fd542fd7-0cd2-40ed-ac3d-e1f3d8a019eb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to Query account/profile information for multiple account and allowing user edit or update acount

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 19:33:31 UTC+1, Okorie Emmanuel wrote:

> I have two problems 
>
> 1. How can i populate the account 
>information of each user, this 
>what i have done but only info on
>user models populates, the info on extended 
>field does not show on my template
>
> # models.py
>class Student(Models.model):
>   user = foreignkey(user)
>   sex= models.charfied()
>  ..
>
>  class Teacher(Models.model):
>   user = foreignkey(user)
>   sex= models.charfied()
>   salary models.charfield()
>  ..
>
>
>
># views.py
>
>  @login_required(login_url='/
> login/')
> def account(request, template_name="account.html"):
> if not request.user.is_authenticated():
> return HttpResponseRedirect('/login/')
> regis = property(lambda u: Candidate.objects.get(User=u)[0])
> context = {'regis': regis}
> return render_to_response('account.html', context, 
> context_instance=RequestContext(request))
>  
>

What is that property/lambda stuff supposed to be doing? You *seem* to be 
trying to define something that will get a Candidate from a user, but I 
don't understand why you're wrapping it in 'property', and then of course 
you don't ever call it or pass it a User. If you did call it, you'd no 
doubt get multiple errors, for example `get` only returns a single object 
so indexing it with [0] is bound to raise an exception.

Also, you might want to explain the relationship between a Candidate and 
the Student/Teacher models you've shown above. 
--
DR.

-- 
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/beedfe13-35a8-4def-a0e4-72dc478775fb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to Query account/profile information for multiple account and allowing user edit or update acount

2013-09-30 Thread Frank Bieniek

Please try, django-userena, or django-registration,
both deal with userdetails.

Thx
Frank


Am 30.09.13 20:33, schrieb Okorie Emmanuel:

I have two problems

1. How can i populate the account
   information of each user, this
   what i have done but only info on
   user models populates, the info on extended
   field does not show on my template

# models.py
   class Student(Models.model):
  user = foreignkey(user)
  sex= models.charfied()
 ..

 class Teacher(Models.model):
  user = foreignkey(user)
  sex= models.charfied()
  salary models.charfield()
 ..



   # views.py

 @login_required(login_url='/
login/')
def account(request, template_name="account.html"):
if not request.user.is_authenticated():
return HttpResponseRedirect('/login/')
regis = property(lambda u: Candidate.objects.get(User=u)[0])
context = {'regis': regis}
return render_to_response('account.html', context, 
context_instance=RequestContext(request))


#account.html

{% extends "base.html" %}

{% block wrapper %}
 welcome  {{ user.username }}
Email: {{ user.email }}
Name: {{ regis.u.first_name }}
Sex: {{ regis.sex }}
surname: {{ regis.last_name }}
Date of birth: {{ regis.dob }}
Marital status: {{ regis.marital_status }}
passport: {{ regis.passport }}


{% endblock %}

{{user.username}}, {{ user.email }} shows but
the rest does not show

2. i Have the profile form to enable user
edit their account anytime they want,
but i can't figure the code around it

any solution to this problem
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/50bfe62a-556b-4b29-8ba9-50d58006c2c1%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 
https://groups.google.com/d/msgid/django-users/5249C868.4020203%40produktlaunch.de.
For more options, visit https://groups.google.com/groups/opt_out.


How to Query account/profile information for multiple account and allowing user edit or update acount

2013-09-30 Thread Okorie Emmanuel
I have two problems 

1. How can i populate the account 
   information of each user, this 
   what i have done but only info on
   user models populates, the info on extended 
   field does not show on my template

# models.py
   class Student(Models.model):
  user = foreignkey(user)
  sex= models.charfied()
 ..

 class Teacher(Models.model):
  user = foreignkey(user)
  sex= models.charfied()
  salary models.charfield()
 ..


   
   # views.py
   
 @login_required(login_url='/
login/')
def account(request, template_name="account.html"):
if not request.user.is_authenticated():
return HttpResponseRedirect('/login/')
regis = property(lambda u: Candidate.objects.get(User=u)[0])
context = {'regis': regis}
return render_to_response('account.html', context, 
context_instance=RequestContext(request))

#account.html

{% extends "base.html" %}

{% block wrapper %}
 welcome  {{ user.username }}
Email: {{ user.email }}
Name: {{ regis.u.first_name }}
Sex: {{ regis.sex }}
surname: {{ regis.last_name }}
Date of birth: {{ regis.dob }}
Marital status: {{ regis.marital_status }}
passport: {{ regis.passport }}


{% endblock %}

{{user.username}}, {{ user.email }} shows but
the rest does not show 

2. i Have the profile form to enable user
edit their account anytime they want,
but i can't figure the code around it

any solution to this problem
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/50bfe62a-556b-4b29-8ba9-50d58006c2c1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 18:18:00 UTC+1, Zoltan Szalai wrote:

>  try not to use the same value ('about') for the name attribute of the 
> textarea and your submit button.
> not sure it helps the situation though.
>
>
I'd say that is the exact cause of the problem, actually.
--
DR. 

-- 
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/33dbbd77-5726-4a85-b334-02f2041b9b0b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Multiple versions of Django

2013-09-30 Thread carlos
Hi, uwsgi is too good option http://uwsgi-docs.readthedocs.org/en/latest/ and
nginx with virtualenv


On Mon, Sep 30, 2013 at 11:45 AM, Peter Herndon  wrote:

> I would suggest using separate virtual environments, each with gunicorn (
> http://gunicorn.org/) installed into the venv. Run gunicorn listening on
> a different port per venv, start all your venvs under supervisord (
> http://supervisor.org/), and proxy them behind nginx (
> http://wiki.nginx.org/).
>
> On Sep 30, 2013, at 11:48 AM, Bill Freeman  wrote:
>
> > Virtual environments can, indeed, be used under Apache.  I presume other
> front ends can also handle this.
> >
> > For Apache, the separate VE's need to be in separate deamon process
> groups, so that their sys.path settings can differ.
> >
> > The primary thing that virtualenv does for you is tweak sys.path,
> usually by setting PYTHONHOME, but there are other ways.
> >
> > If using a new enough mod_wsgi (3.4 or later, I htink), there is a
> python-home option to the WSGIDaemonProcess directive.  Otherwise you can
> fiddle sys.path in your wsgi script file.  If you are using
> Apache/mod_wsgi, there is lots of useful documentation and a pointer to
> their mailing list at http://code.google.com/p/modwsgi/
> >
> >
> > On Mon, Sep 30, 2013 at 11:30 AM, Gerald Klein  wrote:
> > Sorry please disregard I didn't read far enough into your message
> >
> >
> > On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh 
> wrote:
> > Is it possible to install multiple versions of Django on single ubuntu
> server.
> > If yes, please tell me how to do this.
> > I have already made a try for this using virtual environment, but
> > found that it is only for development.
> >
> > --
> >
> > Jasvir Singh Grewal
> > Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> > --
> > Gerald Klein DBA
> > contac...@geraldklein.com
> > www.geraldklein.com
> > geraldklein.wordpress.com
> > j...@zognet.com
> > 708-599-0352
> >
> > Arch Awesome, Ranger & Vim the coding triple threat.
> > Linux registered user #548580
> > Brought to you by the Amish Mafia
> >
> >
> > --
> > 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/CAP8NtCw5tr3%3Dt0k6H2CUVGfaNkX6jFhArh6E1iz32s412%3DjL0Q%40mail.gmail.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
> https://groups.google.com/d/msgid/django-users/CAB%2BAj0trj-MnweyArGTyfSy6SR0wdRLdwV_tYCXfOvA%3DgvOeGg%40mail.gmail.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
> https://groups.google.com/d/msgid/django-users/78E9816C-7555-4A0C-928D-F9D346463987%40gmail.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 

Re: Multiple versions of Django

2013-09-30 Thread Peter Herndon
I would suggest using separate virtual environments, each with gunicorn 
(http://gunicorn.org/) installed into the venv. Run gunicorn listening on a 
different port per venv, start all your venvs under supervisord 
(http://supervisor.org/), and proxy them behind nginx (http://wiki.nginx.org/).

On Sep 30, 2013, at 11:48 AM, Bill Freeman  wrote:

> Virtual environments can, indeed, be used under Apache.  I presume other 
> front ends can also handle this.
> 
> For Apache, the separate VE's need to be in separate deamon process groups, 
> so that their sys.path settings can differ.
> 
> The primary thing that virtualenv does for you is tweak sys.path, usually by 
> setting PYTHONHOME, but there are other ways.
> 
> If using a new enough mod_wsgi (3.4 or later, I htink), there is a 
> python-home option to the WSGIDaemonProcess directive.  Otherwise you can 
> fiddle sys.path in your wsgi script file.  If you are using Apache/mod_wsgi, 
> there is lots of useful documentation and a pointer to their mailing list at 
> http://code.google.com/p/modwsgi/
> 
> 
> On Mon, Sep 30, 2013 at 11:30 AM, Gerald Klein  wrote:
> Sorry please disregard I didn't read far enough into your message
> 
> 
> On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh  
> wrote:
> Is it possible to install multiple versions of Django on single ubuntu server.
> If yes, please tell me how to do this.
> I have already made a try for this using virtual environment, but
> found that it is only for development.
> 
> --
> 
> Jasvir Singh Grewal
> Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> -- 
> Gerald Klein DBA
> contac...@geraldklein.com
> www.geraldklein.com
> geraldklein.wordpress.com
> j...@zognet.com
> 708-599-0352
> 
> Arch Awesome, Ranger & Vim the coding triple threat.
> Linux registered user #548580 
> Brought to you by the Amish Mafia
> 
> 
> -- 
> 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/CAP8NtCw5tr3%3Dt0k6H2CUVGfaNkX6jFhArh6E1iz32s412%3DjL0Q%40mail.gmail.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 
> https://groups.google.com/d/msgid/django-users/CAB%2BAj0trj-MnweyArGTyfSy6SR0wdRLdwV_tYCXfOvA%3DgvOeGg%40mail.gmail.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 
https://groups.google.com/d/msgid/django-users/78E9816C-7555-4A0C-928D-F9D346463987%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: no value in database

2013-09-30 Thread Satinderpal Singh
On Mon, Sep 30, 2013 at 10:07 PM, Harjot Mann  wrote:
> Here is the code to my view,
> http://tny.cz/57446220
> After filing form when I click on submit button , I am getting this
> error "SsupenceEditJob matching query does not exist" and not getting

I think it must be SuspenceEditJob.

-- 
Satinderpal Singh

-- 
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/CA%2BiK19%2BP8TCort0RKRJDLuAO6e0s0szT4VsLkTKeJz2XQZvSmw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Zoltan Szalai
try not to use the same value ('about') for the name attribute of the 
textarea and your submit button.

not sure it helps the situation though.


On 2013.09.30. 19:13, Marcin Szamotulski wrote:

ps. If I render the form with
enctype='multipart/form-data'>

{{ form.as_ul() }}

I get the same behaviour.

Marcin


On 30 September 2013 17:11, Marcin Szamotulski > wrote:


Sure here it is how the form is render:

 


Submit


Format:

Text
reStructuredText
MarkDown



Profile image:






I use jinja2 template language and it is rendered with

{% csrf_token %}
{{ render_field(aboutform.about, label=False) }}
{{ render_field(aboutform.format) }}
{{ render_field(aboutform.image) }}



where render_field is a simple macro:

{% macro render_field(field, inline=True, after=True, label=True) -%}
{% if inline and field.field.widget.__class__.__name__ ==
'CheckboxInput' -%}
{{ render_boolfield(field, after) }}
{%- else -%}
{% if label -%}
{{ field.label_tag() }}
{%- endif %}
{{ field.as_widget() }}

{{ field.errors.as_ul() }}

{%- endif %}
{%- endmacro %}

Thanks,
Marcin



On 30 September 2013 15:11, Daniel Roseman > wrote:

On Monday, 30 September 2013 15:41:47 UTC+1, Marcin
Szamotulski wrote:


I don't do anything odd: I simply modify it by typing in
side textarea.
The page has a very simple JavaScript which does not do
anything with
the textarea (though I double-checked that turning it off
does not
improve the situation).  Inspecting the request reveals
that the data is
indeed submitted twice (thus django correctly interpret
the situation).

The form is using enctype='multipart/form-data' since it
is also used to
submit a file, though leaving only the textarea inside the
form and
removing the enctype does not help.

I also checked this in both firefox and chrome and both
show that the
POST data for this textarea is submitted twice.

Any ideas?

Thanks for help,
Marcin


Can you perhaps post the template fragment that renders the
field, and also the rendered HTML?
--
DR.



--
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/5249B248.2000705%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Marcin Szamotulski
ps. If I render the form with

{{ form.as_ul() }}

I get the same behaviour.

Marcin


On 30 September 2013 17:11, Marcin Szamotulski  wrote:

> Sure here it is how the form is render:
>
>  
>   value='' />
>  
> Submit
> 
>  
> Format:
> 
> Text
>  selected="selected">reStructuredText
> MarkDown
> 
> 
> 
> Profile image:
>  
> 
>  
> 
> 
>
> I use jinja2 template language and it is rendered with
>  enctype='multipart/form-data'>
>  {% csrf_token %}
> {{ render_field(aboutform.about, label=False) }}
> {{ render_field(aboutform.format) }}
>  {{ render_field(aboutform.image) }}
> 
> 
>
> where render_field is a simple macro:
>
> {% macro render_field(field, inline=True, after=True, label=True) -%}
> {% if inline and field.field.widget.__class__.__name__ ==
> 'CheckboxInput' -%}
>  {{ render_boolfield(field, after) }}
> {%- else -%}
> {% if label -%}
> {{ field.label_tag() }}
>  {%- endif %}
> {{ field.as_widget() }}
> 
>  {{ field.errors.as_ul() }}
> 
> {%- endif %}
> {%- endmacro %}
>
> Thanks,
> Marcin
>
>
>
> On 30 September 2013 15:11, Daniel Roseman  wrote:
>
>> On Monday, 30 September 2013 15:41:47 UTC+1, Marcin Szamotulski wrote:
>>
>>>
>>> I don't do anything odd: I simply modify it by typing in side textarea.
>>> The page has a very simple JavaScript which does not do anything with
>>> the textarea (though I double-checked that turning it off does not
>>> improve the situation).  Inspecting the request reveals that the data is
>>> indeed submitted twice (thus django correctly interpret the situation).
>>>
>>> The form is using enctype='multipart/form-data' since it is also used to
>>> submit a file, though leaving only the textarea inside the form and
>>> removing the enctype does not help.
>>>
>>> I also checked this in both firefox and chrome and both show that the
>>> POST data for this textarea is submitted twice.
>>>
>>> Any ideas?
>>>
>>> Thanks for help,
>>> Marcin
>>>
>>
>> Can you perhaps post the template fragment that renders the field, and
>> also the rendered HTML?
>> --
>> DR.
>>
>> --
>> 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/045cca12-7ec5-4d29-bc6c-4a601eff5996%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 
https://groups.google.com/d/msgid/django-users/CADkSB_3ivuQkLV-HYpTABAurOxgZJ-WiSC8d5%3DDOOKy5tF3Sag%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Marcin Szamotulski
Sure here it is how the form is render:

 

 
Submit

 
Format:

Text
reStructuredText
MarkDown



Profile image:
 

 



I use jinja2 template language and it is rendered with

 {% csrf_token %}
{{ render_field(aboutform.about, label=False) }}
{{ render_field(aboutform.format) }}
 {{ render_field(aboutform.image) }}



where render_field is a simple macro:

{% macro render_field(field, inline=True, after=True, label=True) -%}
{% if inline and field.field.widget.__class__.__name__ ==
'CheckboxInput' -%}
 {{ render_boolfield(field, after) }}
{%- else -%}
{% if label -%}
{{ field.label_tag() }}
 {%- endif %}
{{ field.as_widget() }}

 {{ field.errors.as_ul() }}

{%- endif %}
{%- endmacro %}

Thanks,
Marcin



On 30 September 2013 15:11, Daniel Roseman  wrote:

> On Monday, 30 September 2013 15:41:47 UTC+1, Marcin Szamotulski wrote:
>
>>
>> I don't do anything odd: I simply modify it by typing in side textarea.
>> The page has a very simple JavaScript which does not do anything with
>> the textarea (though I double-checked that turning it off does not
>> improve the situation).  Inspecting the request reveals that the data is
>> indeed submitted twice (thus django correctly interpret the situation).
>>
>> The form is using enctype='multipart/form-data' since it is also used to
>> submit a file, though leaving only the textarea inside the form and
>> removing the enctype does not help.
>>
>> I also checked this in both firefox and chrome and both show that the
>> POST data for this textarea is submitted twice.
>>
>> Any ideas?
>>
>> Thanks for help,
>> Marcin
>>
>
> Can you perhaps post the template fragment that renders the field, and
> also the rendered HTML?
> --
> DR.
>
> --
> 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/045cca12-7ec5-4d29-bc6c-4a601eff5996%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 
https://groups.google.com/d/msgid/django-users/CADkSB_1eP_ai%2BTTR9tECt_rXqZtAyhJz3r4upn-YBvziQoqz_w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


no value in database

2013-09-30 Thread Harjot Mann
Here is the code to my view,
http://tny.cz/57446220
After filing form when I click on submit button , I am getting this
error "SsupenceEditJob matching query does not exist" and not getting
any values in database.
Help me please.

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

-- 
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/CAB0GQhC%3DXNo6tBYQKwOagBmEBz70zUy0imMmMS8b7m2ygEbAnw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Multiple versions of Django

2013-09-30 Thread Bill Freeman
Virtual environments can, indeed, be used under Apache.  I presume other
front ends can also handle this.

For Apache, the separate VE's need to be in separate deamon process groups,
so that their sys.path settings can differ.

The primary thing that virtualenv does for you is tweak sys.path, usually
by setting PYTHONHOME, but there are other ways.

If using a new enough mod_wsgi (3.4 or later, I htink), there is a
python-home option to the WSGIDaemonProcess directive.  Otherwise you can
fiddle sys.path in your wsgi script file.  If you are using
Apache/mod_wsgi, there is lots of useful documentation and a pointer to
their mailing list at http://code.google.com/p/modwsgi/


On Mon, Sep 30, 2013 at 11:30 AM, Gerald Klein  wrote:

> Sorry please disregard I didn't read far enough into your message
>
>
> On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh wrote:
>
>> Is it possible to install multiple versions of Django on single ubuntu
>> server.
>> If yes, please tell me how to do this.
>> I have already made a try for this using virtual environment, but
>> found that it is only for development.
>>
>> --
>>
>> Jasvir Singh Grewal
>> Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
>
> Gerald Klein DBA
>
> contac...@geraldklein.com
>
> www.geraldklein.com 
>
> geraldklein.wordpress.com
>
> j...@zognet.com
>
> 708-599-0352
>
>
> Arch Awesome, Ranger & Vim the coding triple threat.
>
> Linux registered user #548580
>
> Brought to you by the Amish Mafia
>
>  --
> 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/CAP8NtCw5tr3%3Dt0k6H2CUVGfaNkX6jFhArh6E1iz32s412%3DjL0Q%40mail.gmail.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 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0trj-MnweyArGTyfSy6SR0wdRLdwV_tYCXfOvA%3DgvOeGg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: xadmin override base_site.html

2013-09-30 Thread Christian Schulz
Ahh got it , different versions in my installation.

Christian


Am Montag, 30. September 2013 16:54:43 UTC+2 schrieb Christian Schulz:
>
> Hi,
>
> has someboday a clue why I get this error.
> Without the modifications xadmin works fine, but if  I copy  for 
> modifications in my ../templates/xadmin/base_site.html
> I got the error below.
>
> If I cut this *if step*  the template is loaded but without surprise in 
> fragile form. Has anybody an idea where this menu_template
> comes from , can't find it yet?  With the complete  template/xadmin folder 
> in my ../templatesthe problem is still the same.
>
> Thanks Christian
>
> TemplateDoesNotExist at /admin
> No exception supplied
> Request Method: GET
> Request URL: http://localhost:8000/admin
> Django Version: 1.5.4
> Exception Type: TemplateDoesNotExist
> Exception Location: 
> /home/chris/.local/lib/python2.7/site-packages/django/template/loader.py 
> in find_template, line 139
>
>
>
> 31  32  class="col-sm-1 col-md-2"> 33 {% block navbar %} 34 {% if nav_menu %} 35 {% 
> include menu_template %} 36 {% else %} 37 {% trans "You don't have 
> permission to edit anything." %} 38 {% endif %} 39 {% endblock %} 40
>
>
>

-- 
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/fe62b230-1071-4ee6-a15b-67720f4baf3f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Multiple versions of Django

2013-09-30 Thread Gerald Klein
Sorry please disregard I didn't read far enough into your message


On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh wrote:

> Is it possible to install multiple versions of Django on single ubuntu
> server.
> If yes, please tell me how to do this.
> I have already made a try for this using virtual environment, but
> found that it is only for development.
>
> --
>
> Jasvir Singh Grewal
> Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

geraldklein.wordpress.com

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580

Brought to you by the Amish Mafia

-- 
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/CAP8NtCw5tr3%3Dt0k6H2CUVGfaNkX6jFhArh6E1iz32s412%3DjL0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Multiple versions of Django

2013-09-30 Thread Gerald Klein
Yes, use something like VirtualEnv, it allows you to separate website
environments and requirements and it has nice additionals to help you
publish


On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh wrote:

> Is it possible to install multiple versions of Django on single ubuntu
> server.
> If yes, please tell me how to do this.
> I have already made a try for this using virtual environment, but
> found that it is only for development.
>
> --
>
> Jasvir Singh Grewal
> Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

geraldklein.wordpress.com

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580

Brought to you by the Amish Mafia

-- 
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/CAP8NtCxFLYQ795ZyzHbHumNH9uDpf-MUET7PbxwyA%3DXVovo9pw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Multiple versions of Django

2013-09-30 Thread Jasvir Singh
Is it possible to install multiple versions of Django on single ubuntu server.
If yes, please tell me how to do this.
I have already made a try for this using virtual environment, but
found that it is only for development.

-- 

Jasvir Singh Grewal
Blog:http://jasvirsinghgrewal91.wordpress.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 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/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django South - SyntaxError: invalid syntax (, line 1)

2013-09-30 Thread Ivan Goncalves
Hi 

I'm having trouble with the South.

In the model below:

class Carrier (models.Model):
 name = models.CharField (max_length = 40, blank = False, null = False, 
verbose_name = 'Name')
 user = models.ForeignKey (User, blank = True, null = True)

 def save (self, force_insert = False, force_update = False):
 self.nome self.nome.upper = ()
 super (Carrier, self). save (force_insert, force_update)

 def __ unicode__ (self):
 return u '% s'% (self.nome)

the error occurs when i run the migrate after South on the app.
SyntaxError: invalid syntax (, line 1)

But if my model does not have the user field, then the error message does 
not occur, as shown below:

class Carrier (models.Model):
 name = models.CharField (max_length = 40, blank = False, null = False, 
verbose_name = 'Name')

 def save (self, force_insert = False, force_update = False):
 self.nome self.nome.upper = ()
 super (Carrier, self). save (force_insert, force_update)

 def __ unicode__ (self):
 return u '% s'% (self.nome)


I need the field User. What I have to do ?

Thanks a lot.

Ivan 

-- 
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/45f2764c-c903-41c2-b692-2afb9f9332ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Monday, 30 September 2013 15:41:47 UTC+1, Marcin Szamotulski wrote:

>
> I don't do anything odd: I simply modify it by typing in side textarea. 
> The page has a very simple JavaScript which does not do anything with 
> the textarea (though I double-checked that turning it off does not 
> improve the situation).  Inspecting the request reveals that the data is 
> indeed submitted twice (thus django correctly interpret the situation). 
>
> The form is using enctype='multipart/form-data' since it is also used to 
> submit a file, though leaving only the textarea inside the form and 
> removing the enctype does not help. 
>
> I also checked this in both firefox and chrome and both show that the 
> POST data for this textarea is submitted twice. 
>
> Any ideas? 
>
> Thanks for help, 
> Marcin 
>

Can you perhaps post the template fragment that renders the field, and also 
the rendered HTML?
--
DR. 

-- 
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/045cca12-7ec5-4d29-bc6c-4a601eff5996%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


xadmin override base_site.html

2013-09-30 Thread Christian Schulz
Hi,

has someboday a clue why I get this error.
Without the modifications xadmin works fine, but if  I copy  for 
modifications in my ../templates/xadmin/base_site.html
I got the error below.

If I cut this *if step*  the template is loaded but without surprise in 
fragile form. Has anybody an idea where this menu_template
comes from , can't find it yet?  With the complete  template/xadmin folder 
in my ../templatesthe problem is still the same.

Thanks Christian

TemplateDoesNotExist at /admin
No exception supplied
Request Method: GET
Request URL: http://localhost:8000/admin
Django Version: 1.5.4
Exception Type: TemplateDoesNotExist
Exception Location: 
/home/chris/.local/lib/python2.7/site-packages/django/template/loader.py 
in find_template, line 139



31  32  33 {% block navbar %} 34 {% if nav_menu %} 35 {% 
include menu_template %} 36 {% else %} 37 {% trans "You don't have 
permission to edit anything." %} 38 {% endif %} 39 {% endblock %} 40


-- 
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/5ca8f889-7d16-487c-9d92-ae9afc3db383%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Marcin Szamotulski
On 06:38 Mon 30 Sep , Daniel Roseman wrote:
> On Sunday, 29 September 2013 22:58:38 UTC+1, Marcin Szamotulski wrote:
> 
> > Dear Django users, 
> >
> > The short question is: How to use Textarea widget with initial value? 
> > The long version: I have a form with a simple Textarea widget 
> >
> > class Form(forms.Form): 
> >
> > f = forms.CharField(widget=forms.Textarea()) 
> >
> > in a view I set an initial value: 
> >
> > form = Form(initial={'f': 'initial value}) 
> >
> > and it renders on a page as 
> > intial value 
> >
> >
> > Then let say I modify the initial value to 'new value' 
> >
> > Then when I POST the form (i.e. send a POST request).  The 
> > request.POST.getlist('f') 
> > returns 
> > ['new value', 'intial value'] 
> > and since the 'initial value' is after the 'new value' when I intialise 
> > the form 
> > form = Form(request.POST) 
> > it has form.cleaned_data['f'] == 'initial value'. 
> >
> > What is the correct way to make initial value in a textarea so that it 
> > is not submitted with the form. 
> >
> > Playing with this I tried to remove the 'initial value' using javascript 
> > ($('textarea[name="f"]).html('')), but the submitted date (request.POST) 
> > was not affected. 
> >
> > Thanks for help, 
> > Marcin 
> >
> 
> How are you "modifying the initial value to 'new value' "? If you're simply 
> typing in the field to replace the text that's there, there's no way that 
> request.POST can contain the original data. You seem to be doing something 
> odd somewhere.
> --
> DR.

I don't do anything odd: I simply modify it by typing in side textarea.
The page has a very simple JavaScript which does not do anything with
the textarea (though I double-checked that turning it off does not
improve the situation).  Inspecting the request reveals that the data is
indeed submitted twice (thus django correctly interpret the situation).

The form is using enctype='multipart/form-data' since it is also used to
submit a file, though leaving only the textarea inside the form and
removing the enctype does not help.

I also checked this in both firefox and chrome and both show that the
POST data for this textarea is submitted twice.

Any ideas?

Thanks for help,
Marcin

-- 
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/20130930144147.GG27988%40flying-circus.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Creating multiple objects at once

2013-09-30 Thread Hector Armando Vela Santos
well, you can always write the raw SQL querie...
https://docs.djangoproject.com/en/1.4/topics/db/sql/

On Sunday, September 29, 2013 10:16:47 PM UTC-5, Lachlan Musicman wrote:
>
> Hola, 
>
> I have a inventory system with Parts and Part types. Part Types are 
> Archetypes, parts are instances of Part Types with details (unit cost, 
> serial number, date of purchase, etc). 
>
> A big issue is that not all Parts have serial numbers (box of 1000 
> screws for instance). But when we get a large quantity of parts that I 
> would like to apply serial numbers to, data entry staff don't want to 
> enter the otherwise identical data again and again. 
>
> Since most serialised products we are storing come with numbers that 
> are "in serial", I want to replace the creation process with a form 
> that also asks for "first serial number" and "number of parts" - 
> giving a nice list of easily incremented serial numbers. Then we can 
> create the requisite objects at the same time, and save them with just 
> the diff serial. 
>
> What is the best way to do this? 
>
> I've seen three solutions so far: 
>
> 1. bulk_create 
> https://docs.djangoproject.com/en/1.4/ref/models/querysets/#bulk-create 
> problem: doesn't call model save method (in my case, where the slug is 
> populated from the id). 
>
> 2. transaction.commit_manually 
>
> https://docs.djangoproject.com/en/dev/topics/db/transactions/#django.db.transaction.commit_manually
>  
>
> 3. Signals 
> https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save
>  
> (and now that I think about it, probably transaction.commit_manually 
> coupled with it). 
>
> What does the list recommend as a method? 
>
> Also, as I discovered in the IRC the other day, there really is a time 
> when CBVs aren't appropriate. Should this process be a CBV - it seems 
> a lot more suited to a FBV. 
>
> Cheers 
> L. 
>
>
> -- 
> Maya Otos (@maya_otos) tweeted at 9:27 PM on Tue, Jul 30, 2013: 
> When you used to be punk, and now you are still punk but not as punk, 
> are you post-punk or decaying punk or ex-punk or just not punk anymore 
>

-- 
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/f166ff7b-f449-47b1-add8-05d07759f9b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Интегрция django и 1c

2013-09-30 Thread Rafael E. Ferrero
No Che!, no lo usé nunca... ni siquiera tenía idea de su existencia,
igualmente veo muchas urls con la extensión PHP que no me hacen ninguna
gracia :P

Saludos !!


2013/9/30 Иван Земцов 

> Всем привет!
> Кто нибудь обладает более подробной информацией по протоколу обмена чем
> тут ?
> http://v8.1c.ru/edi/edi_stnd/131/
>
> Может у кого-то есть какая-нибудь реализация данного протокола?
>
> --
> С уважением, Иван
>
> --
> 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/CACt1%2BqctgCtF0qbmxOtmFi2rRQ06zXn2AMyyPh_%3D5cswBUNA6w%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rafael E. Ferrero

-- 
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/CAJJc_8V-9xdN38dsBOmy_1CngU4UM2aBCf36vUvkcWc2LVLFoA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Textarea and initial value

2013-09-30 Thread Daniel Roseman
On Sunday, 29 September 2013 22:58:38 UTC+1, Marcin Szamotulski wrote:

> Dear Django users, 
>
> The short question is: How to use Textarea widget with initial value? 
> The long version: I have a form with a simple Textarea widget 
>
> class Form(forms.Form): 
>
> f = forms.CharField(widget=forms.Textarea()) 
>
> in a view I set an initial value: 
>
> form = Form(initial={'f': 'initial value}) 
>
> and it renders on a page as 
> intial value 
>
>
> Then let say I modify the initial value to 'new value' 
>
> Then when I POST the form (i.e. send a POST request).  The 
> request.POST.getlist('f') 
> returns 
> ['new value', 'intial value'] 
> and since the 'initial value' is after the 'new value' when I intialise 
> the form 
> form = Form(request.POST) 
> it has form.cleaned_data['f'] == 'initial value'. 
>
> What is the correct way to make initial value in a textarea so that it 
> is not submitted with the form. 
>
> Playing with this I tried to remove the 'initial value' using javascript 
> ($('textarea[name="f"]).html('')), but the submitted date (request.POST) 
> was not affected. 
>
> Thanks for help, 
> Marcin 
>

How are you "modifying the initial value to 'new value' "? If you're simply 
typing in the field to replace the text that's there, there's no way that 
request.POST can contain the original data. You seem to be doing something 
odd somewhere.
--
DR.

-- 
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/aeb5643b-5e8b-4fa7-9867-d80a38307d6c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Dealing with redundant JS inclusions at template levels

2013-09-30 Thread Dariel Dato-on
You can consider using Django Sekizai to manage your Javascript and CSS 
imports:

https://django-sekizai.readthedocs.org/en/latest/

Hope that helps!

Best,
Dariel Dato-on

On Monday, September 30, 2013 1:12:54 AM UTC-5, dspruell wrote:
>
> Spent a bit of time debugging some faulty JavaScript library 
> functionality before I realized that I had included the library at 
> multiple levels in the project - first site-wide in the base template, 
> and then within a app. I think I ran into this: 
>
>
> http://stackoverflow.com/questions/4891278/what-is-the-danger-in-including-the-same-javascript-library-twice
>  
>
> Is there a good design pattern to this situation, bearing in mind a 
> need to include JS libraries at project level and a desire to use apps 
> that include the same libraries in an attempt to be reusable? 
>
> Looking at jQuery and Bootstrap for this. 
>
> -- 
> Darren Spruell 
> phatb...@gmail.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 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/f1c0a5c5-3c8b-47e8-9e8b-43751dda79e9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Интегрция django и 1c

2013-09-30 Thread Иван Земцов
Всем привет!
Кто нибудь обладает более подробной информацией по протоколу обмена чем тут
?
http://v8.1c.ru/edi/edi_stnd/131/

Может у кого-то есть какая-нибудь реализация данного протокола?

-- 
С уважением, Иван

-- 
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/CACt1%2BqctgCtF0qbmxOtmFi2rRQ06zXn2AMyyPh_%3D5cswBUNA6w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Not able to create an simple application using DB (syncdb error)

2013-09-30 Thread Bill Freeman
Have you said which version of Django you are using?  (If so, it slipped
past me.)

Is this all code that you wrote yourself, or did you copy some or all it
from somewhere?
If copied, under what version of Django was it being used?

Have you gone through and understood the tutorial for the version of Django
you are using?

Please, in a terminal window, try:

   cd c:\Users\gsherieff\blog1
   python
   import blog1.settings

What is printed?


On Sat, Sep 28, 2013 at 8:28 AM, s. gulab  wrote:

> Hi,
>
>Thanks for your reply.I have tried with your answer which has given to
> last question but,still i am getting the same error.PFA of
> Screenshots.Please give me some simple steps or program to create an
> application with DB.
>
> Thanks in Advance!
>
> Thanks & Regards,
> Gulab S
>
>
> On Friday, 27 September 2013 23:40:02 UTC+5:30, ke1g wrote:
>
>> Not all that useful unless you un-hide the file extensions.
>>
>> I'm guessing that there are manage.py scripts in both the upper and lower
>> blog1 directories.  For recent Djangos, manage.py should only be in the
>> upper directory. The lower directory contains settings.py, urls.py, wsgo/[u
>> amd __init__.py.
>>
>> I see that you are in the lower directory when you try to run it, which
>> is also wrong.  cd up a level and try again.
>>
>> Are you working from a book written for an older version of Django, or
>> are you trying to port an project written for an older version to a modern
>> Django?  I can't see how you arrive at the directory contents that you have.
>>
>>
>>
>>
>> On Fri, Sep 27, 2013 at 1:24 PM, s. gulab  wrote:
>>
>>> Hi,
>>>
>>>Please find the attachment.In that i have pasted the screen shot of
>>> my paths,output and everything.
>>>
>>> Thanks & Regards,
>>> Gulab S
>>>
>>>
>>> On Thursday, 26 September 2013 00:01:21 UTC+5:30, ke1g wrote:
>>>
 And where is your settings.py file?  If it is in the same directory as
 manage.py, and it is a reasonably current Django (1.4, 1.5), then it's in
 the wrong place.  It belongs in a sub-directory named 'blog1', along with
 your urls.py, wsgi.py and an empty __init__.py .



 On Wed, Sep 25, 2013 at 1:40 PM, s. gulab  wrote:

> When i give " ./manage.py syncdb " i am getting following error.
>
> " *Traceback (most recent call last):*
> *  File "manage.py", line 10, in *
> *execute_from_command_line(sys.argv)*
> *  File 
> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
> line*
> *453, in execute_from_command_line*
> *utility.execute()*
> *  File 
> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
> line*
> *392, in execute*
> *self.fetch_command(subcommand).run_from_argv(self.argv)*
> *  File 
> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
> line*
> *263, in fetch_command*
> *app_name = get_commands()[subcommand]*
> *  File 
> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
> line*
> *109, in get_commands*
> *apps = settings.INSTALLED_APPS*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
> 53, in __ge*
> *tattr__*
> *self._setup(name)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
> 48, in _set*
> *up*
> *self._wrapped = Settings(settings_module)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
> 134, in __i*
> *nit__*
> *raise ImportError("Could not import settings '%s' (Is it on
> sys.path?): %s"*
> *% (self.SETTINGS_MODULE, e))*
> *ImportError: Could not import settings 'blog1.settings' (Is it on
> sys.path?): No*
> * module named blog1.settings* "
>
>  manage.py:
> 
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE",
> "blog1.settings")
>
> from django.core.management import execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
> settings.py:
> 
>
> # Django settings for blog1 project.
>
> import os
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> *DATABASES = {*
> *'default': {*
> *'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.*
> *'NAME': 'blog1',  # Or path to database
> file if using sqlite3.*
> *# The following settings are not used with sqlite3:*
> *'USER': 'blog',*
> *'PASSWORD': 'blog',*
> *'HOST': '',  # 

Re: Dealing with redundant JS inclusions at template levels

2013-09-30 Thread Rafael E. Ferrero
I Dont know your design, usually i include the js library on base template
and my apps templates extend from that... or just put another base template
for every app...

If you have some example code or tell us why you do that then we be more
helpfull

See ya



2013/9/30 Darren Spruell 

> Spent a bit of time debugging some faulty JavaScript library
> functionality before I realized that I had included the library at
> multiple levels in the project - first site-wide in the base template,
> and then within a app. I think I ran into this:
>
>
> http://stackoverflow.com/questions/4891278/what-is-the-danger-in-including-the-same-javascript-library-twice
>
> Is there a good design pattern to this situation, bearing in mind a
> need to include JS libraries at project level and a desire to use apps
> that include the same libraries in an attempt to be reusable?
>
> Looking at jQuery and Bootstrap for this.
>
> --
> Darren Spruell
> phatbuck...@gmail.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 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/CAKVSOJVxQ8XF9wojenv6FW53CTHw28xMsD7LCoYas5%2BRchxtBA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rafael E. Ferrero

-- 
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/CAJJc_8XTE884Y9oCCK1StrtRGxt0Jvd%3DcJiOfboNOdarK%3DC05A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Dealing with redundant JS inclusions at template levels

2013-09-30 Thread Darren Spruell
Spent a bit of time debugging some faulty JavaScript library
functionality before I realized that I had included the library at
multiple levels in the project - first site-wide in the base template,
and then within a app. I think I ran into this:

http://stackoverflow.com/questions/4891278/what-is-the-danger-in-including-the-same-javascript-library-twice

Is there a good design pattern to this situation, bearing in mind a
need to include JS libraries at project level and a desire to use apps
that include the same libraries in an attempt to be reusable?

Looking at jQuery and Bootstrap for this.

-- 
Darren Spruell
phatbuck...@gmail.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 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/CAKVSOJVxQ8XF9wojenv6FW53CTHw28xMsD7LCoYas5%2BRchxtBA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Executing validation on entry to class-based views

2013-09-30 Thread Darren Spruell
Hm, yes! Thanks, had forgotten about dispatch().

On Thu, Sep 26, 2013 at 1:24 AM, Daniel Roseman  wrote:
> On Thursday, 26 September 2013 07:29:38 UTC+1, dspruell wrote:
>>
>> Greetings,
>>
>> I have an app with a CBV for the main functionality that I'd like to
>> do some validation on config settings (in settings.py) before carrying
>> out the view.
>>
>> My particular view in this case is a FormWizard, but I'd like to know
>> general to any CBV; what is the correct pattern for doing this? Is
>> there a standard way to execute validation code upon entering a view
>> that allows one to access the request object (e.g. for setting
>> messages) and redirecting clients?
>>
>> My initial thought was to override __init__() and perform it there but
>> IIANM it lacks self.request at that point.
>>
>> What I'd like to implement:
>>
>> if not settings.SOMEAPP_SETTINGS.get('sender_address'):
>> messages.error(self.request, "Configuration error:
>> submission sender address not found. Configure SOMEAPP_SETTINGS in
>> your project settings file.")
>> return redirect('index')
>>
>> --
>> Darren Spruell
>> phatb...@gmail.com
>
>
>
> One way would be to override `dispatch()`.  You have access to the request
> there and can choose whether to call the super method to do the actual
> dispatching, or redirect instead.
> --
> DR.
>
> --
> 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.



-- 
Darren Spruell
phatbuck...@gmail.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 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/CAKVSOJWnEG_GfonWfA%2BjUAwJ1_AfM8iRaQTLV_9XTSLCYw4mOg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.