Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Member Avatar for felix001

I have a model that looks like ... class Person(models.Model): name = models.CharField(max_length=50) birthday = models.DateField() def __unicode__(self): return u'%s %s' % (self.name, self.birthday) class Address(models.Model): person = models.ForeignKey(Person) address = models.CharField(max_length=150) def __unicode__(self): return u'%s %s' % (self.person, self.address) class Anniversy(models.Model): person = models.ForeignKey(Person) anniversy = models.DateField() def __unicode__(self): …

Member Avatar for chriswelborn
0
193
Member Avatar for felix001

What is the best way to use a dictionary within a class. Do I have to assign the dict within the class ? Thanks

Member Avatar for vegaseat
0
120
Member Avatar for felix001

Hi, Im looking for an easy method to validate the input of a form. Ideally I want to remove all spaces from the inputed text and also ensure that there are no speical characters within it other then a forward slash. The input will look like this 192.168.1.1/24. Thanks,

Member Avatar for Troy III
0
204
Member Avatar for felix001

When trying to install django tagging Im getting the following error : [root@Fileserver django-tagging]# pwd /opt/django/djangoblog/django-tagging [root@Fileserver django-tagging]# python setup.py install Traceback (most recent call last): File "setup.py", line 49, in ? version_tuple = __import__('tagging').VERSION File "/opt/django/djangoblog/django-tagging/tagging/__init__.py", line 3, in ? from tagging.managers import ModelTaggedItemManager, TagDescriptor File "/opt/django/djangoblog/django-tagging/tagging/managers.py", line 5, …

Member Avatar for TrustyTony
0
175
Member Avatar for felix001

I need to create a simple input form without the use of a DB. Can anyone please assist? Thnaks,

Member Avatar for felix001
0
91
Member Avatar for felix001

Hi, Can anyone please tell me how to log all activity of my mysql database. Also do you know if there any tripwire services/products that are available ? Thanks,

Member Avatar for felix001
0
92
Member Avatar for felix001

Ive been developing a new website for the last few months. Initalling I configured all my databases to use the root account. Now I need to change all the passwords along with changing the web UI login. Ive tried changing the password for root within the gui but it doesnt …

0
73
Member Avatar for felix001

Does anyone know the SQL statement for replacing a string in the whole of a database. My database is called DB1 and I want to remove any instance of "Table/". Many Thanks,

Member Avatar for smantscheff
0
145
Member Avatar for felix001

I need to write a small bit of code that will print an error if I cannot resolve the name to IP. I see that you can use the "socket.gethostbyaddr" methods but I cant seem to find a simple method/exception for when it does not find an IP address. Also …

Member Avatar for Gribouillis
0
221
Member Avatar for felix001

What is the best way to print columns within python. Each of the values that I will be printing will be anything from 1 to 8 characters long. I had found this but wondered if there was any other methods... [url]http://www.daniweb.com/software-development/python/threads/202023[/url] Thanks,

Member Avatar for felix001
0
322
Member Avatar for felix001

Does anyone know how I can base my re condition based on it not finding a match. I have the following at the moment ..... [CODE]if re.search(r'123', os.uname()[1]):[/CODE]

Member Avatar for felix001
0
84
Member Avatar for felix001

I have a number of lists such as ['BLAH', 19, '11111', 'Fa0/19', '100000000'] I either need to make a list of lists or a dictionary containing lists. What would be the recommended one to do and will make the process of further sorting and text manipulation the easiest. Thanks,

Member Avatar for woooee
0
166
Member Avatar for felix001

What is the best way to invoke the os.system command and assign it to a variable without printing the output ? Example : [CODE]ifName = os.system('snmpwalk -v 1 -c <community> %s ifName.%s' % (switch,port))[/CODE] Also with the output of the snmpwalk I will be wanting to only assign the last …

Member Avatar for felix001
0
288
Member Avatar for felix001

Ive been looking at the sys.path.append('/../') command in order to import a python module to a given folder. The thing is doesnt python modules have to be installed from wither source or by the given package manager i.e rpm ?? Many Thanks,

Member Avatar for hughesadam_87
0
87
Member Avatar for felix001

Im using pexpect to output some terminal commands, but im facing the following issue. The code is [CODE]porttype = "Gi" print expectSw.sendline ("sh int counters errors | i %.*/1 ") % porttype expectSw.expect ('.*#') print expectSw.after[/CODE] But when I run the code i get ... [CODE]Traceback (most recent call last): …

Member Avatar for felix001
0
553
Member Avatar for felix001

Does anyone know how to use the subprocess.call to assign the ouput of a command to a string. At the moment it only assigns the return code ?? [CODE]>>> hostname = call(["hostname", "-d"]) lon3.corp.rackspace.com >>> print hostname 0[/CODE] Thanks,

Member Avatar for TrustyTony
0
116
Member Avatar for felix001

Im currently working on a HTML page to add additional input boxes. I have the following code. Does anyone know how I would go about adding the required vlaues to each of the input boxes, for use later on within php ?? [CODE]<html> <head> <title></title> <script language="javascript"> fields = 0; …

Member Avatar for felix001
0
163
Member Avatar for felix001

Is there an easy way to post a form to the same page. I currently have an HTML (/javascript) page with a number of selection forms. I want to then display certin HTML below below based upon the users selection. Many Thanks,

Member Avatar for broj1
0
74
Member Avatar for felix001

Can anyone help. Im trying to create 2 drop down lists (using the select tag). Based on the choice of the first drop down list the second list is populated. Thanks,

Member Avatar for felix001
0
137
Member Avatar for felix001

Ive written a small program to convert celcuis o Fahrenheit and vice versa. The script as it stands works : [CODE]#!/usr/bin/python import sys def convert(t,fc): if t == "c": print (fc * 9) / 5 + 32,"Degress Fahrenheit" elif t == "f": print (fc - 32) / 9 * 5,"Degress …

Member Avatar for Gribouillis
0
185
Member Avatar for felix001

I currently have the following php : <?php system('/usr/bin/whois 4.2.2.2'); ?> What is the easiest way to replace the newlines with <BR>\n. Thanks,

Member Avatar for diafol
0
2K
Member Avatar for felix001

Im trying to run a small python CGI script but when i run it i get the error : [B]malformed header from script. Bad header=[Querying whois.internic.net]: hello_get.py[/B] The CGI scripts im trying to run are : [CODE]#!/usr/bin/python # Import modules for CGI handling import cgi, cgitb import os # Create …

0
76
Member Avatar for felix001

Hi, Im trying to add code tags to my CSS. Ive added the following to my CSS : [CODE]code { background-color: #F9F9F9; border: 1px dashed #444444; color: black; font-family: momspace,"courier new"; line-height: 1.1em; padding: 1em; }[/CODE] But when running my site in firefox the browser doesnt even seen the new …

Member Avatar for GreenDay2001
0
95
Member Avatar for felix001

On random pages of my site im getting the following error: [CODE]Permission denied for <http://googleads.g.doubleclick.net> to call method Location.toString on <http://fir3net.com>.[/CODE] I have no clue on how to debug this or what could be causing this. I have searched the web but no one seems to know what this is …

0
63
Member Avatar for felix001

Can anyone help ? Im looking to find a MySQL query using regular expressions to allow me to remove any paragraph html tags within block quote tags. An example is : [CODE]<blockquote> <p>TEXT</p> </blockquote>[/CODE] Should be : [CODE]<blockquote> TEXT </blockquote> [/CODE] Thanks,

Member Avatar for smantscheff
0
125
Member Avatar for felix001

Im pretty new to python so im still finding my feet.. Ive written a small ftp program that downloads a file but its quite basic in that it gets the last element from the list and then downloads it. What is the easiest way to add some logic so it …

Member Avatar for felix001
0
153
Member Avatar for felix001

Im running a site with Intense Debate. For the life of me I cannot get the page to auto adjust itself to the site of the Intense Debate Comments. You can get an idea of the issue here ;[URL="http://fir3net.com/Firewalls/Checkpoint/checkpoint-commands.html"] http://fir3net.com/Firewalls/Checkpoint/checkpoint-commands.html[/URL]

Member Avatar for felix001
0
92
Member Avatar for felix001

I currently have a table within my page at : [url]http://www.fir3net.com/Firewalls/Juniper-Netscreen/juniper-commands.html[/url] The first 2 tables have been assigned a class of X1. My aim is to do the following : [LIST=1] [*]Set the table to a width of 85% [*]Set the first column to a set width [*]Set a black …

Member Avatar for shaya4207
0
119
Member Avatar for felix001

I currently have an XML (pasted below) that I want to place into a dictonary. With each dictonary key being the content of the XML`s <TITLE> markup and the values containing the content of the XML`s <ARTISTS*> markup. [CODE]<EXAMPLE> <CD> <TITLE>TITLE1</TITLE> <ARTIST1>ARTIST-ABC</ARTIST1> <ARTIST2>ARTIST-DEF</ARTIST2> </CD> <CD> <TITLE>TITLE2</TITLE> <ARTIST1>ARTIST-XYZ</ARTIST1> </CD> <CD> <TITLE>TITLE3</TITLE> …

Member Avatar for griswolf
0
133
Member Avatar for Rk_Raj

Hi Friends, Here is my Scenario, I have two ISP Connections from different Providers BSNL and Sify. Both are 1MBps. In my Office Now we are using Sify for Only one Machine and BSNL is configured in wifi router. But Often BSNL network is in problem. So we have planned …

Member Avatar for felix001
0
267