Re: Abridged summary of django-users@googlegroups.com - 23 updates in 11 topics

16 views
Skip to first unread message

Ranjith Kumar

unread,
Jun 21, 2017, 11:41:23 PM6/21/17
to django...@googlegroups.com
Hello All,
On Django admin when I tried to update the existing data I’m getting an error,

AttributeError: 'str' object has no attribute '__iter__'


models.py

class SSPDrive(models.Model):

drive_year = models.DateField(verbose_name='Drive year', null=True, blank=True, help_text="Enter drive year.")

class Meta:
verbose_name = "SSP Drive"
verbose_name_plural = "SSP Drives"

def __str__(self):
return str('SSP'+str(self.drive_year.year)[-2:]+'T'+str(self.drive_year.year+1)[-2:])

class SSPDriveAdmin(admin.ModelAdmin):

    save_as = True

    class Meta:
        model = SSPDrive

admin.site.register(SSPDrive, SSPDriveAdmin)

Can someone help me out, why am I getting this error…

On 21-Jun-2017, at 6:37 PM, django...@googlegroups.com wrote:

Melvyn Sopacua <m.r.s...@gmail.com>: Jun 20 10:37PM +0200

On Monday 19 June 2017 21:11:23 jon stan wrote:
 
> service__icontains='fast food')
 
> but i cant get it to work correctly. i get 'burger-place' for the
> name, prod, and service variables for ...more
Derek <game...@gmail.com>: Jun 21 03:12AM -0700

Your clue is in the word "variable" that you used. The "variables" for a
Django model are its fields; so what you are looking for is a value stored
in your model's field.
 
e.g.
 
service = ...more
Scot Hacker <scot....@gmail.com>: Jun 20 10:40PM -0700

One strategy might be to:
 
1) Bring in the data under a different column name ('old_id' ?)
2) In a single migration, drop the default ID column, rename old_id to id,
and give it primary_key=True ...more
Melvyn Sopacua <m.r.s...@gmail.com>: Jun 21 11:43AM +0200

On Monday 19 June 2017 16:29:48 Thomas Hauk wrote:
> serial field, and then run a SQL command like "SELECT
> SETVAL('some_table_field_id_seq', 100000)". I think. :)
 
> Does Django expose ...more
Mannu Gupta <abhiman...@gmail.com>: Jun 21 12:45AM -0700

I want to make a role based user in Django like the following :-
 
User with Subscription level 0 will have some feature and some basic fields
like first name , last name etc.
...more
Jani Tiainen <red...@gmail.com>: Jun 21 11:11AM +0300

Hi,
 
We have been using user groups for that. And then we check and filter out
based on given group(s).
 
...more
Mannu Gupta <abhiman...@gmail.com>: Jun 21 01:44PM +0530

Hi ,
Will I be able to trace if user upgrde the subscription level ?
 
Manni
 
...more
Jani Tiainen <red...@gmail.com>: Jun 21 11:18AM +0300

Well its your code, so yes if you write code that does it.
 
It doesn't happen magically for you.
 
...more
Mannu Gupta <abhiman...@gmail.com>: Jun 21 01:53PM +0530

I meant that using your method i.e by making different groups .
When he upgrade the group .
How about making another table having user, his subscription level and
changed_at field(which traces when ...more
Jani Tiainen <red...@gmail.com>: Jun 21 12:43PM +0300

Hi,
 
User can't upgrade his group. It is your code that does it. And it is your
code responsibility to track changes etc.
 
User just may have a button on ui that invokes your code (view) but rest ...more
dtdave <dtur...@googlemail.com>: Jun 21 02:39AM -0700

I have a model with a manytomany field as follows:

contact = ChainedManyToManyField(
'contacts.Contact',
chained_field="practice",
chained_model_field="practice", ...more
Melvyn Sopacua <m.r.s...@gmail.com>: Jun 20 11:20PM +0200

On Monday 19 June 2017 16:43:12 James Schneider wrote:
> regex algorithm behavior is incorrect. In most cases, the matching
> algorithm will take the first and almost always shortest match (there ...more
James Schneider <jrschn...@gmail.com>: Jun 20 06:08PM -0700


> > The .* modifier means "match any character (.) zero or more times
 
> > (*)". Since blank/ matches the .* zero times, it is a match for your
 
> > expression.
 
Yeah...you're right. ...more
Melvyn Sopacua <m.r.s...@gmail.com>: Jun 21 11:08AM +0200

On Tuesday 20 June 2017 18:08:02 James Schneider wrote:
 
> that
> requests.GET.get('abc') will return '12/' per the last example from
> the OP.
 
Yes, but for the first problem, r'^blank/.*$' ...more
Santosh Yelamarthi <santosh.y...@gmail.com>: Jun 20 11:18PM -0700

Hi All,
 
Can anyone please share how to validate phone number in django.
 
Thanks in advance.
...more
"Andréas Kühne" <andrea...@hypercode.se>: Jun 21 09:03AM +0200

Hi,
 
https://github.com/stefanfoulis/django-phonenumber-field
 
You could probably use that library - it works against googles phonenumber
library, which is the library that is used on andoid ...more
Mike Dewhirst <mi...@dewhirst.com.au>: Jun 21 09:50AM +1000

On 20/06/2017 1:13 PM, Mike Dewhirst wrote:
> the unwanted models, they never get created.
 
> You need a bit of jiggery pokery in admin.py but it can be done. I'll
> try and get some time later ...more
Melvyn Sopacua <m.r.s...@gmail.com>: Jun 20 10:31PM +0200

On Tuesday 20 June 2017 02:24:20 Rafael E. Ferrero wrote:
 
 
> The trouble it's because Firefighter class is a child of Person
class
> so the Firefighter item are in the two dropdowns and it ...more
Philipp Zedler <phi...@neue-musik.com>: Jun 20 05:41PM +0200

Hi Django Users,
 
I'd like to manage composer packages using a Django App. (Composer is
the git of PHP, roughly speaking.)
 
Is there already some Django App that does this?
 
Best wishes ...more
Melvyn Sopacua <m.r.s...@gmail.com>: Jun 20 10:16PM +0200

On Tuesday 20 June 2017 17:41:03 Philipp Zedler wrote:
 
> I'd like to manage composer packages using a Django App.
(Composer is
> the git of PHP, roughly speaking.)
 
I'm gonna say you meant ...more
MigDotCom <migue...@gmail.com>: Jun 20 11:24AM -0700

I want to use python and django to make a news-feed for my website I have
searched about it but i still don't even have clue where to start:
1. Do i make it as a new app in my django site? ...more
yingi keme <ying...@gmail.com>: Jun 20 09:03PM +0100

Is your project residing in django? Or you are using a different web framework?
 
Yingi Kem
 
...more
Andrew Godwin <and...@aeracode.org>: Jun 20 10:40AM -0700

Well, I need to know even a vague shape of what's happening to be able to
help - is it getting stuck in an infinite loop? Is it running out of
memory? Without this sort of information, I won't be ...more
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to django-users...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages